[libcxx] r280754 - Try 2 - Remove <cstdlib> include from `<exception>`

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 6 14:25:28 PDT 2016


Author: ericwf
Date: Tue Sep  6 16:25:27 2016
New Revision: 280754

URL: http://llvm.org/viewvc/llvm-project?rev=280754&view=rev
Log:
Try 2 - Remove <cstdlib> include from `<exception>`

This patch removes the `<cstdlib>` include from exception where it is no longer
needed. Unlike my previous attempt this patch also adds <cstdlib> where needed
in other headers like <new> and <typeinfo>.

This won't fix the Firefox build issues discussed on IRC but it is more correct
for libc++.

Modified:
    libcxx/trunk/include/exception
    libcxx/trunk/include/new
    libcxx/trunk/include/stdexcept
    libcxx/trunk/include/typeinfo

Modified: libcxx/trunk/include/exception
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/exception?rev=280754&r1=280753&r2=280754&view=diff
==============================================================================
--- libcxx/trunk/include/exception (original)
+++ libcxx/trunk/include/exception Tue Sep  6 16:25:27 2016
@@ -80,10 +80,6 @@ template <class E> void rethrow_if_neste
 #include <__config>
 #include <cstddef>
 #include <type_traits>
-#if defined(_LIBCPP_NO_EXCEPTIONS)
-#include <cstdio>
-#include <cstdlib>
-#endif
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header

Modified: libcxx/trunk/include/new
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/new?rev=280754&r1=280753&r2=280754&view=diff
==============================================================================
--- libcxx/trunk/include/new (original)
+++ libcxx/trunk/include/new Tue Sep  6 16:25:27 2016
@@ -69,6 +69,9 @@ void  operator delete[](void* ptr, void*
 #include <__config>
 #include <exception>
 #include <cstddef>
+#ifdef _LIBCPP_NO_EXCEPTIONS
+#include <cstdlib>
+#endif
 
 #include <__undef___deallocate>
 

Modified: libcxx/trunk/include/stdexcept
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/stdexcept?rev=280754&r1=280753&r2=280754&view=diff
==============================================================================
--- libcxx/trunk/include/stdexcept (original)
+++ libcxx/trunk/include/stdexcept Tue Sep  6 16:25:27 2016
@@ -45,6 +45,9 @@ public:
 #include <__config>
 #include <exception>
 #include <iosfwd>  // for string forward decl
+#ifdef _LIBCPP_NO_EXCEPTIONS
+#include <cstdlib>
+#endif
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header

Modified: libcxx/trunk/include/typeinfo
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/typeinfo?rev=280754&r1=280753&r2=280754&view=diff
==============================================================================
--- libcxx/trunk/include/typeinfo (original)
+++ libcxx/trunk/include/typeinfo Tue Sep  6 16:25:27 2016
@@ -61,6 +61,9 @@ public:
 #include <exception>
 #include <cstddef>
 #include <cstdint>
+#ifdef _LIBCPP_NO_EXCEPTIONS
+#include <cstdlib>
+#endif
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header




More information about the cfe-commits mailing list