[Bug c++/101247] ICE when using static constexpr bool defined in parent-class in nested class constructor requires-clause
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Jul 2 17:55:34 GMT 2021
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101247
--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>:
https://gcc.gnu.org/g:e3528ce197f8886869f95e8a8f901861a319851c
commit r12-1989-ge3528ce197f8886869f95e8a8f901861a319851c
Author: Patrick Palka <ppalka@redhat.com>
Date: Fri Jul 2 13:54:57 2021 -0400
c++: unqualified member template in constraint [PR101247]
Here any_template_parm_r is failing to mark the template parameters
implicitly used by the unqualified use of 'd' inside the constraint
because the code to do so assumes each level of a template parameter
list points to the corresponding primary template, but here the
parameter level for A in the out-of-line definition of A::B does not
(nor do the parameter levels for A and C in the definition of A::C),
which causes us to overlook the sharing.
So it seems we can't in general depend on the TREE_TYPE of a template
parameter level being non-empty here. This patch partially fixes this
by rewriting the relevant part of any_template_parm_r to not depend on
the TREE_TYPE of outer levels. We still depend on the innermost level
to point to the innermost primary template, so we still crash on the
commented out line in the below testcase.
PR c++/101247
gcc/cp/ChangeLog:
* pt.c (any_template_parm_r) <case TEMPLATE_DECL>: Rewrite to
use common_enclosing_class and to not depend on the TREE_TYPE
of outer levels pointing to the corresponding primary template.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/concepts-memtmpl4.C: New test.
More information about the Gcc-bugs
mailing list