diff options
author | Patrick Palka <ppalka@redhat.com> | 2021-04-08 13:07:37 -0400 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2021-04-08 13:07:37 -0400 |
commit | 05708d6eef87a3dd0c68b1aed7f8d9c3824062b8 (patch) | |
tree | 71f82a4fb51036fb05439ae45b5aabf9ea4bab18 /gcc/cp/lambda.c | |
parent | 0567998287649833744ad728b1dfb785fe17c545 (diff) | |
download | gcc-05708d6eef87a3dd0c68b1aed7f8d9c3824062b8.zip gcc-05708d6eef87a3dd0c68b1aed7f8d9c3824062b8.tar.gz gcc-05708d6eef87a3dd0c68b1aed7f8d9c3824062b8.tar.bz2 |
c++: constrained CTAD for nested class template [PR97679]
In the testcase below, we're crashing during constraint checking of the
implicitly generated deduction guides for the nested class template A::B
because we never substitute the outer template arguments (for A) into
the constraint, neither ahead of time nor as part of satisfaction.
Ideally we'd like to avoid substituting into a constraint ahead of
time, but the "flattening" vector 'tsubst_args' is constructed under the
assumption that all outer template arguments are already substituted in,
and eliminating this assumption to yield a flattening vector that
includes outer (generic) template arguments suitable for substituting
into the constraint would be tricky and error-prone. So this patch
takes the approximate approach of substituting the outer arguments into
the constraint ahead of time, so that the subsequent substitution of
'tsubst_args' is coherent and so later satisfaction just works.
gcc/cp/ChangeLog:
PR c++/97679
* pt.c (build_deduction_guide): Document OUTER_ARGS. Substitute
them into the propagated constraints.
gcc/testsuite/ChangeLog:
PR c++/97679
* g++.dg/cpp2a/concepts-ctad3.C: New test.
Diffstat (limited to 'gcc/cp/lambda.c')
0 files changed, 0 insertions, 0 deletions