diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2012-02-06 19:06:20 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2012-02-06 19:06:20 +0000 |
commit | b918d6b1f794266e126e5445d69233462087d764 (patch) | |
tree | f2e7a517335483c1db4873417d9e61691c48e83a /lib/AST/ASTContext.cpp | |
parent | 5f3c7faa398e64a94d0757e19c69441e04819166 (diff) |
objc: fixes a problem in block type comparison involving
enums with underlying type explicitly specified
(feature which is on by default in objective-c).
// rdar://10798770
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149888 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ASTContext.cpp')
-rw-r--r-- | lib/AST/ASTContext.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index 51cbc3c9d7..416045e234 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -5960,11 +5960,13 @@ QualType ASTContext::mergeTypes(QualType LHS, QualType RHS, // Compatibility is based on the underlying type, not the promotion // type. if (const EnumType* ETy = LHS->getAs<EnumType>()) { - if (ETy->getDecl()->getIntegerType() == RHSCan.getUnqualifiedType()) + QualType TINT = ETy->getDecl()->getIntegerType(); + if (!TINT.isNull() && hasSameType(TINT, RHSCan.getUnqualifiedType())) return RHS; } if (const EnumType* ETy = RHS->getAs<EnumType>()) { - if (ETy->getDecl()->getIntegerType() == LHSCan.getUnqualifiedType()) + QualType TINT = ETy->getDecl()->getIntegerType(); + if (!TINT.isNull() && hasSameType(TINT, LHSCan.getUnqualifiedType())) return LHS; } // allow block pointer type to match an 'id' type. |