|
1 |
| -// RUN: %clang_cc1 -fexperimental-new-constant-interpreter -pedantic -verify=expected,both %s |
2 |
| -// RUN: %clang_cc1 -std=c++14 -fexperimental-new-constant-interpreter -pedantic -verify=expected,both %s |
3 |
| -// RUN: %clang_cc1 -std=c++20 -fexperimental-new-constant-interpreter -pedantic -verify=expected,both %s |
4 |
| -// RUN: %clang_cc1 -pedantic -verify=ref,both %s |
5 |
| -// RUN: %clang_cc1 -pedantic -std=c++14 -verify=ref,both %s |
6 |
| -// RUN: %clang_cc1 -pedantic -std=c++20 -verify=ref,both %s |
| 1 | +// RUN: %clang_cc1 -pedantic -verify=expected,both %s -fexperimental-new-constant-interpreter |
| 2 | +// RUN: %clang_cc1 -std=c++14 -pedantic -verify=expected,both %s -fexperimental-new-constant-interpreter |
| 3 | +// RUN: %clang_cc1 -std=c++20 -pedantic -verify=expected,both %s -fexperimental-new-constant-interpreter |
| 4 | +// RUN: %clang_cc1 -pedantic -verify=ref,both %s |
| 5 | +// RUN: %clang_cc1 -std=c++14 -pedantic -verify=ref,both %s |
| 6 | +// RUN: %clang_cc1 -std=c++20 -pedantic -verify=ref,both %s |
7 | 7 |
|
8 | 8 | #define fold(x) (__builtin_constant_p(0) ? (x) : (x))
|
9 | 9 |
|
@@ -672,10 +672,8 @@ namespace FunctionCast {
|
672 | 672 | constexpr int test4 = fold(IntFn(DoubleFn(f)))();
|
673 | 673 | constexpr int test5 = IntFn(fold(DoubleFn(f)))(); // both-error {{constant expression}} \
|
674 | 674 | // both-note {{cast that performs the conversions of a reinterpret_cast is not allowed in a constant expression}}
|
675 |
| - // FIXME: Interpreter is less strict here. |
676 |
| - constexpr int test6 = fold(IntPtrFn(f2))() == nullptr; // ref-error {{constant expression}} |
677 |
| - // FIXME: The following crashes interpreter |
678 |
| - // constexpr int test6 = fold(IntFn(f3)()); |
| 675 | + constexpr int test6 = fold(IntPtrFn(f2))() == nullptr; // both-error {{constant expression}} |
| 676 | + constexpr int test7 = fold(IntFn(f3)()); // both-error {{must be initialized by a constant expression}} |
679 | 677 | }
|
680 | 678 |
|
681 | 679 | #if __cplusplus >= 202002L
|
|
0 commit comments