aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-parser.c
diff options
context:
space:
mode:
authorAndrew Pinski <pinskia@physics.uc.edu>2005-09-08 13:09:49 +0000
committerAndrew Pinski <pinskia@gcc.gnu.org>2005-09-08 06:09:49 -0700
commit8f078c08371d600c4834f90831b9ba54316ab019 (patch)
tree9ae97a6a050ddd44173676ffd5a92f1bc5cbe563 /gcc/c-parser.c
parent8aeca7fda07b3e505cab58c650ba46f352dc6f73 (diff)
downloadgcc-8f078c08371d600c4834f90831b9ba54316ab019.zip
gcc-8f078c08371d600c4834f90831b9ba54316ab019.tar.gz
gcc-8f078c08371d600c4834f90831b9ba54316ab019.tar.bz2
re PR objc/20574 (weird error message after a parse error)
2005-09-08 Andrew Pinski <pinskia@physics.uc.edu> PR objc/20574 PR objc/19324 * c-parser.c (c_parser_objc_method_definition): If the next token is not "{", error out and don't start the function. 2005-09-08 Andrew Pinski <pinskia@physics.uc.edu> PR objc/20574 PR objc/19324 * objc.dg/error-1.m: New test. From-SVN: r104032
Diffstat (limited to 'gcc/c-parser.c')
-rw-r--r--gcc/c-parser.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/c-parser.c b/gcc/c-parser.c
index 268fa90..ce03569 100644
--- a/gcc/c-parser.c
+++ b/gcc/c-parser.c
@@ -5723,6 +5723,11 @@ c_parser_objc_method_definition (c_parser *parser)
if (pedantic)
pedwarn ("extra semicolon in method definition specified");
}
+ if (!c_parser_next_token_is (parser, CPP_OPEN_BRACE))
+ {
+ c_parser_error (parser, "expected %<{%>");
+ return;
+ }
objc_pq_context = 0;
objc_start_method_definition (decl);
add_stmt (c_parser_compound_statement (parser));