[PATCH] D42987: [libc++abi] fix compilation in C++17 mode

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 6 15:05:15 PST 2018


rsmith created this revision.
rsmith added reviewers: EricWF, mclow.lists.
Herald added a subscriber: sanjoy.

C++17 removes `std::unexpected_handler`, but libc++abi needs it to define `__cxa_exception`. When building against libc++, this is easily rectified by telling libc++ we're building the library. We already do this in the other places where we need these symbols.


Repository:
  rCXXA libc++abi

https://reviews.llvm.org/D42987

Files:
  src/cxa_exception.cpp


Index: src/cxa_exception.cpp
===================================================================
--- src/cxa_exception.cpp
+++ src/cxa_exception.cpp
@@ -11,6 +11,8 @@
 //  
 //===----------------------------------------------------------------------===//
 
+#define _LIBCPP_BUILDING_LIBRARY
+
 #include "cxxabi.h"
 
 #include <exception>        // for std::terminate


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42987.133089.patch
Type: text/x-patch
Size: 367 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180206/df9632fb/attachment.bin>


More information about the cfe-commits mailing list