summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/Parser.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2012-07-02 23:37:09 +0000
committerFariborz Jahanian <fjahanian@apple.com>2012-07-02 23:37:09 +0000
commit577574ab886a2f3588d146e433008b80bd033413 (patch)
treeb4e81e0cbdc28735094b564051ea5a4bba66c5d4 /clang/lib/Parse/Parser.cpp
parentb353094f27d0d21a466ac5f2cbc27579685d4545 (diff)
downloadbcm5719-llvm-577574ab886a2f3588d146e433008b80bd033413.tar.gz
bcm5719-llvm-577574ab886a2f3588d146e433008b80bd033413.zip
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 llvm-svn: 159626
Diffstat (limited to 'clang/lib/Parse/Parser.cpp')
-rw-r--r--clang/lib/Parse/Parser.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Parse/Parser.cpp b/clang/lib/Parse/Parser.cpp
index bec6dd717c6..c2c4c900903 100644
--- a/clang/lib/Parse/Parser.cpp
+++ b/clang/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
OpenPOWER on IntegriCloud