diff options
author | Patrick Palka <ppalka@redhat.com> | 2024-07-25 19:05:19 -0400 |
---|---|---|
committer | Thomas Koenig <tkoenig@gcc.gnu.org> | 2024-07-28 19:05:59 +0200 |
commit | e0aa8f2e35636451a58c02b0bad47804e13124e9 (patch) | |
tree | ca6316efbd853e1bf70c6b02b72874526c4605fb /libobjc/objc-private | |
parent | c0fc7ff00ebeea647bff595b506ea6423778df75 (diff) | |
download | gcc-e0aa8f2e35636451a58c02b0bad47804e13124e9.zip gcc-e0aa8f2e35636451a58c02b0bad47804e13124e9.tar.gz gcc-e0aa8f2e35636451a58c02b0bad47804e13124e9.tar.bz2 |
c++: non-template alias with dependent attributes [PR115897]
This patch generalizes our support for dependent attributes on alias
templates to also support them on non-template aliases. The main
addition is a new predicate dependent_opaque_alias_p controlling whether
we can treat an alias (template or non-template) as type-equivalent to
its expansion.
PR c++/115897
gcc/cp/ChangeLog:
* cp-tree.h (dependent_opaque_alias_p): Declare.
* pt.cc (push_template_decl): Manually mark a dependent opaque
alias or dependent alias template specialization as dependent,
and use structural equality for them.
(dependent_opaque_alias_p): Define.
(alias_template_specialization_p): Don't look through an
opaque alias.
(complex_alias_template_p): Use dependent_opaque_alias_p instead of
any_dependent_template_arguments_p directly.
(dependent_alias_template_spec_p): Don't look through an
opaque alias.
(get_underlying_template): Use dependent_opaque_alias_p instead of
any_dependent_template_arguments_p.
(instantiate_alias_template): Mention same logic in
push_template_decl.
(dependent_type_p_r): Remove dependent_alias_template_spec_p check.
(any_template_arguments_need_structural_equality_p): Return true
for a dependent opaque alias.
(alias_ctad_tweaks): Use template_args_equal instead of same_type_p
followed by dependent_alias_template_spec_p.
* tree.cc (strip_typedefs): Don't strip an opaque alias.
* typeck.cc (structural_comptypes): Compare declaration attributes
for an opaque alias.
gcc/testsuite/ChangeLog:
* g++.dg/cpp0x/alias-decl-79.C: Remove xfails.
* g++.dg/cpp0x/alias-decl-79a.C: New test.
Reviewed-by: Jason Merrill <jason@redhat.com>
Diffstat (limited to 'libobjc/objc-private')
0 files changed, 0 insertions, 0 deletions