|
1 |
| -// RUN: %clang_cc1 -std=c++23 -isystem %S/Inputs -fsyntax-only -verify=expected,cxx20_23,cxx23 -triple x86_64-linux -Wno-string-plus-int -Wno-pointer-arith -Wno-zero-length-array -Wno-c99-designator -fcxx-exceptions -pedantic %s -Wno-comment -Wno-tautological-pointer-compare -Wno-bool-conversion |
2 |
| -// RUN: %clang_cc1 -std=c++20 -isystem %S/Inputs -fsyntax-only -verify=expected,cxx11_20,cxx20_23 -triple x86_64-linux -Wno-string-plus-int -Wno-pointer-arith -Wno-zero-length-array -Wno-c99-designator -fcxx-exceptions -pedantic %s -Wno-comment -Wno-tautological-pointer-compare -Wno-bool-conversion |
3 |
| -// RUN: %clang_cc1 -std=c++11 -isystem %S/Inputs -fsyntax-only -verify=expected,cxx11_20,cxx11 -triple x86_64-linux -Wno-string-plus-int -Wno-pointer-arith -Wno-zero-length-array -Wno-c99-designator -fcxx-exceptions -pedantic %s -Wno-comment -Wno-tautological-pointer-compare -Wno-bool-conversion |
| 1 | +// RUN: %clang_cc1 -std=c++23 -isystem %S/Inputs -fsyntax-only -verify=expected,cxx20_23,cxx23 -triple x86_64-linux -Wno-string-plus-int -Wno-pointer-arith -Wno-zero-length-array -Wno-c99-designator -fcxx-exceptions -pedantic %s -Wno-comment -Wno-tautological-pointer-compare -Wno-bool-conversion |
| 2 | +// RUN: %clang_cc1 -std=c++20 -isystem %S/Inputs -fsyntax-only -verify=expected,cxx11_20,cxx20_23,pre-cxx23 -triple x86_64-linux -Wno-string-plus-int -Wno-pointer-arith -Wno-zero-length-array -Wno-c99-designator -fcxx-exceptions -pedantic %s -Wno-comment -Wno-tautological-pointer-compare -Wno-bool-conversion |
| 3 | +// RUN: %clang_cc1 -std=c++11 -isystem %S/Inputs -fsyntax-only -verify=expected,cxx11_20,cxx11,pre-cxx23 -triple x86_64-linux -Wno-string-plus-int -Wno-pointer-arith -Wno-zero-length-array -Wno-c99-designator -fcxx-exceptions -pedantic %s -Wno-comment -Wno-tautological-pointer-compare -Wno-bool-conversion |
4 | 4 |
|
5 | 5 | namespace StaticAssertFoldTest {
|
6 | 6 |
|
@@ -1011,10 +1011,12 @@ constexpr bool b(int n) { return &n; }
|
1011 | 1011 | static_assert(b(0), "");
|
1012 | 1012 |
|
1013 | 1013 | struct NonLiteral {
|
1014 |
| - NonLiteral(); |
| 1014 | + NonLiteral(); // cxx23-note {{declared here}} |
1015 | 1015 | int f();
|
1016 | 1016 | };
|
1017 |
| -constexpr int k = NonLiteral().f(); // expected-error {{constant expression}} expected-note {{non-literal type 'NonLiteral'}} |
| 1017 | +constexpr int k = NonLiteral().f(); // expected-error {{constant expression}} \ |
| 1018 | + // pre-cxx23-note {{non-literal type 'NonLiteral'}} \ |
| 1019 | + // cxx23-note {{non-constexpr constructor 'NonLiteral' cannot be used in a constant expression}} |
1018 | 1020 |
|
1019 | 1021 | }
|
1020 | 1022 |
|
@@ -1270,8 +1272,10 @@ static_assert(makeComplexWrap(1,0) != complex(0, 1), "");
|
1270 | 1272 |
|
1271 | 1273 | namespace PR11595 {
|
1272 | 1274 | struct A { constexpr bool operator==(int x) const { return true; } };
|
1273 |
| - struct B { B(); A& x; }; |
1274 |
| - static_assert(B().x == 3, ""); // expected-error {{constant expression}} expected-note {{non-literal type 'B' cannot be used in a constant expression}} |
| 1275 | + struct B { B(); A& x; }; // cxx23-note {{declared here}} |
| 1276 | + static_assert(B().x == 3, ""); // expected-error {{constant expression}} \ |
| 1277 | + // pre-cxx23-note {{non-literal type 'B' cannot be used in a constant expression}} \ |
| 1278 | + // cxx23-note {{non-constexpr constructor 'B' cannot be used in a constant expression}} |
1275 | 1279 |
|
1276 | 1280 | constexpr bool f(int k) { // cxx11_20-error {{constexpr function never produces a constant expression}}
|
1277 | 1281 | return B().x == k; // cxx11_20-note {{non-literal type 'B' cannot be used in a constant expression}}
|
|
0 commit comments