aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaType.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2012-01-11 00:14:46 +0000
committerJohn McCall <rjmccall@apple.com>2012-01-11 00:14:46 +0000
commit806054db6653d29cb0d9692df3612cbcd03d0530 (patch)
treeec8e7db01c48b0b65e6170409e0390816364a734 /lib/Sema/SemaType.cpp
parent9db0a5e7e360d8048c83ee1c46a88c4172182791 (diff)
Do placeholder conversions on array bounds in both declarators and
new-expressions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147900 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaType.cpp')
-rw-r--r--lib/Sema/SemaType.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp
index 3bdb3b6d2c..654bed270b 100644
--- a/lib/Sema/SemaType.cpp
+++ b/lib/Sema/SemaType.cpp
@@ -1267,6 +1267,13 @@ QualType Sema::BuildArrayType(QualType T, ArrayType::ArraySizeModifier ASM,
return QualType();
}
+ // Do placeholder conversions on the array size expression.
+ if (ArraySize && ArraySize->hasPlaceholderType()) {
+ ExprResult Result = CheckPlaceholderExpr(ArraySize);
+ if (Result.isInvalid()) return QualType();
+ ArraySize = Result.take();
+ }
+
// Do lvalue-to-rvalue conversions on the array size expression.
if (ArraySize && !ArraySize->isRValue()) {
ExprResult Result = DefaultLvalueConversion(ArraySize);