[libcxx-commits] [libcxx] r352648 - [libc++] Explicitly initialize std::nothrow

Thomas Anderson via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jan 30 11:09:41 PST 2019


Author: thomasanderson
Date: Wed Jan 30 11:09:41 2019
New Revision: 352648

URL: http://llvm.org/viewvc/llvm-project?rev=352648&view=rev
Log:
[libc++] Explicitly initialize std::nothrow

When building on Windows without libc++abi, this change fixes a build error of the form:

    src/new.cpp(38,17):  error: chosen constructor is explicit in copy-initialization
    const nothrow_t nothrow = {};
    include/vcruntime_new.h(53,22):  note: explicit constructor declared here
                explicit nothrow_t() = default;

Differential Revision: https://reviews.llvm.org/D57351

Modified:
    libcxx/trunk/src/new.cpp

Modified: libcxx/trunk/src/new.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/new.cpp?rev=352648&r1=352647&r2=352648&view=diff
==============================================================================
--- libcxx/trunk/src/new.cpp (original)
+++ libcxx/trunk/src/new.cpp Wed Jan 30 11:09:41 2019
@@ -34,7 +34,7 @@ namespace std
 {
 
 #ifndef __GLIBCXX__
-const nothrow_t nothrow = {};
+const nothrow_t nothrow{};
 #endif
 
 #ifndef LIBSTDCXX




More information about the libcxx-commits mailing list