diff options
Diffstat (limited to 'clang/lib/Sema')
| -rw-r--r-- | clang/lib/Sema/SemaDeclObjC.cpp | 12 | 
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp index cb35890b3f1..dc30ac2ea90 100644 --- a/clang/lib/Sema/SemaDeclObjC.cpp +++ b/clang/lib/Sema/SemaDeclObjC.cpp @@ -1751,6 +1751,18 @@ Sema::DeclTy *Sema::ActOnPropertyImplDecl(SourceLocation AtLoc,            << property->getDeclName() << Ivar->getDeclName();            return 0;          } +        // __weak is explicit. So it works on Canonical type. +        if (PropType.isObjCGCWeak() && !IvarType.isObjCGCWeak()) { +          Diag(PropertyLoc, diag::error_weak_property) +          << property->getDeclName() << Ivar->getDeclName(); +          return 0; +        } +        if ((Context.isObjCObjectPointerType(property->getType()) ||  +             PropType.isObjCGCStrong()) && IvarType.isObjCGCWeak()) { +          Diag(PropertyLoc, diag::error_strong_property) +          << property->getDeclName() << Ivar->getDeclName(); +          return 0; +        }        }      }    } else if (PropertyIvar) {  | 

