From be20bb558cae5352898e6a913e29d24d20134841 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 26 Oct 2008 23:53:12 +0000 Subject: 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 --- lib/CodeGen/CGExprConstant.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/CodeGen/CGExprConstant.cpp') 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); -- cgit v1.2.3