Allow deduction guides to look into primary template.
authorJason Merrill <jason@redhat.com>
Fri, 3 Mar 2017 01:26:47 +0000 (20:26 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 3 Mar 2017 01:26:47 +0000 (20:26 -0500)
commitde35db4271bdfc6a648a5c5f504308c84ecb639b
tree7796627e11773e9ec963e179bdf219f300279c3e
parent9e01c6ce92c4a87eee46acfc24a5519c5367afd7
Allow deduction guides to look into primary template.

* cp-tree.h (struct saved_scope): Add deduction_guide_type.
(struct cp_decl_specifier_seq): Add constructor_p.
* parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
(cp_parser_init_declarator): Check it.  Set ctor_dtor_or_conv_p.
Clear deduction_guide_type.  Don't handle deduction guide names.
(cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
(cp_parser_direct_declarator): Likewise.  Handle deduction guides.
(cp_parser_member_declaration, cp_parser_cache_defarg)
(cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
* pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
(build_deduction_guide): Set deduction_guide_type.
(dependent_scope_p): Check deduction_guide_type.
* search.c (lookup_member): Likewise.

From-SVN: r245858
gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/parser.c
gcc/cp/pt.c
gcc/cp/search.c
gcc/testsuite/g++.dg/cpp1z/class-deduction37.C [new file with mode: 0644]