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 | dddf158c195c96f6e9e227d7afce636e634f9652 (patch) | |
| tree | 6e27609953d4f1e7065197feb7437f4349e936f3 /clang/lib/Sema | |
| parent | a3e64c17919435da37bfc7f4cc04c70f3c6fcb78 (diff) | |
| download | bcm5719-llvm-dddf158c195c96f6e9e227d7afce636e634f9652.tar.gz bcm5719-llvm-dddf158c195c96f6e9e227d7afce636e634f9652.zip | |
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.
llvm-svn: 116631
Diffstat (limited to 'clang/lib/Sema')
| -rw-r--r-- | clang/lib/Sema/SemaObjCProperty.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaObjCProperty.cpp b/clang/lib/Sema/SemaObjCProperty.cpp index f7555cfa6a0..251af224153 100644 --- a/clang/lib/Sema/SemaObjCProperty.cpp +++ b/clang/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 = |

