PR c++/68597, fix auto9.C and auto-neg1.C with -std=c++1z.
authorJason Merrill <jason@redhat.com>
Mon, 7 Dec 2015 04:34:43 +0000 (23:34 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 7 Dec 2015 04:34:43 +0000 (23:34 -0500)
commit5dc58049178775591a6e2dd04c9ce9cee4007dab
tree3301952703831d6af8b321a802640f7212d328df
parentadcef2743040ffe09dedd3bc909adf02a26a6803
PR c++/68597, fix auto9.C and auto-neg1.C with -std=c++1z.

* decl.c (check_tag_decl): Use ds_type_spec in auto diagnostic.
* typeck.c (check_return_expr): Check for inconsistent deduction.
* parser.c (class type_id_in_expr_sentinel): New.
(cp_parser_primary_expression) [RID_VA_ARG]: Use it.
(cp_parser_new_expression): Use it.
(cp_parser_trait_expr): Use it.
(cp_parser_type_id_1): Complain about auto if in_type_id_in_expr_p.
(cp_parser_default_type_template_argument): Check for auto.
(cp_parser_type_id_list): Likewise.
(cp_parser_simple_type_specifier): Allow auto parms if flag_concepts.
* pt.c (do_auto_deduction): Handle erroneous type.

From-SVN: r231349
gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/cp/parser.c
gcc/cp/pt.c
gcc/cp/typeck.c
gcc/testsuite/g++.dg/cpp0x/auto9.C
gcc/testsuite/g++.dg/cpp1y/lambda-deduce-mult-neg.C [new file with mode: 0644]
gcc/testsuite/g++.dg/other/anon-union3.C