Index: lib/CodeGen/CGExprConstant.cpp =================================================================== --- lib/CodeGen/CGExprConstant.cpp +++ lib/CodeGen/CGExprConstant.cpp @@ -650,6 +650,8 @@ } if (NonzeroLength == 0) { + if (DestType == nullptr) + return nullptr; return llvm::ConstantAggregateZero::get( CGM.getTypes().ConvertType(QualType(DestType, 0))); } Index: test/CodeGenCXX/empty-struct-init-list.cpp =================================================================== --- /dev/null +++ test/CodeGenCXX/empty-struct-init-list.cpp @@ -0,0 +1,11 @@ +// RUN: %clang_cc1 -std=c++11 %s +// RUN: %clang_cc1 -std=c++14 %s +// RUN: %clang_cc1 -std=c++17 %s +// expected-no-diagnostics + +typedef struct { } a; + +typedef struct { + a b[]; +} c; +c d{ };