================
@@ -1143,6 +1185,23 @@ void Sema::ProcessAPINotes(Decl *D) {
                   return Reader->lookupGlobalFunction(FD->getName(), 
Parameters,
                                                       APINotesContext);
                 });
+
+          if (ParameterSelectorCandidates &&
+              !Diags.isIgnored(diag::warn_apinotes_message,
----------------
Xazax-hun wrote:

I wonder if this is not correct. The diagnostic state (what diagnostics are 
ignored) can change throughout the translation unit via pragmas like:
```
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wname"
#include "someHeader"
#pragma clang diagnostic pop
```

We might skip some bookkeeping like `markCandidatesUsed` and spuriously emit 
some warnings later on.

I wonder if we should always do the bookkeeping and only guard the emission of 
these warnings at the end of the TU based on the warning state at the end of 
the TU. 

https://github.com/llvm/llvm-project/pull/209408
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to