diff options
author | John McCall <rjmccall@apple.com> | 2010-02-11 10:04:29 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-02-11 10:04:29 +0000 |
commit | be089fa86b8724cfee55c99393f2b32088996700 (patch) | |
tree | ff192398a2c3279bc64f38f619e1677a93fb5e20 /clang/lib | |
parent | d31b2637abd2aa6941625a60034cccdab61fe134 (diff) | |
download | bcm5719-llvm-be089fa86b8724cfee55c99393f2b32088996700.tar.gz bcm5719-llvm-be089fa86b8724cfee55c99393f2b32088996700.zip |
Suppress warnings if their instantiation location is in a system header, not
their spelling location. This prevents warnings from being swallowed just
because the caret is on the first parenthesis in, say, NULL.
This is an experiment; the risk is that there might be a substantial number
of system headers which #define symbols to expressions which inherently cause
warnings. My theory is that that's rare enough that it can be worked
around case-by-case, and that producing useful warnings around NULL is worth
it. But I'm willing to accept that I might be empirically wrong.
llvm-svn: 95870
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Basic/Diagnostic.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Basic/Diagnostic.cpp b/clang/lib/Basic/Diagnostic.cpp index b2f13bba8d1..094f7760a8e 100644 --- a/clang/lib/Basic/Diagnostic.cpp +++ b/clang/lib/Basic/Diagnostic.cpp @@ -629,7 +629,7 @@ bool Diagnostic::ProcessDiag() { // it. if (SuppressSystemWarnings && !ShouldEmitInSystemHeader && Info.getLocation().isValid() && - Info.getLocation().getSpellingLoc().isInSystemHeader() && + Info.getLocation().getInstantiationLoc().isInSystemHeader() && (DiagLevel != Diagnostic::Note || LastDiagLevel == Diagnostic::Ignored)) { LastDiagLevel = Diagnostic::Ignored; return false; |