[PATCH] D25283: AvailabilityAttrs: Refactor context checking when diagnosing an availability violation

Manman Ren via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 10 12:45:24 PDT 2016


manmanren added a comment.

This is a nice cleanup!

Manman



================
Comment at: lib/Sema/SemaDeclAttr.cpp:6348
+
+  auto IsContextGreater = [&](const Decl *C) {
+    if (K == AR_NotYetIntroduced) {
----------------
Can you add a comment for the lambda?


================
Comment at: lib/Sema/SemaExpr.cpp:179
-  if (const DeclContext *DC = S.getCurObjCLexicalContext())
-    ContextVersion = S.getVersionForDecl(cast<Decl>(DC));
-
----------------
I don't quite get why we can remove the above logic (i.e why we can avoid passing ContextVersion when diagnosing the availability). Is it because we move the logic to DoEmitAvailabilityWarning?


https://reviews.llvm.org/D25283





More information about the cfe-commits mailing list