]> gcc.gnu.org Git - gcc.git/commit
c++: alias template with dependent attributes [PR115897]
authorPatrick Palka <ppalka@redhat.com>
Mon, 15 Jul 2024 22:07:55 +0000 (18:07 -0400)
committerPatrick Palka <ppalka@redhat.com>
Mon, 15 Jul 2024 22:07:55 +0000 (18:07 -0400)
commit7954bb4fcb6fa80f6bb840133314885011821188
treed42ff6a25c13c10960a60c76ea04061f9ee59c6f
parenteb0c163aada970b8351067b17121f013fc58dbc9
c++: alias template with dependent attributes [PR115897]

Here we're prematurely stripping the dependent alias template-id A<T> to
its defining-type-id T when used as a template argument, which in turn
causes us to essentially ignore A's vector_size attribute in the outer
template-id.

This has always been a problem for class template-ids it seems, and after
r14-2170 variable template-ids are affected as well.

This patch marks alias templates that have a dependent attribute as
complex (as with e.g. constrained alias templates) so that we don't look
through them prematurely.

PR c++/115897

gcc/cp/ChangeLog:

* pt.cc (complex_alias_template_p): Return true for an alias
template with attributes.
(get_underlying_template): Don't look through an alias template
with attributes.

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/alias-decl-77.C: New test.

Reviewed-by: Jason Merrill <jason@redhat.com>
gcc/cp/pt.cc
gcc/testsuite/g++.dg/cpp0x/alias-decl-77.C [new file with mode: 0644]
This page took 0.062095 seconds and 5 git commands to generate.