diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-02-16 21:41:04 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-02-16 21:41:04 +0000 |
commit | bb99bdec7d3e704485baffae85938d24d35f0e0f (patch) | |
tree | cc3447b039f713a35e64d0eed30c69746e69a58a | |
parent | c7984ddeda4655e3e9e6acf2424acfc55173d5e2 (diff) |
Fixes a bug in property type encoding.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64672 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/AST/ASTContext.cpp | 3 | ||||
-rw-r--r-- | test/CodeGenObjC/objc2-property-encode.m | 13 |
2 files changed, 15 insertions, 1 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index 9659b94dd0..d7f686f127 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -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 index 0000000000..deae4b722b --- /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 |