diff options
author | Chris Lattner <sabre@nondot.org> | 2010-04-12 21:53:11 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-04-12 21:53:11 +0000 |
commit | 04e442714c292d9381cad2ac14087991132bddca (patch) | |
tree | a7aebba45d7e0126d4b4912fb9d03752a99cd7c4 /lib/Frontend/TextDiagnosticPrinter.cpp | |
parent | 45e1dae500bba7a9ef5b8206263a5609c07c6f03 (diff) |
fix PR6814 - Only print [-pedantic] on a diagnostic if -pedantic
actually turned it on. If a diag is produced by a warning which
is an extension but defaults to on, and has no warning group, don't
print any option info.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101071 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/TextDiagnosticPrinter.cpp')
-rw-r--r-- | lib/Frontend/TextDiagnosticPrinter.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/Frontend/TextDiagnosticPrinter.cpp b/lib/Frontend/TextDiagnosticPrinter.cpp index 4e91f8d4c2..6c8137e3d2 100644 --- a/lib/Frontend/TextDiagnosticPrinter.cpp +++ b/lib/Frontend/TextDiagnosticPrinter.cpp @@ -796,8 +796,13 @@ void TextDiagnosticPrinter::HandleDiagnostic(Diagnostic::Level Level, OutStr += " [-W"; OutStr += Opt; OutStr += ']'; - } else if (Diagnostic::isBuiltinExtensionDiag(Info.getID())) { - OutStr += " [-pedantic]"; + } else { + // If the diagnostic is an extension diagnostic and not enabled by default + // then it must have been turned on with -pedantic. + bool EnabledByDefault; + if (Diagnostic::isBuiltinExtensionDiag(Info.getID(), EnabledByDefault) && + !EnabledByDefault) + OutStr += " [-pedantic]"; } } |