diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2012-07-02 23:37:09 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2012-07-02 23:37:09 +0000 |
commit | 6c89eafc90f5c51a0bf185a993961170aee530c2 (patch) | |
tree | 1c52effa180188efec187d7271e24009d3c1d36a /lib/Parse/ParseDecl.cpp | |
parent | a9e8b9e3e90fcfe10a04624a89c39b63c32614d1 (diff) |
objective-c: just as we have done for method definitions,
c-functions declared in implementation should have their
parsing delayed until the end so, they can access forward
declared private methods. // rdar://10387088
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159626 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDecl.cpp')
-rw-r--r-- | lib/Parse/ParseDecl.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index c61f5543a6..ac221117b5 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -1379,6 +1379,14 @@ Parser::DeclGroupPtrTy Parser::ParseDeclGroup(ParsingDeclSpec &DS, bool ExpectSemi = Context != Declarator::ForContext; + if (CurParsedObjCImpl && D.isFunctionDeclarator() && + Tok.is(tok::l_brace)) { + // Consume the tokens and store them for later parsing. + StashAwayMethodOrFunctionBodyTokens(FirstDecl); + CurParsedObjCImpl->HasCFunction = true; + ExpectSemi = false; + } + // If we don't have a comma, it is either the end of the list (a ';') or an // error, bail out. while (Tok.is(tok::comma)) { |