================ @@ -2471,6 +2480,23 @@ static bool CheckConstexprFunctionBody(Sema &SemaRef, const FunctionDecl *Dcl, return true; } +static bool +checkUnionConstructorIntializer(Sema &SemaRef, const FunctionDecl *Dcl, + const CXXConstructorDecl *Constructor, + const CXXRecordDecl *RD, + Sema::CheckConstexprKind Kind) { + if (Constructor->getNumCtorInitializers() == 0 && RD->hasVariantMembers()) { + if (Kind == Sema::CheckConstexprKind::Diagnose) { + SemaRef.Diag(Dcl->getLocation(), + SemaRef.getLangOpts().CPlusPlus20 + ? diag::warn_cxx17_compat_constexpr_union_ctor_no_init + : diag::ext_constexpr_union_ctor_no_init); + } else if (!SemaRef.getLangOpts().CPlusPlus20) { ---------------- shafik wrote:
I don't see what this check is doing exactly, can you explain what is being checked here? https://github.com/llvm/llvm-project/pull/81225 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits