summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/TextDiagnosticPrinter.cpp
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2012-07-07 02:48:02 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2012-07-07 02:48:02 +0000
commiteec53e406953945b447eb48b55e5a64408275999 (patch)
tree77c864e72c5254b387cd2815a25866c2c22ebe12 /clang/lib/Frontend/TextDiagnosticPrinter.cpp
parenta0d17365abddcd2a0a86582df399c9f12e6d36b5 (diff)
downloadbcm5719-llvm-eec53e406953945b447eb48b55e5a64408275999.tar.gz
bcm5719-llvm-eec53e406953945b447eb48b55e5a64408275999.zip
Revert rr159875, "Implement -Wpedantic and --no-pedantic to complement -Weverything." It broke several builds.
I suspect FileCheck might match assertion failure, even if clang/test/Misc/warning-flags.c passed the test. > 0. Program arguments: bin/./clang -### -pedantic -Wpedantic clang/test/Driver/warning-options.cpp llvm-svn: 159886
Diffstat (limited to 'clang/lib/Frontend/TextDiagnosticPrinter.cpp')
-rw-r--r--clang/lib/Frontend/TextDiagnosticPrinter.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/lib/Frontend/TextDiagnosticPrinter.cpp b/clang/lib/Frontend/TextDiagnosticPrinter.cpp
index 30da72b4a9b..d07917f2349 100644
--- a/clang/lib/Frontend/TextDiagnosticPrinter.cpp
+++ b/clang/lib/Frontend/TextDiagnosticPrinter.cpp
@@ -79,6 +79,16 @@ static void printDiagnosticOptions(raw_ostream &OS,
Started = true;
}
+ // If the diagnostic is an extension diagnostic and not enabled by default
+ // then it must have been turned on with -pedantic.
+ bool EnabledByDefault;
+ if (DiagnosticIDs::isBuiltinExtensionDiag(Info.getID(),
+ EnabledByDefault) &&
+ !EnabledByDefault) {
+ OS << (Started ? "," : " [") << "-pedantic";
+ Started = true;
+ }
+
StringRef Opt = DiagnosticIDs::getWarningOptionForDiag(Info.getID());
if (!Opt.empty()) {
OS << (Started ? "," : " [") << "-W" << Opt;
OpenPOWER on IntegriCloud