aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/parser.c
diff options
context:
space:
mode:
authorPaolo Carlini <paolo@gcc.gnu.org>2013-06-17 14:06:36 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2013-06-17 14:06:36 +0000
commita0e33cbcd8966627b6a9d88b14e4ad9efccc97b4 (patch)
tree871573df716029e6d815928e435e60f2d3d7dd9d /gcc/cp/parser.c
parent617e128198c4cf0804a21f404a014674c39d1cfe (diff)
downloadgcc-a0e33cbcd8966627b6a9d88b14e4ad9efccc97b4.zip
gcc-a0e33cbcd8966627b6a9d88b14e4ad9efccc97b4.tar.gz
gcc-a0e33cbcd8966627b6a9d88b14e4ad9efccc97b4.tar.bz2
re PR c++/16128 (Diagnostic of missing argument list within functions)
/cp 2013-06-17 Paolo Carlini <paolo.carlini@oracle.com> PR c++/16128 * parser.c (cp_parser_expression_statement): Check whether cp_parser_expression returns error_mark_node. /testsuite 2013-06-17 Paolo Carlini <paolo.carlini@oracle.com> PR c++/16128 * g++.dg/template/error52.C: New. * g++.dg/lookup/friend15.C: Update. * g++.dg/parse/error11.C: Likewise. * g++.dg/parse/error14.C: Likewise. * g++.dg/parse/parser-pr28152-2.C: Likewise. * g++.dg/parse/template25.C: Likewise. * g++.old-deja/g++.jason/cond.C: Likewise. * g++.old-deja/g++.mike/for2.C: Likewise. * g++.old-deja/g++.robertl/eb125.C: Likewise. * obj-c++.dg/property/dotsyntax-4.mm: Likewise. From-SVN: r200150
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r--gcc/cp/parser.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index a581e88..d844d15 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -9264,7 +9264,15 @@ cp_parser_expression_statement (cp_parser* parser, tree in_statement_expr)
/* If the next token is a ';', then there is no expression
statement. */
if (cp_lexer_next_token_is_not (parser->lexer, CPP_SEMICOLON))
- statement = cp_parser_expression (parser, /*cast_p=*/false, NULL);
+ {
+ statement = cp_parser_expression (parser, /*cast_p=*/false, NULL);
+ if (statement == error_mark_node
+ && !cp_parser_uncommitted_to_tentative_parse_p (parser))
+ {
+ cp_parser_skip_to_end_of_block_or_statement (parser);
+ return error_mark_node;
+ }
+ }
/* Give a helpful message for "A<T>::type t;" and the like. */
if (cp_lexer_next_token_is_not (parser->lexer, CPP_SEMICOLON)