r278298 - in /trunk/gcc: cp/ChangeLog cp/class....
jason@gcc.gnu.org
jason@gcc.gnu.org
Fri Nov 15 14:51:00 GMT 2019
Author: jason
Date: Fri Nov 15 14:51:05 2019
New Revision: 278298
URL: https://gcc.gnu.org/viewcvs?rev=278298&root=gcc&view=rev
Log:
Implement P1816R0, class template argument deduction for aggregates.
Rather than reimplement brace elision here, we call reshape_init and then
discard the result. We needed to set CLASSTYPE_NON_AGGREGATE a bit more in
this patch, since outside a template it's set in check_bases_and_members.
* pt.c (maybe_aggr_guide, collect_ctor_idx_types): New.
(is_spec_or_derived): Split out from do_class_deduction.
(build_deduction_guide): Handle aggregate guide.
* class.c (finish_struct): Set CLASSTYPE_NON_AGGREGATE in a
template.
* cp-tree.h (CP_AGGREGATE_TYPE_P): An incomplete class is not an
aggregate.
Added:
trunk/gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr1.C
trunk/gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr2.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/class.c
trunk/gcc/cp/cp-tree.h
trunk/gcc/cp/pt.c
trunk/gcc/testsuite/g++.dg/cpp1z/class-deduction43.C
More information about the Gcc-cvs
mailing list