aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.cc
diff options
context:
space:
mode:
authorPatrick Palka <ppalka@redhat.com>2024-05-13 09:53:40 -0400
committerPatrick Palka <ppalka@redhat.com>2024-05-13 09:53:40 -0400
commit6d31a370e26eeb950c326332633b3e8e84b6630b (patch)
tree5edd98b499e7c65fab8a478eb393f47f232e4908 /gcc/expr.cc
parent7d8946634c744af57c233a782840f52261e64911 (diff)
downloadgcc-6d31a370e26eeb950c326332633b3e8e84b6630b.zip
gcc-6d31a370e26eeb950c326332633b3e8e84b6630b.tar.gz
gcc-6d31a370e26eeb950c326332633b3e8e84b6630b.tar.bz2
c++: nested aggregate/alias CTAD fixes [PR114974, PR114901, PR114903]
During maybe_aggr_guide with a nested class template and paren init, like with list init we need to consider the generic template type rather than the partially instantiated type since partial instantiations don't have (partially instantiated) TYPE_FIELDS. In turn we need to partially substitute PARMs in the paren init case as well. As a drive-by improvement it seems better to use outer_template_args instead of DECL_TI_ARGS during this partial substitution so that we lower instead of substitute the innermost template parameters, which is generally more robust. And during alias_ctad_tweaks with a nested class template, even though the guides may be already partially instantiated we still need to substitute the outermost arguments into its constraints. PR c++/114974 PR c++/114901 PR c++/114903 gcc/cp/ChangeLog: * pt.cc (maybe_aggr_guide): Fix obtaining TYPE_FIELDS in the paren init case. Hoist out partial substitution logic to apply to the paren init case as well. (alias_ctad_tweaks): Substitute outer template arguments into a guide's constraints. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/class-deduction-aggr14.C: New test. * g++.dg/cpp2a/class-deduction-alias20.C: New test. * g++.dg/cpp2a/class-deduction-alias21.C: New test. Reviewed-by: Jason Merrill <jason@redhat.com>
Diffstat (limited to 'gcc/expr.cc')
0 files changed, 0 insertions, 0 deletions