]> granicus.if.org Git - clang/commitdiff
Obj-C++11 parser: turn off buffering of
authorFariborz Jahanian <fjahanian@apple.com>
Tue, 3 Jul 2012 22:29:23 +0000 (22:29 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Tue, 3 Jul 2012 22:29:23 +0000 (22:29 +0000)
c-function defined in objc class
implementation for now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159690 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Parse/ParseDecl.cpp
lib/Parse/Parser.cpp

index ac221117b5f31215c432265fb9c56ce0b592c3b4..0a8ab1ac1aa4a2132ee73ba7658be94f99420eae 100644 (file)
@@ -1379,8 +1379,10 @@ Parser::DeclGroupPtrTy Parser::ParseDeclGroup(ParsingDeclSpec &DS,
 
   bool ExpectSemi = Context != Declarator::ForContext;
 
+  // FIXME. make this work for Obj-C++11 parser.
   if (CurParsedObjCImpl && D.isFunctionDeclarator() &&
-      Tok.is(tok::l_brace)) {
+      Tok.is(tok::l_brace) &&
+      !getLangOpts().CPlusPlus0x) {
     // Consume the tokens and store them for later parsing.
     StashAwayMethodOrFunctionBodyTokens(FirstDecl);
     CurParsedObjCImpl->HasCFunction = true;
index c2c4c900903a3e779818a3a714be86e76e71a2f8..8ae0aa99763733e8e386c693b71cd71d745df27e 100644 (file)
@@ -775,6 +775,7 @@ bool Parser::isDeclarationAfterDeclarator() {
     (getLangOpts().CPlusPlus &&
      Tok.is(tok::l_paren)) ||       // int X(0) -> not a function def [C++]
     (CurParsedObjCImpl && 
+     !getLangOpts().CPlusPlus0x && // FIXME for Obj-C++11 parser.
      Tok.is(tok::l_brace));        // C-function  nested in an @implementation
 }