Fixes a bug in property type encoding.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64672 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index 9659b94..d7f686f 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -2085,7 +2085,8 @@
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
index 0000000..deae4b7
--- /dev/null
+++ b/test/CodeGenObjC/objc2-property-encode.m
@@ -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