diff options
author | Daniel Dunbar <daniel@zuster.org> | 2011-10-04 21:17:24 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2011-10-04 21:17:24 +0000 |
commit | 53201a86f775c064b62ec25742106c7b43ba8749 (patch) | |
tree | e557279098cbe93fff291bd307a3bc1e7d0dc9c4 /lib/Basic/Diagnostic.cpp | |
parent | 5d0ea6d62e076c776ddad028c4eb615783be1323 (diff) |
Basic/Diagnostics: Apparently, #pragma ... diagnostic is intended to override
the command line options (at least according to GCC's documentation). GCC 4.2
didn't appear to actually do this, but it seems like that has been fixed in
later release, so we will follow the docs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141119 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/Diagnostic.cpp')
-rw-r--r-- | lib/Basic/Diagnostic.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Basic/Diagnostic.cpp b/lib/Basic/Diagnostic.cpp index cfe617e2b3..e5f390196d 100644 --- a/lib/Basic/Diagnostic.cpp +++ b/lib/Basic/Diagnostic.cpp @@ -175,6 +175,13 @@ void DiagnosticsEngine::setDiagnosticMapping(diag::kind Diag, diag::Mapping Map, DiagnosticMappingInfo MappingInfo = DiagnosticMappingInfo::Make( Map, /*IsUser=*/true, isPragma); + // If this is a pragma mapping, then set the diagnostic mapping flags so that + // we override command line options. + if (isPragma) { + MappingInfo.setNoWarningAsError(true); + MappingInfo.setNoErrorAsFatal(true); + } + // Common case; setting all the diagnostics of a group in one place. if (Loc.isInvalid() || Loc == LastStateChangePos) { GetCurDiagState()->setMappingInfo(Diag, MappingInfo); |