Message ID | 20231116155108.2207222-1-ppalka@redhat.com |
---|---|
State | New |
Headers | show |
Series | [pushed] c++: add fixed testcases [PR98614, PR104802] | expand |
diff --git a/gcc/testsuite/g++.dg/cpp1z/nontype-auto22.C b/gcc/testsuite/g++.dg/cpp1z/nontype-auto22.C new file mode 100644 index 00000000000..1882d2586d5 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/nontype-auto22.C @@ -0,0 +1,17 @@ +// PR c++/104802 +// { dg-do compile { target c++17 } } + +template<auto const& ... Args> +struct S { + template<typename=void> + void operator()() const {} +}; + +struct weird_ { + int operator&() const { return 123; } +} const weird {}; + +int main() { + S<weird> s {}; + s(); +} diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-partial-spec14.C b/gcc/testsuite/g++.dg/cpp2a/concepts-partial-spec14.C new file mode 100644 index 00000000000..c94b4013340 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/concepts-partial-spec14.C @@ -0,0 +1,10 @@ +// PR c++/98614 +// { dg-do compile { target c++20 } } + +template<class T> +struct A; + +template<class T> requires true +struct A<T> { + A(A<T> const&) = default; +};