diff options
Diffstat (limited to 'lib/Parse/ParseObjc.cpp')
-rw-r--r-- | lib/Parse/ParseObjc.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/Parse/ParseObjc.cpp b/lib/Parse/ParseObjc.cpp index 6d5f35a799..2bcb7a786a 100644 --- a/lib/Parse/ParseObjc.cpp +++ b/lib/Parse/ParseObjc.cpp @@ -1032,6 +1032,7 @@ Decl *Parser::ParseObjCMethodDecl(SourceLocation mLoc, AttributePool allParamAttrs(AttrFactory); bool warnSelectorName = false; + bool warnHasNoName = true; while (1) { ParsedAttributes paramAttrs(AttrFactory); Sema::ObjCArgInfo ArgInfo; @@ -1109,7 +1110,8 @@ Decl *Parser::ParseObjCMethodDecl(SourceLocation mLoc, Diag(Tok, diag::warn_missing_argument_name); // missing argument name. warnSelectorName = true; } - + else + warnHasNoName = false; // We have a selector or a colon, continue parsing. } @@ -1150,8 +1152,11 @@ Decl *Parser::ParseObjCMethodDecl(SourceLocation mLoc, Selector Sel = PP.getSelectorTable().getSelector(KeyIdents.size(), &KeyIdents[0]); - if (warnSelectorName) + if (warnSelectorName) { + if (warnHasNoName) + Diag(mLoc, diag::warn_selector_with_bare_colon); Diag(mLoc, diag::note_missing_argument_name) << Sel.getAsString(); + } Decl *Result = Actions.ActOnMethodDeclaration(getCurScope(), mLoc, Tok.getLocation(), |