<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Ok thanks. I will take a look. If it is important, feel free to back out the patch.<div><br></div><div>- Fariborz</div><div><br><div><div>On Jul 3, 2012, at 3:02 PM, Jean-Daniel Dupas wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">This commit broke the Obj-C++11 parser:<div><br></div><div>---- foo.mm</div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-family: Menlo; font-size: 11px; color: rgb(194, 42, 156); ">@interface<span style="color: #000000"> Foo</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-family: Menlo; font-size: 11px; color: rgb(194, 42, 156); ">@end</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-family: Menlo; font-size: 11px; min-height: 13px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-family: Menlo; font-size: 11px; color: rgb(194, 42, 156); ">@implementation<span style="color: #000000"> Foo</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-family: Menlo; font-size: 11px; min-height: 13px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-family: Menlo; font-size: 11px; "><span style="color: #c22a9c">static</span> <span style="color: #c22a9c">int</span> test() {</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span style="font-family: Menlo; font-size: 11px; "> </span><font color="#c22a9c" face="Menlo"><span style="background-color: transparent; font-size: 11px;">return</span></font><span style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); "> </span><span style="font-family: Menlo; font-size: 11px; color: rgb(47, 47, 207); ">0</span><span style="font-family: Menlo; font-size: 11px; color: rgb(0, 0, 0); ">;</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-family: Menlo; font-size: 11px; ">}</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-family: Menlo; font-size: 11px; min-height: 13px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-family: Menlo; font-size: 11px; color: rgb(194, 42, 156); ">@end</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-family: Menlo; font-size: 11px; color: rgb(194, 42, 156); "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-family: Menlo; font-size: 11px; min-height: 13px; ">----------</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 13px; "><font face="Menlo"><span style="background-color: transparent; font-size: 11px;">clang++ -fsyntax-only -std=c++11 foo.mm </span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 13px; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 13px; "><font face="Menlo"><span style="background-color: transparent; font-size: 11px;">foo.mm:8:2: error: expected expression</span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 13px; "><font face="Menlo"><span style="background-color: transparent; font-size: 11px;"> return 0;</span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 13px; "><font face="Menlo"><span style="background-color: transparent; font-size: 11px;"> ^</span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 13px; "><font face="Menlo"><span style="background-color: transparent; font-size: 11px;">foo.mm:9:2: error: expected ';' after top level declarator</span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 13px; "><font face="Menlo"><span style="background-color: transparent; font-size: 11px;">}</span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 13px; "><font face="Menlo"><span style="background-color: transparent; font-size: 11px;"> ^</span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 13px; "><font face="Menlo"><span style="background-color: transparent; font-size: 11px;"> ;</span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 13px; "><font face="Menlo"><span style="background-color: transparent; font-size: 11px;">foo.mm:12:1: error: missing '@end'</span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 13px; "><font face="Menlo"><span style="background-color: transparent; font-size: 11px;">^</span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 13px; "><font face="Menlo"><span style="font-size: 11px;"><br></span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 13px; "><font face="Menlo"><span style="font-size: 11px;">@end</span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 13px; "><font face="Menlo"><span style="font-size: 11px;"><br></span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 13px; "><span style="font-family: Menlo; font-size: 11px; ">foo.mm</span><font face="Menlo"><span style="font-size: 11px;">:5:1: note: implementation started here</span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 13px; "><font face="Menlo"><span style="font-size: 11px;">@implementation Foo</span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 13px; "><font face="Menlo"><span style="font-size: 11px;">^</span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 13px; "><font face="Menlo"><span style="font-size: 11px;">3 errors generated.</span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 13px; "><font face="Menlo"><span style="font-size: 11px;"><br></span></font></div></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-family: Menlo; font-size: 11px; min-height: 13px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-family: Menlo; font-size: 11px; min-height: 13px; "><br></div><div><div>Le 3 juil. 2012 à 01:37, Fariborz Jahanian a écrit :</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Author: fjahanian<br>Date: Mon Jul 2 18:37:09 2012<br>New Revision: 159626<br><br>URL: <a href="http://llvm.org/viewvc/llvm-project?rev=159626&view=rev">http://llvm.org/viewvc/llvm-project?rev=159626&view=rev</a><br>Log:<br>objective-c: just as we have done for method definitions,<br>c-functions declared in implementation should have their <br>parsing delayed until the end so, they can access forward<br>declared private methods. // <a href="rdar://10387088">rdar://10387088</a><br><br>Added:<br> cfe/trunk/test/SemaObjC/delay-parsing-cfunctions.m<br>Modified:<br> cfe/trunk/include/clang/Parse/Parser.h<br> cfe/trunk/include/clang/Sema/Sema.h<br> cfe/trunk/lib/Parse/ParseDecl.cpp<br> cfe/trunk/lib/Parse/ParseObjc.cpp<br> cfe/trunk/lib/Parse/Parser.cpp<br> cfe/trunk/lib/Sema/SemaDeclObjC.cpp<br><br>Modified: cfe/trunk/include/clang/Parse/Parser.h<br>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Parse/Parser.h?rev=159626&r1=159625&r2=159626&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Parse/Parser.h?rev=159626&r1=159625&r2=159626&view=diff</a><br>==============================================================================<br>--- cfe/trunk/include/clang/Parse/Parser.h (original)<br>+++ cfe/trunk/include/clang/Parse/Parser.h Mon Jul 2 18:37:09 2012<br>@@ -1019,7 +1019,7 @@<br> void ParseLexedMethodDef(LexedMethod &LM);<br> void ParseLexedMemberInitializers(ParsingClass &Class);<br> void ParseLexedMemberInitializer(LateParsedMemberInitializer &MI);<br>- Decl *ParseLexedObjCMethodDefs(LexedMethod &LM);<br>+ void ParseLexedObjCMethodDefs(LexedMethod &LM, bool parseMethod);<br> bool ConsumeAndStoreFunctionPrologue(CachedTokens &Toks);<br> bool ConsumeAndStoreUntil(tok::TokenKind T1,<br> CachedTokens &Toks,<br>@@ -1084,11 +1084,12 @@<br> struct ObjCImplParsingDataRAII {<br> Parser &P;<br> Decl *Dcl;<br>+ bool HasCFunction;<br> typedef SmallVector<LexedMethod*, 8> LateParsedObjCMethodContainer;<br> LateParsedObjCMethodContainer LateParsedObjCMethods;<br><br> ObjCImplParsingDataRAII(Parser &parser, Decl *D)<br>- : P(parser), Dcl(D) {<br>+ : P(parser), Dcl(D), HasCFunction(false) {<br> P.CurParsedObjCImpl = this;<br> Finished = false;<br> }<br>@@ -1101,6 +1102,7 @@<br> bool Finished;<br> };<br> ObjCImplParsingDataRAII *CurParsedObjCImpl;<br>+ void StashAwayMethodOrFunctionBodyTokens(Decl *MDecl);<br><br> DeclGroupPtrTy ParseObjCAtImplementationDeclaration(SourceLocation AtLoc);<br> DeclGroupPtrTy ParseObjCAtEndDeclaration(SourceRange atEnd);<br><br>Modified: cfe/trunk/include/clang/Sema/Sema.h<br>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=159626&r1=159625&r2=159626&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=159626&r1=159625&r2=159626&view=diff</a><br>==============================================================================<br>--- cfe/trunk/include/clang/Sema/Sema.h (original)<br>+++ cfe/trunk/include/clang/Sema/Sema.h Mon Jul 2 18:37:09 2012<br>@@ -1317,7 +1317,11 @@<br> void CheckForFunctionRedefinition(FunctionDecl *FD);<br> Decl *ActOnStartOfFunctionDef(Scope *S, Declarator &D);<br> Decl *ActOnStartOfFunctionDef(Scope *S, Decl *D);<br>- void ActOnStartOfObjCMethodDef(Scope *S, Decl *D);<br>+ void ActOnStartOfObjCMethodOrCFunctionDef(Scope *S, Decl *D, <br>+ bool parseMethod);<br>+ bool isObjCMethodDecl(Decl *D) {<br>+ return D && isa<ObjCMethodDecl>(D);<br>+ }<br><br> void computeNRVO(Stmt *Body, sema::FunctionScopeInfo *Scope);<br> Decl *ActOnFinishFunctionBody(Decl *Decl, Stmt *Body);<br><br>Modified: cfe/trunk/lib/Parse/ParseDecl.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDecl.cpp?rev=159626&r1=159625&r2=159626&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDecl.cpp?rev=159626&r1=159625&r2=159626&view=diff</a><br>==============================================================================<br>--- cfe/trunk/lib/Parse/ParseDecl.cpp (original)<br>+++ cfe/trunk/lib/Parse/ParseDecl.cpp Mon Jul 2 18:37:09 2012<br>@@ -1379,6 +1379,14 @@<br><br> bool ExpectSemi = Context != Declarator::ForContext;<br><br>+ if (CurParsedObjCImpl && D.isFunctionDeclarator() &&<br>+ <a href="http://Tok.is/">Tok.is</a>(tok::l_brace)) {<br>+ // Consume the tokens and store them for later parsing.<br>+ StashAwayMethodOrFunctionBodyTokens(FirstDecl);<br>+ CurParsedObjCImpl->HasCFunction = true;<br>+ ExpectSemi = false;<br>+ }<br>+ <br> // If we don't have a comma, it is either the end of the list (a ';') or an<br> // error, bail out.<br> while (<a href="http://Tok.is/">Tok.is</a>(tok::comma)) {<br><br>Modified: cfe/trunk/lib/Parse/ParseObjc.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseObjc.cpp?rev=159626&r1=159625&r2=159626&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseObjc.cpp?rev=159626&r1=159625&r2=159626&view=diff</a><br>==============================================================================<br>--- cfe/trunk/lib/Parse/ParseObjc.cpp (original)<br>+++ cfe/trunk/lib/Parse/ParseObjc.cpp Mon Jul 2 18:37:09 2012<br>@@ -1575,10 +1575,16 @@<br> assert(!Finished);<br> P.Actions.DefaultSynthesizeProperties(P.getCurScope(), Dcl);<br> for (size_t i = 0; i < LateParsedObjCMethods.size(); ++i)<br>- P.ParseLexedObjCMethodDefs(*LateParsedObjCMethods[i]);<br>+ P.ParseLexedObjCMethodDefs(*LateParsedObjCMethods[i], <br>+ true/*Methods*/);<br><br> P.Actions.ActOnAtEnd(P.getCurScope(), AtEnd);<br><br>+ if (HasCFunction)<br>+ for (size_t i = 0; i < LateParsedObjCMethods.size(); ++i)<br>+ P.ParseLexedObjCMethodDefs(*LateParsedObjCMethods[i], <br>+ false/*c-functions*/);<br>+ <br> /// \brief Clear and free the cached objc methods.<br> for (LateParsedObjCMethodContainer::iterator<br> I = LateParsedObjCMethods.begin(),<br>@@ -1915,6 +1921,19 @@<br> AutoreleasePoolBody.take());<br> }<br><br>+/// StashAwayMethodOrFunctionBodyTokens - Consume the tokens and store them <br>+/// for later parsing.<br>+void Parser::StashAwayMethodOrFunctionBodyTokens(Decl *MDecl) {<br>+ LexedMethod* LM = new LexedMethod(this, MDecl);<br>+ CurParsedObjCImpl->LateParsedObjCMethods.push_back(LM);<br>+ CachedTokens &Toks = LM->Toks;<br>+ // Begin by storing the '{' token.<br>+ Toks.push_back(Tok);<br>+ ConsumeBrace();<br>+ // Consume everything up to (and including) the matching right brace.<br>+ ConsumeAndStoreUntil(tok::r_brace, Toks, /*StopAtSemi=*/false);<br>+}<br>+<br> /// objc-method-def: objc-method-proto ';'[opt] '{' body '}'<br> ///<br> Decl *Parser::ParseObjCMethodDefinition() {<br>@@ -1955,15 +1974,7 @@<br><br> if (CurParsedObjCImpl) {<br> // Consume the tokens and store them for later parsing.<br>- LexedMethod* LM = new LexedMethod(this, MDecl);<br>- CurParsedObjCImpl->LateParsedObjCMethods.push_back(LM);<br>- CachedTokens &Toks = LM->Toks;<br>- // Begin by storing the '{' token.<br>- Toks.push_back(Tok);<br>- ConsumeBrace();<br>- // Consume everything up to (and including) the matching right brace.<br>- ConsumeAndStoreUntil(tok::r_brace, Toks, /*StopAtSemi=*/false);<br>-<br>+ StashAwayMethodOrFunctionBodyTokens(MDecl);<br> } else {<br> ConsumeBrace();<br> SkipUntil(tok::r_brace, /*StopAtSemi=*/false);<br>@@ -2821,8 +2832,15 @@<br> T.getCloseLocation()));<br> }<br><br>-Decl *Parser::ParseLexedObjCMethodDefs(LexedMethod &LM) {<br>-<br>+void Parser::ParseLexedObjCMethodDefs(LexedMethod &LM, bool parseMethod) {<br>+ // MCDecl might be null due to error in method or c-function prototype, etc.<br>+ Decl *MCDecl = LM.D;<br>+ bool skip = MCDecl && <br>+ ((parseMethod && !Actions.isObjCMethodDecl(MCDecl)) ||<br>+ (!parseMethod && Actions.isObjCMethodDecl(MCDecl)));<br>+ if (skip)<br>+ return;<br>+ <br> // Save the current token position.<br> SourceLocation OrigLoc = Tok.getLocation();<br><br>@@ -2832,24 +2850,25 @@<br> LM.Toks.push_back(Tok);<br> PP.EnterTokenStream(LM.Toks.data(), LM.Toks.size(), true, false);<br><br>- // MDecl might be null due to error in method prototype, etc.<br>- Decl *MDecl = LM.D;<br> // Consume the previously pushed token.<br> ConsumeAnyToken();<br><br> assert(<a href="http://Tok.is/">Tok.is</a>(tok::l_brace) && "Inline objective-c method not starting with '{'");<br> SourceLocation BraceLoc = Tok.getLocation();<br>- // Enter a scope for the method body.<br>+ // Enter a scope for the method or c-fucntion body.<br> ParseScope BodyScope(this,<br>- Scope::ObjCMethodScope|Scope::FnScope|Scope::DeclScope);<br>+ parseMethod<br>+ ? Scope::ObjCMethodScope|Scope::FnScope|Scope::DeclScope<br>+ : Scope::FnScope|Scope::DeclScope);<br><br>- // Tell the actions module that we have entered a method definition with the<br>- // specified Declarator for the method.<br>- Actions.ActOnStartOfObjCMethodDef(getCurScope(), MDecl);<br>+ // Tell the actions module that we have entered a method or c-function definition <br>+ // with the specified Declarator for the method/function.<br>+ Actions.ActOnStartOfObjCMethodOrCFunctionDef(getCurScope(), MCDecl, parseMethod);<br><br> if (SkipFunctionBodies && trySkippingFunctionBody()) {<br> BodyScope.Exit();<br>- return Actions.ActOnFinishFunctionBody(MDecl, 0);<br>+ (void)Actions.ActOnFinishFunctionBody(MCDecl, 0);<br>+ return;<br> }<br><br> StmtResult FnBody(ParseCompoundStatementBody());<br>@@ -2864,7 +2883,7 @@<br> // Leave the function body scope.<br> BodyScope.Exit();<br><br>- MDecl = Actions.ActOnFinishFunctionBody(MDecl, FnBody.take());<br>+ (void)Actions.ActOnFinishFunctionBody(MCDecl, FnBody.take());<br><br> if (Tok.getLocation() != OrigLoc) {<br> // Due to parsing error, we either went over the cached tokens or<br>@@ -2878,5 +2897,5 @@<br> ConsumeAnyToken();<br> }<br><br>- return MDecl;<br>+ return;<br> }<br><br>Modified: cfe/trunk/lib/Parse/Parser.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/Parser.cpp?rev=159626&r1=159625&r2=159626&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/Parser.cpp?rev=159626&r1=159625&r2=159626&view=diff</a><br>==============================================================================<br>--- cfe/trunk/lib/Parse/Parser.cpp (original)<br>+++ cfe/trunk/lib/Parse/Parser.cpp Mon Jul 2 18:37:09 2012<br>@@ -766,14 +766,16 @@<br> if (<a href="http://KW.is/">KW.is</a>(tok::kw_default) || <a href="http://KW.is/">KW.is</a>(tok::kw_delete))<br> return false;<br> }<br>-<br>+ <br> return <a href="http://Tok.is/">Tok.is</a>(tok::equal) || // int X()= -> not a function def<br> <a href="http://Tok.is/">Tok.is</a>(tok::comma) || // int X(), -> not a function def<br> <a href="http://Tok.is/">Tok.is</a>(tok::semi) || // int X(); -> not a function def<br> <a href="http://Tok.is/">Tok.is</a>(tok::kw_asm) || // int X() __asm__ -> not a function def<br> <a href="http://Tok.is/">Tok.is</a>(tok::kw___attribute) || // int X() __attr__ -> not a function def<br> (getLangOpts().CPlusPlus &&<br>- <a href="http://Tok.is/">Tok.is</a>(tok::l_paren)); // int X(0) -> not a function def [C++]<br>+ <a href="http://Tok.is/">Tok.is</a>(tok::l_paren)) || // int X(0) -> not a function def [C++]<br>+ (CurParsedObjCImpl && <br>+ <a href="http://Tok.is/">Tok.is</a>(tok::l_brace)); // C-function nested in an @implementation<br> }<br><br> /// \brief Determine whether the current token, if it occurs after a<br><br>Modified: cfe/trunk/lib/Sema/SemaDeclObjC.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclObjC.cpp?rev=159626&r1=159625&r2=159626&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclObjC.cpp?rev=159626&r1=159625&r2=159626&view=diff</a><br>==============================================================================<br>--- cfe/trunk/lib/Sema/SemaDeclObjC.cpp (original)<br>+++ cfe/trunk/lib/Sema/SemaDeclObjC.cpp Mon Jul 2 18:37:09 2012<br>@@ -265,12 +265,36 @@<br> AddFactoryMethodToGlobalPool(MDecl, true);<br> }<br><br>-/// ActOnStartOfObjCMethodDef - This routine sets up parameters; invisible<br>-/// and user declared, in the method definition's AST.<br>-void Sema::ActOnStartOfObjCMethodDef(Scope *FnBodyScope, Decl *D) {<br>- assert(getCurMethodDecl() == 0 && "Method parsing confused");<br>+/// ActOnStartOfObjCMethodOrCFunctionDef - This routine sets up parameters; invisible<br>+/// and user declared, in the method definition's AST. This routine is also called<br>+/// for C-functions defined in an Objective-c class implementation.<br>+void Sema::ActOnStartOfObjCMethodOrCFunctionDef(Scope *FnBodyScope, Decl *D,<br>+ bool parseMethod) {<br>+ assert((getCurMethodDecl() == 0 && getCurFunctionDecl() == 0) &&<br>+ "Method/c-function parsing confused");<br>+ if (!parseMethod) {<br>+ FunctionDecl *FDecl = FDecl = dyn_cast_or_null<FunctionDecl>(D);<br>+ // If we don't have a valid c-function decl, simply return.<br>+ if (!FDecl)<br>+ return;<br>+ PushDeclContext(FnBodyScope, FDecl);<br>+ PushFunctionScope();<br>+ <br>+ for (FunctionDecl::param_const_iterator PI = FDecl->param_begin(),<br>+ E = FDecl->param_end(); PI != E; ++PI) {<br>+ ParmVarDecl *Param = (*PI);<br>+ if (!Param->isInvalidDecl() &&<br>+ RequireCompleteType(Param->getLocation(), Param->getType(),<br>+ diag::err_typecheck_decl_incomplete_type))<br>+ Param->setInvalidDecl();<br>+ if ((*PI)->getIdentifier())<br>+ PushOnScopeChains(*PI, FnBodyScope);<br>+ }<br>+ return;<br>+ }<br>+ <br> ObjCMethodDecl *MDecl = dyn_cast_or_null<ObjCMethodDecl>(D);<br>-<br>+ <br> // If we don't have a valid method decl, simply return.<br> if (!MDecl)<br> return;<br><br>Added: cfe/trunk/test/SemaObjC/delay-parsing-cfunctions.m<br>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/delay-parsing-cfunctions.m?rev=159626&view=auto">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/delay-parsing-cfunctions.m?rev=159626&view=auto</a><br>==============================================================================<br>--- cfe/trunk/test/SemaObjC/delay-parsing-cfunctions.m (added)<br>+++ cfe/trunk/test/SemaObjC/delay-parsing-cfunctions.m Mon Jul 2 18:37:09 2012<br>@@ -0,0 +1,32 @@<br>+// RUN: %clang_cc1 -fsyntax-only -Werror -verify -Wno-objc-root-class %s<br>+// RUN: %clang_cc1 -x objective-c++ -fsyntax-only -Werror -verify -Wno-objc-root-class %s<br>+// <a href="rdar://10387088">rdar://10387088</a><br>+<br>+@interface MyClass<br>+- (void)someMethod;<br>+@end<br>+<br>+@implementation MyClass<br>+- (void)someMethod {<br>+ [self privateMethod]; // clang already does not warn here<br>+}<br>+<br>+int bar(MyClass * myObject) {<br>+ [myObject privateMethod]; <br>+ return gorfbar(myObject);<br>+}<br>+- (void)privateMethod { }<br>+<br>+int gorfbar(MyClass * myObject) {<br>+ [myObject privateMethod]; <br>+ [myObject privateMethod1]; <br>+ return getMe + bar(myObject);<br>+}<br>+<br>+- (void)privateMethod1 {<br>+ getMe = getMe+1;<br>+}<br>+<br>+static int getMe;<br>+<br>+@end<br><br><br>_______________________________________________<br>cfe-commits mailing list<br><a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br></div></blockquote></div><br><div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "><div>-- Jean-Daniel</div><div><br></div><div><br></div></span><br class="Apple-interchange-newline">
</div>
<br></div></div></blockquote></div><br></div></body></html>