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/Parser.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/Parser.cpp')
-rw-r--r-- | lib/Parse/Parser.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Parse/Parser.cpp b/lib/Parse/Parser.cpp index bec6dd717c..c2c4c90090 100644 --- a/lib/Parse/Parser.cpp +++ b/lib/Parse/Parser.cpp @@ -766,14 +766,16 @@ bool Parser::isDeclarationAfterDeclarator() { if (KW.is(tok::kw_default) || KW.is(tok::kw_delete)) return false; } - + return Tok.is(tok::equal) || // int X()= -> not a function def Tok.is(tok::comma) || // int X(), -> not a function def Tok.is(tok::semi) || // int X(); -> not a function def Tok.is(tok::kw_asm) || // int X() __asm__ -> not a function def Tok.is(tok::kw___attribute) || // int X() __attr__ -> not a function def (getLangOpts().CPlusPlus && - Tok.is(tok::l_paren)); // int X(0) -> not a function def [C++] + Tok.is(tok::l_paren)) || // int X(0) -> not a function def [C++] + (CurParsedObjCImpl && + Tok.is(tok::l_brace)); // C-function nested in an @implementation } /// \brief Determine whether the current token, if it occurs after a |