Skip to content

Commit a58dd0e

Browse files
authored
[clang] Make sure all C++ DR tests are running with -pedantic-errors (#94203)
In #94167 I found out that `cwg28xx.cpp` has been running without `-pedantic-errors` and fixed that. This patch fixes that for the rest of the test suite. Only one test was affected with a trivial fix (warning was escalated to an error). I'm intentionally leaving out test for CWG2390, because it requires major surgery. It's addressed in #94206.
1 parent bda8d1a commit a58dd0e

File tree

4 files changed

+28
-28
lines changed

4 files changed

+28
-28
lines changed

clang/test/CXX/drs/cwg24xx.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
// RUN: %clang_cc1 -std=c++98 %s -verify=expected
2-
// RUN: %clang_cc1 -std=c++11 %s -verify=expected
3-
// RUN: %clang_cc1 -std=c++14 %s -verify=expected
4-
// RUN: %clang_cc1 -std=c++17 %s -verify=expected,since-cxx17
5-
// RUN: %clang_cc1 -std=c++20 %s -verify=expected,since-cxx17
6-
// RUN: %clang_cc1 -std=c++23 %s -verify=expected,since-cxx17
7-
// RUN: %clang_cc1 -std=c++2c %s -verify=expected,since-cxx17
1+
// RUN: %clang_cc1 -std=c++98 -pedantic-errors %s -verify=expected
2+
// RUN: %clang_cc1 -std=c++11 -pedantic-errors %s -verify=expected
3+
// RUN: %clang_cc1 -std=c++14 -pedantic-errors %s -verify=expected
4+
// RUN: %clang_cc1 -std=c++17 -pedantic-errors %s -verify=expected,since-cxx17
5+
// RUN: %clang_cc1 -std=c++20 -pedantic-errors %s -verify=expected,since-cxx17
6+
// RUN: %clang_cc1 -std=c++23 -pedantic-errors %s -verify=expected,since-cxx17
7+
// RUN: %clang_cc1 -std=c++2c -pedantic-errors %s -verify=expected,since-cxx17
88

99
#if __cplusplus <= 201402L
1010
// expected-no-diagnostics

clang/test/CXX/drs/cwg2630.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// RUN: split-file --leading-lines %s %t
2-
// RUN: %clang_cc1 -std=c++20 -verify -emit-module-interface %t/module.cppm -o %t/module.pcm
3-
// RUN: %clang_cc1 -std=c++20 -verify -fmodule-file=A=%t/module.pcm %t/main.cpp
4-
// RUN: %clang_cc1 -std=c++23 -verify -emit-module-interface %t/module.cppm -o %t/module.pcm
5-
// RUN: %clang_cc1 -std=c++23 -verify -fmodule-file=A=%t/module.pcm %t/main.cpp
6-
// RUN: %clang_cc1 -std=c++2c -verify -emit-module-interface %t/module.cppm -o %t/module.pcm
7-
// RUN: %clang_cc1 -std=c++2c -verify -fmodule-file=A=%t/module.pcm %t/main.cpp
2+
// RUN: %clang_cc1 -std=c++20 -pedantic-errors -verify -emit-module-interface %t/module.cppm -o %t/module.pcm
3+
// RUN: %clang_cc1 -std=c++20 -pedantic-errors -verify -fmodule-file=A=%t/module.pcm %t/main.cpp
4+
// RUN: %clang_cc1 -std=c++23 -pedantic-errors -verify -emit-module-interface %t/module.cppm -o %t/module.pcm
5+
// RUN: %clang_cc1 -std=c++23 -pedantic-errors -verify -fmodule-file=A=%t/module.pcm %t/main.cpp
6+
// RUN: %clang_cc1 -std=c++2c -pedantic-errors -verify -emit-module-interface %t/module.cppm -o %t/module.pcm
7+
// RUN: %clang_cc1 -std=c++2c -pedantic-errors -verify -fmodule-file=A=%t/module.pcm %t/main.cpp
88

99
//--- module.cppm
1010
// expected-no-diagnostics

clang/test/CXX/drs/cwg26xx.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
// RUN: %clang_cc1 -std=c++98 -triple x86_64-unknown-unknown %s -verify=expected
2-
// RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-unknown %s -verify=expected,since-cxx11,cxx11
3-
// RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown %s -verify=expected,since-cxx11
4-
// RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-unknown %s -verify=expected,since-cxx11
5-
// RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-unknown %s -verify=expected,since-cxx11,since-cxx20
6-
// RUN: %clang_cc1 -std=c++23 -triple x86_64-unknown-unknown %s -verify=expected,since-cxx11,since-cxx20,since-cxx23
7-
// RUN: %clang_cc1 -std=c++2c -triple x86_64-unknown-unknown %s -verify=expected,since-cxx11,since-cxx20,since-cxx23
1+
// RUN: %clang_cc1 -std=c++98 -triple x86_64-unknown-unknown -pedantic-errors %s -verify=expected
2+
// RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-unknown -pedantic-errors %s -verify=expected,since-cxx11,cxx11
3+
// RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown -pedantic-errors %s -verify=expected,since-cxx11
4+
// RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-unknown -pedantic-errors %s -verify=expected,since-cxx11
5+
// RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-unknown -pedantic-errors %s -verify=expected,since-cxx11,since-cxx20
6+
// RUN: %clang_cc1 -std=c++23 -triple x86_64-unknown-unknown -pedantic-errors %s -verify=expected,since-cxx11,since-cxx20,since-cxx23
7+
// RUN: %clang_cc1 -std=c++2c -triple x86_64-unknown-unknown -pedantic-errors %s -verify=expected,since-cxx11,since-cxx20,since-cxx23
88

99

1010
namespace cwg2621 { // cwg2621: 16
@@ -129,7 +129,7 @@ int y = cwg2640_a\N{LOTUS});
129129
namespace cwg2644 { // cwg2644: 8
130130
#if __cplusplus >= 201103L
131131
auto z = [a = 42](int a) {
132-
// cxx11-warning@-1 {{initialized lambda captures are a C++14 extension}}
132+
// cxx11-error@-1 {{initialized lambda captures are a C++14 extension}}
133133
// since-cxx11-error@-2 {{a lambda parameter cannot shadow an explicitly captured entity}}
134134
// since-cxx11-note@-3 {{variable 'a' is explicitly captured here}}
135135
return 1;

clang/test/CXX/drs/cwg27xx.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++98 -verify=expected %s
2-
// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++11 -verify=expected %s
3-
// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++14 -verify=expected %s
4-
// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++17 -verify=expected %s
5-
// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++20 -verify=expected %s
6-
// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++23 -verify=expected,since-cxx23 %s
7-
// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++2c -verify=expected,since-cxx23,since-cxx26 %s
1+
// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++98 -pedantic-errors -verify=expected %s
2+
// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++11 -pedantic-errors -verify=expected %s
3+
// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++14 -pedantic-errors -verify=expected %s
4+
// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++17 -pedantic-errors -verify=expected %s
5+
// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++20 -pedantic-errors -verify=expected %s
6+
// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++23 -pedantic-errors -verify=expected,since-cxx23 %s
7+
// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++2c -pedantic-errors -verify=expected,since-cxx23,since-cxx26 %s
88

99
namespace cwg2718 { // cwg2718: 2.7
1010
struct B {};

0 commit comments

Comments
 (0)