================
@@ -549,8 +549,14 @@ DiagnosticIDs::getDiagnosticSeverity(unsigned DiagID,
SourceLocation Loc,
// If we are in a system header, we ignore it. We look at the diagnostic
class
// because we also want to ignore extensions and warnings in -Werror and
// -pedantic-errors modes, which *map* warnings/extensions to errors.
- if (State->SuppressSystemWarnings && Loc.isValid() &&
- SM.isInSystemHeader(SM.getExpansionLoc(Loc))) {
+ //
+ // We check both the location-specific state and the global engine state.
+ // In some cases (like template instantiations from system modules), the
+ // location-specific state might have suppression enabled, but the global
+ // engine state might have an override (e.g. AllowWarningInSystemHeaders)
+ // to show the warning.
----------------
zmodem wrote:
I think this comment should be updated to not talk about the global state, but
the override specifically.
https://github.com/llvm/llvm-project/pull/180684
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits