summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaCXXCast.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-06-09 03:53:18 +0000
committerDouglas Gregor <dgregor@apple.com>2010-06-09 03:53:18 +0000
commit1fc3d66da4c2fa5f26a89c09f3ecf3325439b57d (patch)
tree658e6924bdc1563955e6a857cbb57094c753be46 /clang/lib/Sema/SemaCXXCast.cpp
parent83c64ee8de0842433aeaf52ed3750ae8495366e1 (diff)
downloadbcm5719-llvm-1fc3d66da4c2fa5f26a89c09f3ecf3325439b57d.tar.gz
bcm5719-llvm-1fc3d66da4c2fa5f26a89c09f3ecf3325439b57d.zip
Tweak our handling of the notion of a standard conversion sequence
being a subsequence of another standard conversion sequence. Instead of requiring exact type equality for the second conversion step, require type *similarity*, which is type equality with cv-qualifiers removed at all levels. This appears to match the behavior of EDG and VC++ (albeit not GCC), and feels more intuitive. Big thanks to John for the line of reasoning that supports this change: since cv-qualifiers are orthogonal to the second conversion step, we should ignore them in the type comparison. llvm-svn: 105678
Diffstat (limited to 'clang/lib/Sema/SemaCXXCast.cpp')
-rw-r--r--clang/lib/Sema/SemaCXXCast.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaCXXCast.cpp b/clang/lib/Sema/SemaCXXCast.cpp
index 5485bb3e17a..16f0af14d27 100644
--- a/clang/lib/Sema/SemaCXXCast.cpp
+++ b/clang/lib/Sema/SemaCXXCast.cpp
@@ -1019,7 +1019,7 @@ static TryCastResult TryConstCast(Sema &Self, Expr *SrcExpr, QualType DestType,
// in multi-level pointers may change, but the level count must be the same,
// as must be the final pointee type.
while (SrcType != DestType &&
- Self.UnwrapSimilarPointerTypes(SrcType, DestType)) {
+ Self.Context.UnwrapSimilarPointerTypes(SrcType, DestType)) {
Qualifiers Quals;
SrcType = Self.Context.getUnqualifiedArrayType(SrcType, Quals);
DestType = Self.Context.getUnqualifiedArrayType(DestType, Quals);
OpenPOWER on IntegriCloud