summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseDecl.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2012-07-03 22:54:28 +0000
committerFariborz Jahanian <fjahanian@apple.com>2012-07-03 22:54:28 +0000
commit8a369a82d5a0dfa5827fc56be952a257b61df8f8 (patch)
treeaa8e882b7a1072966ab2611f8d7e3aefafaaab76 /clang/lib/Parse/ParseDecl.cpp
parentf30f6ac7b92612bd86541b69567ec294dff8142d (diff)
downloadbcm5719-llvm-8a369a82d5a0dfa5827fc56be952a257b61df8f8.tar.gz
bcm5719-llvm-8a369a82d5a0dfa5827fc56be952a257b61df8f8.zip
Obj-C++11 parser: fix broken parsing of c-function
defined in class implementations. llvm-svn: 159691
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r--clang/lib/Parse/ParseDecl.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp
index 0a8ab1ac1aa..21dd46f2e9f 100644
--- a/clang/lib/Parse/ParseDecl.cpp
+++ b/clang/lib/Parse/ParseDecl.cpp
@@ -1379,10 +1379,8 @@ 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) &&
- !getLangOpts().CPlusPlus0x) {
+ Tok.is(tok::l_brace)) {
// Consume the tokens and store them for later parsing.
StashAwayMethodOrFunctionBodyTokens(FirstDecl);
CurParsedObjCImpl->HasCFunction = true;
@@ -1615,7 +1613,8 @@ Decl *Parser::ParseDeclarationAfterDeclaratorAndAttributes(Declarator &D,
Actions.AddInitializerToDecl(ThisDecl, Initializer.take(),
/*DirectInit=*/true, TypeContainsAuto);
}
- } else if (getLangOpts().CPlusPlus0x && Tok.is(tok::l_brace)) {
+ } else if (getLangOpts().CPlusPlus0x && Tok.is(tok::l_brace) &&
+ !CurParsedObjCImpl) {
// Parse C++0x braced-init-list.
Diag(Tok, diag::warn_cxx98_compat_generalized_initializer_lists);
OpenPOWER on IntegriCloud