diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-04-15 21:54:48 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-04-15 21:54:48 +0000 |
commit | c8d2e77288c07a69cabb755a4ab9feeb7b5a1287 (patch) | |
tree | 3fd7800ad6e2ae618d82b29d4f06fc18f0b2de71 /lib/AST/ASTContext.cpp | |
parent | 963dfbde17a28bc88ee1647bc85fd8407bfc9555 (diff) |
Fix decl type merges when they have
__string/__weak attributes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69229 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ASTContext.cpp')
-rw-r--r-- | lib/AST/ASTContext.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index f0c2d2be48..63d88b2ec7 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -2937,8 +2937,8 @@ QualType ASTContext::mergeTypes(QualType LHS, QualType RHS) { if (LHSCan.getCVRQualifiers() != RHSCan.getCVRQualifiers()) return QualType(); - Type::TypeClass LHSClass = LHSCan->getTypeClass(); - Type::TypeClass RHSClass = RHSCan->getTypeClass(); + Type::TypeClass LHSClass = LHSCan.getUnqualifiedType()->getTypeClass(); + Type::TypeClass RHSClass = RHSCan.getUnqualifiedType()->getTypeClass(); // We want to consider the two function types to be the same for these // comparisons, just force one to the other. @@ -2963,7 +2963,7 @@ QualType ASTContext::mergeTypes(QualType LHS, QualType RHS) { if (LHSClass != RHSClass) { const ObjCInterfaceType* LHSIface = LHS->getAsObjCInterfaceType(); const ObjCInterfaceType* RHSIface = RHS->getAsObjCInterfaceType(); - + // 'id' and 'Class' act sort of like void* for ObjC interfaces if (LHSIface && (isObjCIdStructType(RHS) || isObjCClassStructType(RHS))) return LHS; |