diff options
| author | Chandler Carruth <chandlerc@gmail.com> | 2009-12-29 08:05:19 +0000 |
|---|---|---|
| committer | Chandler Carruth <chandlerc@gmail.com> | 2009-12-29 08:05:19 +0000 |
| commit | 585fb1e97ea4dc67a45f304a42368f8d6b555a52 (patch) | |
| tree | 801993ca5ea7a60b0d0726b71d2db5956379ccb6 /clang/lib/Sema | |
| parent | 6311212bf9c5d908950b0c57b4ad647617f1ec36 (diff) | |
| download | bcm5719-llvm-585fb1e97ea4dc67a45f304a42368f8d6b555a52.tar.gz bcm5719-llvm-585fb1e97ea4dc67a45f304a42368f8d6b555a52.zip | |
Fix support for const_cast<>s of array types which actual change the
CV-qualifiers. Remove an error expectation from the 'good' set of const-cast
test cases. With this patch, the final non-template test case from PR5542
passes. (It's the same as the one already in const-cast.cpp.)
llvm-svn: 92257
Diffstat (limited to 'clang/lib/Sema')
| -rw-r--r-- | clang/lib/Sema/SemaCXXCast.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaCXXCast.cpp b/clang/lib/Sema/SemaCXXCast.cpp index 045ffb20deb..800c544d336 100644 --- a/clang/lib/Sema/SemaCXXCast.cpp +++ b/clang/lib/Sema/SemaCXXCast.cpp @@ -959,8 +959,9 @@ static TryCastResult TryConstCast(Sema &Self, Expr *SrcExpr, QualType DestType, // as must be the final pointee type. while (SrcType != DestType && Self.UnwrapSimilarPointerTypes(SrcType, DestType)) { - SrcType = SrcType.getUnqualifiedType(); - DestType = DestType.getUnqualifiedType(); + Qualifiers Quals; + SrcType = Self.Context.getUnqualifiedArrayType(SrcType, Quals); + DestType = Self.Context.getUnqualifiedArrayType(DestType, Quals); } // Since we're dealing in canonical types, the remainder must be the same. |

