diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-02-21 18:23:24 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-02-21 18:23:24 +0000 |
commit | 86f938b3d4a79fb9c337d351c8f3e5f1ff18f1b6 (patch) | |
tree | e6f56905c6fe799c716cbb3f6f4617b3f0184c4b | |
parent | 4fff4819a913c65ae23cfd389bc47c61919e4e1f (diff) |
Fixed an ICE in meta-data generation of __weak/__strong ivars.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65235 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/AST/ASTContext.cpp | 3 | ||||
-rw-r--r-- | test/CodeGenObjC/objc2-weak-ivar.m | 10 |
2 files changed, 12 insertions, 1 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index 4a84e3d66c..830cc6a977 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -2151,7 +2151,8 @@ void ASTContext::getObjCEncodingForTypeImpl(QualType T, std::string& S, } S += '@'; if (FD || EncodingProperty) { - const ObjCInterfaceType *OIT = PointeeTy->getAsObjCInterfaceType(); + const ObjCInterfaceType *OIT = + PointeeTy.getUnqualifiedType()->getAsObjCInterfaceType(); ObjCInterfaceDecl *OI = OIT->getDecl(); S += '"'; S += OI->getNameAsCString(); diff --git a/test/CodeGenObjC/objc2-weak-ivar.m b/test/CodeGenObjC/objc2-weak-ivar.m new file mode 100644 index 0000000000..611bffd1e9 --- /dev/null +++ b/test/CodeGenObjC/objc2-weak-ivar.m @@ -0,0 +1,10 @@ +// RUN: clang -triple x86_64-unknown-unknown -fobjc-gc -emit-llvm -o %t %s +@class NSObject; + +@interface Foo { +@public + __weak NSObject *nsobject; +} +@end + +@implementation Foo @end |