diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2012-07-20 17:19:54 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2012-07-20 17:19:54 +0000 |
commit | deb144ab515c6995eaa750bcf4207ca24724dfbb (patch) | |
tree | d3a1e9e49749736212bde78dc4fc046f7fae0659 /clang/lib/Parse/ParseDecl.cpp | |
parent | af03ef7cce8223e79cee0df115b49ad99156c8f2 (diff) | |
download | bcm5719-llvm-deb144ab515c6995eaa750bcf4207ca24724dfbb.tar.gz bcm5719-llvm-deb144ab515c6995eaa750bcf4207ca24724dfbb.zip |
Fixes an ObjC++ parse crash caused by delayed parsing
of c-functions nested in namespace in method implementations
by turning off its delayed parsing until a proper solution is
figured out. pr13418
llvm-svn: 160552
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r-- | clang/lib/Parse/ParseDecl.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index 05d44a5af0c..38aff5d4b9f 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -1340,9 +1340,12 @@ Parser::DeclGroupPtrTy Parser::ParseDeclGroup(ParsingDeclSpec &DS, // Look at the next token to make sure that this isn't a function // declaration. We have to check this because __attribute__ might be the // start of a function definition in GCC-extended K&R C. + // FIXME. Delayed parsing not done for c/c++ functions nested in namespace !isDeclarationAfterDeclarator() && (!CurParsedObjCImpl || Tok.isNot(tok::l_brace) || - (getLangOpts().CPlusPlus && D.getCXXScopeSpec().isSet()))) { + (getLangOpts().CPlusPlus && + (D.getCXXScopeSpec().isSet() || + !Actions.CurContext->isTranslationUnit())))) { if (isStartOfFunctionDefinition(D)) { if (DS.getStorageClassSpec() == DeclSpec::SCS_typedef) { |