diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2010-10-15 22:42:59 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-10-15 22:42:59 +0000 |
commit | 0313f441b72ef6b69a93e5003c684b01cb72fd46 (patch) | |
tree | 911c927aeadf8b59bf327c867560d51bebbc6a78 /lib/Sema/SemaObjCProperty.cpp | |
parent | 06205ca78ca2fd4384b237f120ec66614df0d9fc (diff) |
Check for ivar being a C++ object before attempting to
find a copy constructor/assignment operator used
in getter/setter synthesis. This removes an unintended
diagnostics and makes objc++ consistant with objective-c.
// rdar: //8550657.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116631 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaObjCProperty.cpp')
-rw-r--r-- | lib/Sema/SemaObjCProperty.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Sema/SemaObjCProperty.cpp b/lib/Sema/SemaObjCProperty.cpp index f7555cfa6a..251af22415 100644 --- a/lib/Sema/SemaObjCProperty.cpp +++ b/lib/Sema/SemaObjCProperty.cpp @@ -460,7 +460,8 @@ Decl *Sema::ActOnPropertyImplDecl(Scope *S, Ivar); if (ObjCMethodDecl *getterMethod = property->getGetterMethodDecl()) { getterMethod->createImplicitParams(Context, IDecl); - if (getLangOptions().CPlusPlus && Synthesize) { + if (getLangOptions().CPlusPlus && Synthesize && + Ivar->getType()->isRecordType()) { // For Objective-C++, need to synthesize the AST for the IVAR object to be // returned by the getter as it must conform to C++'s copy-return rules. // FIXME. Eventually we want to do this for Objective-C as well. @@ -488,7 +489,8 @@ Decl *Sema::ActOnPropertyImplDecl(Scope *S, } if (ObjCMethodDecl *setterMethod = property->getSetterMethodDecl()) { setterMethod->createImplicitParams(Context, IDecl); - if (getLangOptions().CPlusPlus && Synthesize) { + if (getLangOptions().CPlusPlus && Synthesize + && Ivar->getType()->isRecordType()) { // FIXME. Eventually we want to do this for Objective-C as well. ImplicitParamDecl *SelfDecl = setterMethod->getSelfDecl(); DeclRefExpr *SelfExpr = |