<div dir="ltr">This should have said "Patch from Taiju Tsuiki <<a href="mailto:tzik@chromium.org" target="_blank">tzik@chromium.org</a>>", apologies.</div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Apr 29, 2018 at 7:05 PM, Nico Weber via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: nico<br>
Date: Sun Apr 29 16:05:11 2018<br>
New Revision: 331150<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=331150&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=331150&view=rev</a><br>
Log:<br>
Move _LIBCPP_ENABLE_CXX17_REMOVED_<wbr>UNEXPECTED_FUNCTIONS macro to build system<br>
<br>
_LIBCPP_ENABLE_CXX17_REMOVED_<wbr>UNEXPECTED_FUNCTIONS is currently used to<br>
bring back std::unexpected, which is removed in C++17, but still needed<br>
for libc++abi for backward compatibility.<br>
<br>
This macro used to define in cxa_exception.cpp only, but actually<br>
needed for all sources that touches exceptions.<br>
So, a build-system-level macro is better fit to define this macro.<br>
<br>
<a href="https://reviews.llvm.org/D46056" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D46056</a><br>
Patch from Taiju Tsuiku <<a href="mailto:tzik@chromium.org">tzik@chromium.org</a>>!<br>
<br>
Modified:<br>
    libcxxabi/trunk/CMakeLists.txt<br>
    libcxxabi/trunk/src/cxa_<wbr>exception.cpp<br>
    libcxxabi/trunk/test/test_<wbr>exception_storage.pass.cpp<br>
<br>
Modified: libcxxabi/trunk/CMakeLists.txt<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/CMakeLists.txt?rev=331150&r1=331149&r2=331150&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/libcxxabi/trunk/<wbr>CMakeLists.txt?rev=331150&r1=<wbr>331149&r2=331150&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- libcxxabi/trunk/CMakeLists.txt (original)<br>
+++ libcxxabi/trunk/CMakeLists.txt Sun Apr 29 16:05:11 2018<br>
@@ -387,6 +387,10 @@ endif()<br>
 # Prevent libc++abi from having library dependencies on libc++<br>
 add_definitions(-D_LIBCPP_<wbr>DISABLE_EXTERN_TEMPLATE)<br>
<br>
+# Bring back `std::unexpected`, which is removed in C++17, to support<br>
+# pre-C++17.<br>
+add_definitions(-D_LIBCPP_<wbr>ENABLE_CXX17_REMOVED_<wbr>UNEXPECTED_FUNCTIONS)<br>
+<br>
 if (MSVC)<br>
   add_definitions(-D_CRT_SECURE_<wbr>NO_WARNINGS)<br>
 endif()<br>
<br>
Modified: libcxxabi/trunk/src/cxa_<wbr>exception.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/cxa_exception.cpp?rev=331150&r1=331149&r2=331150&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/libcxxabi/trunk/src/<wbr>cxa_exception.cpp?rev=331150&<wbr>r1=331149&r2=331150&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- libcxxabi/trunk/src/cxa_<wbr>exception.cpp (original)<br>
+++ libcxxabi/trunk/src/cxa_<wbr>exception.cpp Sun Apr 29 16:05:11 2018<br>
@@ -11,8 +11,6 @@<br>
 //  <br>
 //===-------------------------<wbr>------------------------------<wbr>---------------===//<br>
<br>
-#define _LIBCPP_ENABLE_CXX17_REMOVED_<wbr>UNEXPECTED_FUNCTIONS<br>
-<br>
 #include "cxxabi.h"<br>
<br>
 #include <exception>        // for std::terminate<br>
<br>
Modified: libcxxabi/trunk/test/test_<wbr>exception_storage.pass.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/test_exception_storage.pass.cpp?rev=331150&r1=331149&r2=331150&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/libcxxabi/trunk/test/<wbr>test_exception_storage.pass.<wbr>cpp?rev=331150&r1=331149&r2=<wbr>331150&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- libcxxabi/trunk/test/test_<wbr>exception_storage.pass.cpp (original)<br>
+++ libcxxabi/trunk/test/test_<wbr>exception_storage.pass.cpp Sun Apr 29 16:05:11 2018<br>
@@ -7,11 +7,6 @@<br>
 //<br>
 //===-------------------------<wbr>------------------------------<wbr>---------------===//<br>
<br>
-// FIXME: cxa_exception.hpp directly references `std::unexpected` and friends.<br>
-// This breaks this test when compiled in C++17. For now fix this by manually<br>
-// re-enabling the STL functions.<br>
-#define _LIBCPP_ENABLE_CXX17_REMOVED_<wbr>UNEXPECTED_FUNCTIONS<br>
-<br>
 #include <cstdlib><br>
 #include <algorithm><br>
 #include <iostream><br>
<br>
<br>
______________________________<wbr>_________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div>