aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDeclObjC.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-04-23 02:46:06 +0000
committerJohn McCall <rjmccall@apple.com>2011-04-23 02:46:06 +0000
commit81ef3e664d8ae250fbb68b2b6ccdeebb6c13ede5 (patch)
tree7319bf4d8c93f4146addeb3f7f32cb3192b542da /lib/Sema/SemaDeclObjC.cpp
parente5e3d31dab0de2dcbf8da94177da74fe95509d2a (diff)
Diagnose C++ abstract parameters for Objective-C methods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130045 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclObjC.cpp')
-rw-r--r--lib/Sema/SemaDeclObjC.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index 01d37f47b2..7429020126 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -1803,17 +1803,9 @@ Decl *Sema::ActOnMethodDeclaration(
? DI->getTypeLoc().getBeginLoc()
: ArgInfo[i].NameLoc;
- ParmVarDecl* Param
- = ParmVarDecl::Create(Context, ObjCMethod,
- StartLoc, ArgInfo[i].NameLoc, ArgInfo[i].Name,
- ArgType, DI, SC_None, SC_None, 0);
-
- if (ArgType->isObjCObjectType()) {
- Diag(ArgInfo[i].NameLoc,
- diag::err_object_cannot_be_passed_returned_by_value)
- << 1 << ArgType;
- Param->setInvalidDecl();
- }
+ ParmVarDecl* Param = CheckParameter(ObjCMethod, StartLoc,
+ ArgInfo[i].NameLoc, ArgInfo[i].Name,
+ ArgType, DI, SC_None, SC_None);
Param->setObjCDeclQualifier(
CvtQTToAstBitMask(ArgInfo[i].DeclSpec.getObjCDeclQualifier()));