diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp2a/concepts-partial-spec12a.C')
-rw-r--r-- | gcc/testsuite/g++.dg/cpp2a/concepts-partial-spec12a.C | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-partial-spec12a.C b/gcc/testsuite/g++.dg/cpp2a/concepts-partial-spec12a.C new file mode 100644 index 00000000000..6d23a28892d --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/concepts-partial-spec12a.C @@ -0,0 +1,14 @@ +// PR c++/96363 +// { dg-do compile { target c++20 } } +// A version of concepts-partial-spec12.C where the primary template is +// constrained. + +template<class T> concept C = true; + +template<C T> class TPL; + +template<C T> requires true class TPL<T>; // #1 +template<C T> requires false class TPL<T>; // #2 error here + +template<C T> requires true class TPL<T*>; // #1 +template<C T> requires false class TPL<T*>; // #2 error here |