================
@@ -226,6 +227,10 @@ class SemaPPCallbacks : public PPCallbacks {
}
void PragmaDiagnostic(SourceLocation Loc, StringRef Namespace,
diag::Severity Mapping, StringRef Str) override {
+ // The pragma changed diagnostic severities; drop any cached analysis
+ // warning policies derived from the previous state.
+ S->AnalysisWarnings.clearPolicyCache();
+
// If one of the analysis-based diagnostics was enabled while processing
----------------
AnonMiraj wrote:
Yes, we need both.
The one I added only stores the policy, not the overrides.
And I don't think they can be merged either, since they work on different
levels: one per-function and the other per-pragma.
The overrides are `OR`'d in after the cache lookup, so the cache never stores
them. Including them in the cache caused problems.
https://github.com/llvm/llvm-project/pull/212213
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits