diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp2a/consteval31.C')
-rw-r--r-- | gcc/testsuite/g++.dg/cpp2a/consteval31.C | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp2a/consteval31.C b/gcc/testsuite/g++.dg/cpp2a/consteval31.C new file mode 100644 index 00000000000..85a4d1794e5 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/consteval31.C @@ -0,0 +1,26 @@ +// PR c++/105912 +// { dg-do compile { target c++20 } } + +struct A { + consteval A operator+() { + return {}; + } +}; + +consteval A operator~(A) { + return {}; +} + +consteval A operator+(A, A) { + return {}; +} + +template<class> +void f() { + A a; + ~a; + a + a; + +a; +} + +template void f<int>(); |