Implement multiple 'auto' feature from Concepts TS.
authorJason Merrill <jason@redhat.com>
Sat, 31 Oct 2015 16:20:05 +0000 (12:20 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Sat, 31 Oct 2015 16:20:05 +0000 (12:20 -0400)
commit4fea442db740d66cd8d16bdeb667d9725f305844
tree58ced5bf7feb8ee0c6ac2b1c7d216ad00966909d
parenta459b07fa440fcb449e9b65cf0cc649905b6ba9e
Implement multiple 'auto' feature from Concepts TS.

* parser.c (cp_parser_type_id_1): Allow 'auto' if -fconcepts.
(cp_parser_template_type_arg): Likewise.
(get_concept_from_constraint): Split out most logic to...
* constraint.cc (placeholder_extract_concept_and_args): ...here.
(equivalent_placeholder_constraints, hash_placeholder_constraint): New.
* cxx-pretty-print.c (pp_cxx_constrained_type_spec): New.
* cxx-pretty-print.h: Declare it.
* error.c (dump_type) [TEMPLATE_TYPE_PARM]: Call it.
* pt.c (is_auto_r, extract_autos_r, extract_autos, auto_hash): New.
(type_uses_auto): Use is_auto_r.
(do_auto_deduction): Handle multiple 'auto's if -fconcepts.
* typeck.c (structural_comptypes) [TEMPLATE_TYPE_PARM]: Compare
constraints.

From-SVN: r229629
gcc/cp/ChangeLog
gcc/cp/constraint.cc
gcc/cp/cp-tree.h
gcc/cp/cxx-pretty-print.c
gcc/cp/cxx-pretty-print.h
gcc/cp/error.c
gcc/cp/parser.c
gcc/cp/pt.c
gcc/cp/typeck.c
gcc/testsuite/g++.dg/concepts/auto1.C [new file with mode: 0644]