aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-02-11 10:04:29 +0000
committerJohn McCall <rjmccall@apple.com>2010-02-11 10:04:29 +0000
commit779cf424a153ca92d501af87cb50c7a701514a61 (patch)
tree7cd76fe29489e0e8dad0d71ac4028b727d0e947c /lib
parent5c41ee8c49995fb4fd76d686b239c15cbab261ea (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95870 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Basic/Diagnostic.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Basic/Diagnostic.cpp b/lib/Basic/Diagnostic.cpp
index b2f13bba8d..094f7760a8 100644
--- a/lib/Basic/Diagnostic.cpp
+++ b/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;