This is an archive of the discontinued LLVM Phabricator instance.

Move _LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS macro to build system
ClosedPublic

Authored by tzik on Apr 25 2018, 6:32 AM.

Details

Summary

_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS is currently used to
bring back std::unexpected, which is removed in C++17, but still needed
for libc++abi for backward compatibility.

This macro used to define in cxa_exception.cpp only, but actually
needed for all sources that touches exceptions.
So, a build-system-level macro is better fit to define this macro.

Diff Detail

Repository
rCXXA libc++abi

Event Timeline

tzik created this revision.Apr 25 2018, 6:32 AM
tzik added a comment.Apr 25 2018, 6:39 AM

rsmith: Could you PTAL to this? This is an attempt to resolve https://bugs.llvm.org/show_bug.cgi?id=34103.
Though we already have a way to bring back std::unexpected to libc++abi, we currently don't apply it properly, IMO.

rsmith accepted this revision.Apr 27 2018, 4:12 PM

This looks right to me.

This revision is now accepted and ready to land.Apr 27 2018, 4:12 PM
tzik added a comment.Apr 29 2018, 12:11 AM

rsmith: Thanks! I don't have the commit access to the repository. Could you submit this for me?

Apologies for misspelling your last name :-(