================ @@ -2034,18 +2035,19 @@ ExprResult Sema::BuildCXXNew(SourceRange Range, bool UseGlobal, // - If the new-initializer is omitted, the object is default- // initialized (8.5); if no initialization is performed, // the object has indeterminate value - = initStyle == CXXNewExpr::NoInit + = initStyle == CXXNewInitializationStyle::None || + initStyle == CXXNewInitializationStyle::Implicit ? InitializationKind::CreateDefault(TypeRange.getBegin()) - // - Otherwise, the new-initializer is interpreted according to - // the - // initialization rules of 8.5 for direct-initialization. - : initStyle == CXXNewExpr::ListInit - ? InitializationKind::CreateDirectList( - TypeRange.getBegin(), Initializer->getBeginLoc(), - Initializer->getEndLoc()) - : InitializationKind::CreateDirect(TypeRange.getBegin(), - DirectInitRange.getBegin(), - DirectInitRange.getEnd()); + // - Otherwise, the new-initializer is interpreted according to + // the + // initialization rules of 8.5 for direct-initialization. + : initStyle == CXXNewInitializationStyle::List + ? InitializationKind::CreateDirectList(TypeRange.getBegin(), + Initializer->getBeginLoc(), + Initializer->getEndLoc()) + : InitializationKind::CreateDirect(TypeRange.getBegin(), + DirectInitRange.getBegin(), + DirectInitRange.getEnd()); ---------------- AaronBallman wrote:
Convert this to a `switch` so it's easier to read? https://github.com/llvm/llvm-project/pull/71322 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits