aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExprAgg.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-10-26 23:53:12 +0000
committerChris Lattner <sabre@nondot.org>2008-10-26 23:53:12 +0000
commitbe20bb558cae5352898e6a913e29d24d20134841 (patch)
treef7ce216cb48ca1448bbcaa32102bad4e8ac76511 /lib/CodeGen/CGExprAgg.cpp
parent418f6c7d142e5ff4607f70cd8431d008442bafe9 (diff)
make codegen reject initializes with designators, like this:
t.c:1:13: error: cannot codegen this designators yet int a[10] = {2, 4, [8]=9, 10}; ^~~~~~~~~~~~~~~~~ git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58220 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprAgg.cpp')
-rw-r--r--lib/CodeGen/CGExprAgg.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/CodeGen/CGExprAgg.cpp b/lib/CodeGen/CGExprAgg.cpp
index 9041c17671..e81a64ffa5 100644
--- a/lib/CodeGen/CGExprAgg.cpp
+++ b/lib/CodeGen/CGExprAgg.cpp
@@ -263,7 +263,11 @@ void AggExprEmitter::VisitVAArgExpr(VAArgExpr *VE) {
}
void AggExprEmitter::EmitNonConstInit(InitListExpr *E) {
-
+ if (E->hadDesignators()) {
+ CGF.ErrorUnsupported(E, "initializer list with designators");
+ return;
+ }
+
const llvm::PointerType *APType =
cast<llvm::PointerType>(DestPtr->getType());
const llvm::Type *DestType = APType->getElementType();
@@ -334,6 +338,11 @@ void AggExprEmitter::EmitNullInitializationToLValue(LValue LV, QualType T) {
}
void AggExprEmitter::VisitInitListExpr(InitListExpr *E) {
+ if (E->hadDesignators()) {
+ CGF.ErrorUnsupported(E, "initializer list with designators");
+ return;
+ }
+
// FIXME: For constant expressions, call into const expr emitter so
// that we can emit a memcpy instead of storing the individual
// members. This is purely for perf; both codepaths lead to