diff --git a/llvm/tools/llvm-lto2/llvm-lto2.cpp b/llvm/tools/llvm-lto2/llvm-lto2.cpp index 2bbb65be3b31e..95cd4cf1777e5 100644 --- a/llvm/tools/llvm-lto2/llvm-lto2.cpp +++ b/llvm/tools/llvm-lto2/llvm-lto2.cpp @@ -394,8 +394,7 @@ static int run(int argc, char **argv) { // behavior. Instead, we don't exit in the multi-threaded case, but we make // sure to report the error and then at the end (after joining cleanly) // exit(1). - std::atomic HasErrors; - std::atomic_init(&HasErrors, false); + std::atomic HasErrors{false}; Conf.DiagHandler = [&](const DiagnosticInfo &DI) { DiagnosticPrinterRawOStream DP(errs()); DI.print(DP);