[clang] 468c7b6 - [test] Test -Werror=foo -Wfoo & -Werror -Wno-error=foo -Wfoo

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 15 20:14:12 PDT 2022


Author: Fangrui Song
Date: 2022-04-15T20:14:07-07:00
New Revision: 468c7b65e578dd8decc3d7a2f9dce88410503fd1

URL: https://github.com/llvm/llvm-project/commit/468c7b65e578dd8decc3d7a2f9dce88410503fd1
DIFF: https://github.com/llvm/llvm-project/commit/468c7b65e578dd8decc3d7a2f9dce88410503fd1.diff

LOG: [test] Test -Werror=foo -Wfoo & -Werror -Wno-error=foo -Wfoo

Clang now matches GCC in the two cases.

D109981 fixed the second case though it did not call out the effect.

Added: 
    

Modified: 
    clang/test/Misc/diag-mapping2.c

Removed: 
    


################################################################################
diff  --git a/clang/test/Misc/diag-mapping2.c b/clang/test/Misc/diag-mapping2.c
index c3afea94b3701..6914307ff978c 100644
--- a/clang/test/Misc/diag-mapping2.c
+++ b/clang/test/Misc/diag-mapping2.c
@@ -11,9 +11,11 @@
 
 // -Werror can map this one warning to error.
 // RUN: not %clang_cc1 %s -Werror=#warnings 2>&1 | grep "error: foo"
+// RUN: not %clang_cc1 %s -Werror=#warnings -W#warnings 2>&1 | grep "error: foo"
 
-// -Wno-error= overrides -Werror.  rdar://3158301
+// -Wno-error= overrides -Werror. -Wno-error applies to a subsequent warning of the same name.
 // RUN: %clang_cc1 %s -Werror -Wno-error=#warnings 2>&1 | grep "warning: foo"
+// RUN: %clang_cc1 %s -Werror -Wno-error=#warnings -W#warnings 2>&1 | grep "warning: foo"
 
 // -Wno-error overrides -Werror.  PR4715
 // RUN: %clang_cc1 %s -Werror -Wno-error 2>&1 | grep "warning: foo"


        


More information about the cfe-commits mailing list