[PATCH] D33816: [Sema][ObjC] Don't allow -Wunguarded-availability to be silenced with redeclarations

Alex Lorenz via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 29 02:13:34 PDT 2017


arphaman accepted this revision.
arphaman added a comment.
This revision is now accepted and ready to land.

LGTM. One last comment below:



================
Comment at: include/clang/Basic/DiagnosticSemaKinds.td:2880
   InGroup<UnguardedAvailabilityNew>;
 def note_partial_availability_silence : Note<
+  "annotate %0 with an availability attribute to silence">;
----------------
I think that you can just use one note and select the text, e.g.

```
def note_partial_availability_silence : Note<
  "annotate %select{%1|anonymous %0}0 with an availability attribute to silence">;
```

And use it like:

```
enum class PartialAvailabilityNoteKind {
  Named,
  Anonymous
};

...

    S.Diag(Enclosing->getLocation(), diag::note_partial_availability_silence)
          <<  PartialAvailabilityNoteKind::Named << Enclosing;

```




https://reviews.llvm.org/D33816





More information about the cfe-commits mailing list