This is the mail archive of the
gcc-cvs@gcc.gnu.org
mailing list for the GCC project.
r242017 - in /trunk/gcc: c-family/ChangeLog c-f...
- From: jason at gcc dot gnu dot org
- To: gcc-cvs at gcc dot gnu dot org
- Date: Wed, 09 Nov 2016 20:02:50 -0000
- Subject: r242017 - in /trunk/gcc: c-family/ChangeLog c-f...
Author: jason
Date: Wed Nov 9 20:02:50 2016
New Revision: 242017
URL: https://gcc.gnu.org/viewcvs?rev=242017&root=gcc&view=rev
Log:
Implement P0127R2, Declaring non-type parameters with auto.
gcc/cp/
* cp-tree.h (enum auto_deduction_context): Add adc_unify.
* decl.c (grokdeclarator): Allow 'auto' in C++17 template non-type
parameter types.
* pt.c (do_auto_deduction): Add outer_targs parameter.
(convert_template_argument): Call do_auto_deduction. If adc_unify,
don't give up on dependent init.
(unify): Likewise. In C++17, walk into the type of a
TEMPLATE_PARM_INDEX.
(for_each_template_parm): Add any_fn parameter.
(struct pair_fn_data): Likewise.
(for_each_template_parm_r): Call it for any tree. In C++17, walk
into the type of a TEMPLATE_PARM_INDEX.
(zero_r, array_deduction_r, try_array_deduction): New.
(type_unification_real): Call try_array_deduction.
(get_partial_spec_bindings): Likewise.
gcc/c-family/
* c-cppbuiltin.c (c_cpp_builtins): Define __cpp_template_auto.
Added:
trunk/gcc/testsuite/g++.dg/cpp1z/nontype-auto1.C
trunk/gcc/testsuite/g++.dg/cpp1z/nontype-auto2.C
trunk/gcc/testsuite/g++.dg/cpp1z/nontype-auto3.C
trunk/gcc/testsuite/g++.dg/cpp1z/nontype-auto4.C
trunk/gcc/testsuite/g++.dg/cpp1z/nontype-auto5.C
trunk/gcc/testsuite/g++.dg/cpp1z/nontype-auto6.C
Modified:
trunk/gcc/c-family/ChangeLog
trunk/gcc/c-family/c-cppbuiltin.c
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/cp-tree.h
trunk/gcc/cp/decl.c
trunk/gcc/cp/pt.c
trunk/gcc/testsuite/g++.dg/cpp0x/auto9.C
trunk/gcc/testsuite/g++.dg/cpp1z/feat-cxx1z.C
trunk/gcc/testsuite/g++.dg/template/partial5.C