[PATCH] D34264: Introduce -Wunguarded-availability-new, which is like -Wunguarded-availability, except that it's enabled by default for new deployment targets

Alex Lorenz via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 19 10:18:48 PDT 2017


arphaman added inline comments.


================
Comment at: lib/Sema/SemaDeclAttr.cpp:7031
+            Introduced) &&
+        !S.Diags.isIgnored(diag::warn_unguarded_availability_new, Loc);
+    diag = NewWarning ? diag::warn_partial_availability_new
----------------
erik.pilkington wrote:
> Sorry to keep this going so long, but why are we even checking isIgnored? The only difference it could make in whether we emit a diagnostic is if both: -Wunguarded-availability and -Wno-unguarded-availability-new are passed in, which seems like it would never happen, right? Even if somebody did pass that in, it seems reasonable to warn on old stuff but not new stuff. Maybe I'm missing something here?
Right, it's to handle the `-Wunguarded-availability -Wno-unguarded-availability-new` case. Your argument makes sense though, we could allow `-Wunguarded-availability -Wno-unguarded-availability-new` where we warn on old APIs. Although that still seems kinda weird to me. Maybe @dexonsmith has an opinion about this?


Repository:
  rL LLVM

https://reviews.llvm.org/D34264





More information about the cfe-commits mailing list