]> granicus.if.org Git - clang/commitdiff
PR4715
authorShantonu Sen <ssen@apple.com>
Fri, 14 Aug 2009 04:07:15 +0000 (04:07 +0000)
committerShantonu Sen <ssen@apple.com>
Fri, 14 Aug 2009 04:07:15 +0000 (04:07 +0000)
-Wno-error disables WarningsAsErrors instead of
mistakenly being treated like -Werror

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78987 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/Warnings.cpp
test/Misc/diag-mapping2.c

index c8fd5f6fcbc0636c0c589a8665e7b0eca9d466a3..87178e93b4473917e9320f184954fac7fb74c94e 100644 (file)
@@ -90,7 +90,7 @@ bool clang::ProcessWarningOptions(Diagnostic &Diags,
       }
       
       if (Specifier == 0) {
-        Diags.setWarningsAsErrors(true);
+        Diags.setWarningsAsErrors(isPositive);
         continue;
       }
       
index 7e0d7742a9feed3a7c8ac4d027f1f0e4461d1c13..c5fd7fff81f610d5f93c9be5a3789b98269a4b47 100644 (file)
 // RUN: clang-cc %s -Werror=#warnings 2>&1 | grep "error:" &&
 
 // -Wno-error= overrides -Werror.  rdar://3158301
-// RUN: clang-cc %s -Werror -Wno-error=#warnings 2>&1 | grep "warning:"
+// RUN: clang-cc %s -Werror -Wno-error=#warnings 2>&1 | grep "warning:" &&
+
+// -Wno-error overrides -Werror.  PR4715
+// RUN: clang-cc %s -Werror -Wno-error 2>&1 | grep "warning:"
 
 #warning foo