This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Explicitly initialize std::nothrow
ClosedPublic

Authored by thomasanderson on Jan 28 2019, 12:45 PM.

Details

Summary

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;

Diff Detail

Repository
rCXX libc++

Event Timeline

thomasanderson edited the summary of this revision. (Show Details)Jan 28 2019, 3:24 PM
EricWF added inline comments.Jan 28 2019, 9:48 PM
src/new.cpp
37

What about const nothrow_t nothrow{}; instead? That way we can leave the copy constructor out of it.

thomasanderson marked an inline comment as done.
This revision was not accepted when it landed; it landed in state Needs Review.Jan 30 2019, 11:09 AM
This revision was automatically updated to reflect the committed changes.