Many thanks to Eli for reducing this great testcase.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135752
91177308-0d34-0410-b5e6-
96231b3b80d8
case Type::ConstantArray: {
const ConstantArrayType *A = cast<ConstantArrayType>(Ty);
llvm::Type *EltTy = ConvertTypeForMem(A->getElementType());
+
+ // Lower arrays of undefined struct type to arrays of i8 just to have a
+ // concrete type.
+ if (!EltTy->isSized()) {
+ SkippedLayout = true;
+ EltTy = llvm::Type::getInt8Ty(getLLVMContext());
+ }
+
ResultType = llvm::ArrayType::get(EltTy, A->getSize().getZExtValue());
break;
}
extern T x[];
T* f() { return x; }
}
+
+namespace PR10384 {
+ struct X;
+ extern X x[1];
+ X* f() { return x; }
+}