diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-01-17 21:57:49 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-01-17 21:57:49 +0000 |
commit | 9bae5e7af04e44b4d333a2c7ba22608d0594ff9f (patch) | |
tree | f0a5d526c259a49289b5ce24caf9225fc22df92c /lib/Sema/SemaDeclObjC.cpp | |
parent | f54b19497cb832da78700a6c86473231f35fba65 (diff) |
Diagnose when method parameter is an object.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62431 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclObjC.cpp')
-rw-r--r-- | lib/Sema/SemaDeclObjC.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index f6a245a317..d140b908a8 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -1349,6 +1349,11 @@ Sema::DeclTy *Sema::ActOnMethodDeclaration( } 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; |