diff options
author | Patrick Palka <ppalka@redhat.com> | 2023-11-22 13:54:29 -0500 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2023-11-22 13:54:29 -0500 |
commit | 3f266c84a15d63e42bfad46397fea9aff92b0720 (patch) | |
tree | 941196dace9f9eb5439684ae44a1354f591e68fe /gcc/cp | |
parent | a53da3a213ee00866d132c228a0e89bd2f61d65c (diff) | |
download | gcc-3f266c84a15d63e42bfad46397fea9aff92b0720.zip gcc-3f266c84a15d63e42bfad46397fea9aff92b0720.tar.gz gcc-3f266c84a15d63e42bfad46397fea9aff92b0720.tar.bz2 |
c++: alias template of non-template class [PR112633]
The entering_scope adjustment in tsubst_aggr_type assumes if an alias is
dependent, then so is the aliased type (and therefore it has template info)
but that's not true for the dependent alias template specialization ty1<T>
below which aliases the non-template class A. In this case no adjustment
is needed anyway, so we can just punt.
PR c++/112633
gcc/cp/ChangeLog:
* pt.cc (tsubst_aggr_type): Handle empty TYPE_TEMPLATE_INFO
in the entering_scope adjustment.
gcc/testsuite/ChangeLog:
* g++.dg/cpp0x/alias-decl-75.C: New test.
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/pt.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc index ed681af..68ce4a8 100644 --- a/gcc/cp/pt.cc +++ b/gcc/cp/pt.cc @@ -13976,6 +13976,7 @@ tsubst_aggr_type (tree t, if (entering_scope && CLASS_TYPE_P (t) && dependent_type_p (t) + && TYPE_TEMPLATE_INFO (t) && TYPE_CANONICAL (t) == TREE_TYPE (TYPE_TI_TEMPLATE (t))) t = TYPE_CANONICAL (t); |