diff options
author | Chris Lattner <sabre@nondot.org> | 2010-07-11 22:42:07 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-07-11 22:42:07 +0000 |
commit | 004659a56916f2f81ede507c12516c146d6c0df3 (patch) | |
tree | ac27fa629639189ebaf1d692618b164f210a8cf6 /lib/Parse/ParseTemplate.cpp | |
parent | c82daefa3062721e98947e08193cd81b4e9df915 (diff) |
Fix PR7617 by not entering ParseFunctionDefinition when
a function prototype is followed by a declarator if we
aren't parsing a K&R style identifier list.
Also, avoid skipping randomly after a declaration if a
semicolon is missing. Before we'd get:
t.c:3:1: error: expected function body after function declarator
void bar();
^
Now we get:
t.c:1:11: error: invalid token after top level declarator
void foo()
^
;
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108105 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseTemplate.cpp')
-rw-r--r-- | lib/Parse/ParseTemplate.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Parse/ParseTemplate.cpp b/lib/Parse/ParseTemplate.cpp index 1713a4f955..e1aaf91bd6 100644 --- a/lib/Parse/ParseTemplate.cpp +++ b/lib/Parse/ParseTemplate.cpp @@ -238,7 +238,7 @@ Parser::ParseSingleDeclarationAfterTemplate( } if (DeclaratorInfo.isFunctionDeclarator() && - isStartOfFunctionDefinition()) { + isStartOfFunctionDefinition(DeclaratorInfo)) { if (DS.getStorageClassSpec() == DeclSpec::SCS_typedef) { Diag(Tok, diag::err_function_declared_typedef); |