diff options
author | Patrick Palka <ppalka@redhat.com> | 2021-10-07 10:02:54 -0400 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2021-10-07 10:02:54 -0400 |
commit | 2e6e0d86a06389056d0e7fecc99c547420ad787a (patch) | |
tree | 135d1870a5006339b21054e2fcec4ed1d5d3a0c1 /gcc/testsuite | |
parent | 9b239d05ffd5a17ede44abd55bc6622c6e279868 (diff) | |
download | gcc-2e6e0d86a06389056d0e7fecc99c547420ad787a.zip gcc-2e6e0d86a06389056d0e7fecc99c547420ad787a.tar.gz gcc-2e6e0d86a06389056d0e7fecc99c547420ad787a.tar.bz2 |
c++: variadic ttp constraint subsumption [PR99904]
Here we're crashing when level-lowering the variadic constraint C<Ts...>
on the template template parameter TT because tsubst_pack_expansion expects
processing_template_decl to be set during a partial substitution.
PR c++/99904
gcc/cp/ChangeLog:
* pt.c (is_compatible_template_arg): Set processing_template_decl
around tsubst_constraint_info.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/concepts-ttp4.C: New test.
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/g++.dg/cpp2a/concepts-ttp4.C | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-ttp4.C b/gcc/testsuite/g++.dg/cpp2a/concepts-ttp4.C new file mode 100644 index 0000000..cf3e71e --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/concepts-ttp4.C @@ -0,0 +1,9 @@ +// PR c++/99904 +// { dg-do compile { target c++20 } } + +template<class... Ts> concept C = (Ts::value && ...); +template<class... Ts> requires C<Ts...> struct A; +template<class T> requires true struct B; +template<template<class... Ts> requires C<Ts...> class TT> struct S; +using ty1 = S<A>; +using ty2 = S<B>; // { dg-error "constraint" } TT's constraints don't subsume B's |