summaryrefslogtreecommitdiffstats
path: root/clang/Sema/SemaExprObjC.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/Sema/SemaExprObjC.cpp')
-rw-r--r--clang/Sema/SemaExprObjC.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/clang/Sema/SemaExprObjC.cpp b/clang/Sema/SemaExprObjC.cpp
index 0f53bbd804c..3e73930e9b6 100644
--- a/clang/Sema/SemaExprObjC.cpp
+++ b/clang/Sema/SemaExprObjC.cpp
@@ -197,18 +197,16 @@ Sema::ExprResult Sema::ActOnInstanceMessage(
Expr **ArgExprs = reinterpret_cast<Expr **>(Args);
Expr *RExpr = static_cast<Expr *>(receiver);
- QualType receiverType = RExpr->getType();
+ QualType receiverType = RExpr->getType().getCanonicalType();
QualType returnType;
ObjCMethodDecl *Method = 0;
- // FIXME:
- // FIXME: This code is not stripping off type qualifiers or typedefs!
- // FIXME:
- if (receiverType == Context.getObjCIdType() ||
- receiverType == Context.getObjCClassType()) {
+ // FIXME: This code is not stripping off type qualifiers! Should it?
+ if (receiverType == Context.getObjCIdType().getCanonicalType() ||
+ receiverType == Context.getObjCClassType().getCanonicalType()) {
Method = InstanceMethodPool[Sel].Method;
- if (!Method)
- Method = FactoryMethodPool[Sel].Method;
+ if (!Method)
+ Method = FactoryMethodPool[Sel].Method;
if (!Method) {
Diag(lbrac, diag::warn_method_not_found, std::string("-"), Sel.getName(),
SourceRange(lbrac, rbrac));
@@ -261,7 +259,8 @@ Sema::ExprResult Sema::ActOnInstanceMessage(
else {
ObjCInterfaceType *OCIReceiver =dyn_cast<ObjCInterfaceType>(receiverType);
if (OCIReceiver == 0) {
- Diag(lbrac, diag::error_bad_receiver_type, receiverType.getAsString());
+ Diag(lbrac, diag::error_bad_receiver_type,
+ RExpr->getType().getAsString());
return true;
}
ClassDecl = OCIReceiver->getDecl();
OpenPOWER on IntegriCloud