diff options
author | Erik Verbruggen <erik.verbruggen@nokia.com> | 2009-08-06 13:44:33 +0200 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@nokia.com> | 2009-08-06 13:44:33 +0200 |
commit | 4e7881577dce66476f76ad1362353c2bb8bbdac7 (patch) | |
tree | d0f18938016a10f1b66afda9c2d8fd4efaf924bc /src/shared/cplusplus/Parser.cpp | |
parent | 2e1811275ee6954aec9d1ff5afa2bb4753a30cec (diff) | |
download | qt-creator-4e7881577dce66476f76ad1362353c2bb8bbdac7.tar.gz |
Parser fix for ObjC methods.
Diffstat (limited to 'src/shared/cplusplus/Parser.cpp')
-rw-r--r-- | src/shared/cplusplus/Parser.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/shared/cplusplus/Parser.cpp b/src/shared/cplusplus/Parser.cpp index ea8b0f98e8..3ed4839928 100644 --- a/src/shared/cplusplus/Parser.cpp +++ b/src/shared/cplusplus/Parser.cpp @@ -4347,14 +4347,16 @@ bool Parser::parseObjCMethodDefinition(DeclarationAST *&node) ObjCMethodDeclarationAST *ast = new (_pool) ObjCMethodDeclarationAST; ast->method_prototype = method_prototype; + // Objective-C allows you to write: + // - (void) foo; { body; } + // so a method is a forward declaration when it doesn't have a _body_. + // However, we still need to read the semicolon. if (LA() == T_SEMICOLON) { - // method declaration: ast->semicolon_token = consumeToken(); - } else { - // method definition: - parseFunctionBody(ast->function_body); } + parseFunctionBody(ast->function_body); + node = ast; return true; } |