Diagnose when method parameter is an object.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62431 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index f6a245a..d140b90 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -1349,6 +1349,11 @@
}
else if (argType->isFunctionType())
argType = Context.getPointerType(argType);
+ else if (argType->isObjCInterfaceType()) {
+ // FIXME! provide more precise location for the parameter
+ Diag(MethodLoc, diag::err_object_as_method_param);
+ return 0;
+ }
} else
argType = Context.getObjCIdType();
ParmVarDecl* Param;