aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExprConstant.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/CGExprConstant.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/CGExprConstant.cpp')
-rw-r--r--lib/CodeGen/CGExprConstant.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/CodeGen/CGExprConstant.cpp b/lib/CodeGen/CGExprConstant.cpp
index 5fc513d125..89b34e611b 100644
--- a/lib/CodeGen/CGExprConstant.cpp
+++ b/lib/CodeGen/CGExprConstant.cpp
@@ -315,6 +315,12 @@ public:
const llvm::Type* RetTy = CGM.getTypes().ConvertType(ILE->getType());
return llvm::Constant::getNullValue(RetTy);
}
+
+ // FIXME: We don't codegen or sema designators yet.
+ if (ILE->hadDesignators()) {
+ CGM.ErrorUnsupported(ILE, "initializer list with designators");
+ return llvm::UndefValue::get(ConvertType(ILE->getType()));
+ }
if (ILE->getType()->isArrayType())
return EmitArrayInitialization(ILE);