[clang] [clang-tools-extra] [Clang] [Sema] Diagnose unknown std::initializer_list layout in SemaInit (PR #95580)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Jun 19 05:39:08 PDT 2024
================
@@ -9392,6 +9392,57 @@ ExprResult InitializationSequence::Perform(Sema &S,
// Wrap it in a construction of a std::initializer_list<T>.
CurInit = new (S.Context) CXXStdInitializerListExpr(Step->Type, MTE);
+ if (!Step->Type->isDependentType()) {
+ assert(S.isCompleteType(CurInit.get()->getExprLoc(), Step->Type,
+ Sema::CompleteTypeKind::Normal) &&
+ "std::initializer_list<E> incomplete when used during "
+ "initialization");
----------------
Sirraide wrote:
Not too familiar with SemaInit, but I’m assuming this condition is already diagnosed elsewhere?
https://github.com/llvm/llvm-project/pull/95580
More information about the cfe-commits
mailing list