aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/cp/pt.c2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-partial-spec8.C14
2 files changed, 15 insertions, 1 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index f5d1442..c07a48f 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -5062,7 +5062,7 @@ process_partial_specialization (tree decl)
if (comp_template_args (inner_args, INNERMOST_TEMPLATE_ARGS (main_args))
&& (!flag_concepts
|| !strictly_subsumes (current_template_constraints (),
- inner_args, maintmpl)))
+ main_args, maintmpl)))
{
if (!flag_concepts)
error ("partial specialization %q+D does not specialize "
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-partial-spec8.C b/gcc/testsuite/g++.dg/cpp2a/concepts-partial-spec8.C
new file mode 100644
index 0000000..873cf44
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-partial-spec8.C
@@ -0,0 +1,14 @@
+// { dg-do compile { target c++20 } }
+
+template<int M, int N>
+concept equal = M == N;
+
+template<int M>
+struct traits
+{
+ template<int N> requires equal<M, N>
+ struct foo {};
+
+ template<int N> requires equal<M, N> && (M >= 0) // { dg-bogus "not more constrained" }
+ struct foo<N> {};
+};