]> granicus.if.org Git - clang/commitdiff
Fixes a bug in property type encoding.
authorFariborz Jahanian <fjahanian@apple.com>
Mon, 16 Feb 2009 21:41:04 +0000 (21:41 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Mon, 16 Feb 2009 21:41:04 +0000 (21:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64672 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ASTContext.cpp
test/CodeGenObjC/objc2-property-encode.m [new file with mode: 0644]

index 9659b94dd01431225f919082c15a4a67d5857c78..d7f686f1274fac6b76bd677932599508a245325f 100644 (file)
@@ -2085,7 +2085,8 @@ void ASTContext::getObjCEncodingForTypeImpl(QualType T, std::string& S,
       return;
     }
     else if (PointeeTy->isObjCInterfaceType()) {
-      if (dyn_cast<TypedefType>(PointeeTy.getTypePtr())) {
+      if (!EncodingProperty &&
+          dyn_cast<TypedefType>(PointeeTy.getTypePtr())) {
         // Another historical/compatibility reason.
         // We encode the underlying type which comes out as 
         // {...};
diff --git a/test/CodeGenObjC/objc2-property-encode.m b/test/CodeGenObjC/objc2-property-encode.m
new file mode 100644 (file)
index 0000000..deae4b7
--- /dev/null
@@ -0,0 +1,13 @@
+// RUN: clang -triple=i686-apple-darwin9 -fnext-runtime -emit-llvm -o %t %s &&
+// RUN: grep -e "T@\\\\22NSString\\\\22" %t
+@interface NSString @end
+
+typedef NSString StoreVersionID ;
+
+@interface Parent 
+  @property(retain) StoreVersionID* foo;
+@end
+
+@implementation Parent
+@dynamic foo;
+@end