r278786 - in /trunk/gcc: c-family/ChangeLog c-f...
jason@gcc.gnu.org
jason@gcc.gnu.org
Wed Nov 27 22:05:00 GMT 2019
Author: jason
Date: Wed Nov 27 22:05:53 2019
New Revision: 278786
URL: https://gcc.gnu.org/viewcvs?rev=278786&root=gcc&view=rev
Log:
Implement P1814R0, CTAD for alias templates.
This patch implements C++20 class template argument deduction for alias
templates, which works by a moderately arcane transformation of the
deduction guides for the underlying class template. When implementing it,
it seemed that I could simplify the rules in the draft a bit and get
essentially the same effect; I'll be emailing the committee to that effect
soon.
gcc/cp/
* pt.c (rewrite_tparm_list): Factor out of build_deduction_guide.
(maybe_aggr_guide): Check for copy-init here.
(alias_ctad_tweaks, deduction_guides_for): New.
(ctor_deduction_guides_for): Factor out of do_class_deduction.
(ctad_template_p): New.
* parser.c (cp_parser_simple_type_specifier): Use it.
* constraint.cc (append_constraint): New.
gcc/c-family/
* c-cppbuiltin.c (c_cpp_builtins): Update __cpp_deduction_guides.
Added:
trunk/gcc/testsuite/g++.dg/cpp2a/class-deduction-alias1.C
trunk/gcc/testsuite/g++.dg/cpp2a/class-deduction-alias2.C
Modified:
trunk/gcc/c-family/ChangeLog
trunk/gcc/c-family/c-cppbuiltin.c
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/call.c
trunk/gcc/cp/constraint.cc
trunk/gcc/cp/cp-tree.h
trunk/gcc/cp/parser.c
trunk/gcc/cp/pt.c
trunk/gcc/cp/tree.c
trunk/gcc/testsuite/g++.dg/cpp1z/class-deduction46.C
trunk/gcc/testsuite/g++.dg/cpp2a/explicit11.C
trunk/gcc/testsuite/g++.dg/cpp2a/feat-cxx2a.C
More information about the Gcc-cvs
mailing list