diff options
author | John McCall <rjmccall@apple.com> | 2011-05-15 07:14:44 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-05-15 07:14:44 +0000 |
commit | 7d16627081caede9691a6f46b796da4073ac14ad (patch) | |
tree | 05cdd4c41c0aa1db289493b5fac6f625776fef7c /lib/Sema/SemaExprCXX.cpp | |
parent | bf832a4ed4ea36e1657bafd1012bd5eea87b46b0 (diff) |
The array-size operand to a new-expression is not necessarily a size_t.
It can be larger, it can be smaller, it can be signed, whatever. Handle
all the crazy cases with grace and spirit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131378 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExprCXX.cpp')
-rw-r--r-- | lib/Sema/SemaExprCXX.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp index f0faa8c29c..c82a9f9d00 100644 --- a/lib/Sema/SemaExprCXX.cpp +++ b/lib/Sema/SemaExprCXX.cpp @@ -951,8 +951,8 @@ Sema::BuildCXXNew(SourceLocation StartLoc, bool UseGlobal, } } - ArraySize = ImpCastExprToType(ArraySize, Context.getSizeType(), - CK_IntegralCast).take(); + // Note that we do *not* convert the argument in any way. It can + // be signed, larger than size_t, whatever. } FunctionDecl *OperatorNew = 0; |