diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp index 67bc847ff2a60e..023411c7edc946 100644 --- a/clang/lib/Sema/SemaExprCXX.cpp +++ b/clang/lib/Sema/SemaExprCXX.cpp @@ -2443,6 +2443,11 @@ ExprResult Sema::BuildCXXNew(SourceRange Range, bool UseGlobal, FullInit = Binder->getSubExpr(); Initializer = FullInit.get(); + // We don't know that we're generating an implicit initializer until now, so + // we have to update the initialization style as well. + // + // FIXME: it would be nice to determine the correct initialization style + // earlier so InitStyle doesn't need adjusting. if (InitStyle == CXXNewInitializationStyle::None && Initializer) { InitStyle = CXXNewInitializationStyle::Implicit; }