arphaman added a comment.

I find the change to the diagnostic for enum constants a bit off putting, since 
the warning can refer to the enum itself when an enum constant is used. I'd 
rather we say something like `'EnumConstant' is deprecated` and keep the note 
that this patch uses (`'Enum' has been explicitly marked deprecated here`).



================
Comment at: lib/Sema/SemaDeclAttr.cpp:7077
   if (K == AR_NotYetIntroduced)
-    S.Diag(Loc, diag::note_partial_availability_silence) << D;
+    if (NamedDecl *Enclosing = findEnclosingDeclToAnnotate(Ctx))
+      S.Diag(Enclosing->getLocStart(), diag::note_partial_availability_silence)
----------------
You can use `const auto *` here.


================
Comment at: lib/Sema/SemaExpr.cpp:115
 
-  if (const EnumConstantDecl *ECD = dyn_cast<EnumConstantDecl>(D))
+  if (EnumConstantDecl *ECD = dyn_cast<EnumConstantDecl>(D))
     if (Result == AR_Available) {
----------------
You can use `auto *` here.


================
Comment at: lib/Sema/SemaExpr.cpp:118
+      DeclContext *DC = ECD->getDeclContext();
+      if (EnumDecl *TheEnumDecl = dyn_cast<EnumDecl>(DC)) {
         Result = TheEnumDecl->getAvailability(Message);
----------------
You can use `auto *` here as well.


https://reviews.llvm.org/D33816



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to