summaryrefslogtreecommitdiffstats
path: root/lib/Sema/SemaExprObjC.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2014-08-12 22:16:41 +0000
committerFariborz Jahanian <fjahanian@apple.com>2014-08-12 22:16:41 +0000
commit7c33b6163c35fe151b0a22f188065eecab3657f8 (patch)
tree4aae7749a8085ae015dcec1ed04b0f162b93e32d /lib/Sema/SemaExprObjC.cpp
parentfc064f81189a42025332a4dafab3ad8492e39ba4 (diff)
Objective-C [qoi]. Patch to not do Fix-It for fixing
a messaging expression except in the simple case of a unary selector. We cannot reliably provide such a fixit due to numerous reasons where a matching selector could not be found. rdar://15756038 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215480 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExprObjC.cpp')
-rw-r--r--lib/Sema/SemaExprObjC.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp
index 8ec2c177f7..3e7b620466 100644
--- a/lib/Sema/SemaExprObjC.cpp
+++ b/lib/Sema/SemaExprObjC.cpp
@@ -1366,9 +1366,12 @@ bool Sema::CheckMessageArgumentTypes(QualType ReceiverType,
: diag::warn_instance_method_not_found_with_typo;
Selector MatchedSel = OMD->getSelector();
SourceRange SelectorRange(SelectorLocs.front(), SelectorLocs.back());
- Diag(SelLoc, DiagID)
- << Sel<< isClassMessage << MatchedSel
- << FixItHint::CreateReplacement(SelectorRange, MatchedSel.getAsString());
+ if (MatchedSel.isUnarySelector())
+ Diag(SelLoc, DiagID)
+ << Sel<< isClassMessage << MatchedSel
+ << FixItHint::CreateReplacement(SelectorRange, MatchedSel.getAsString());
+ else
+ Diag(SelLoc, DiagID) << Sel<< isClassMessage << MatchedSel;
}
else
Diag(SelLoc, DiagID)