From 5c316a6d0460054d427aca0344ca5ce0ce3ca182 Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Wed, 21 Aug 2013 02:57:19 +0000 Subject: [PATCH] LWG 2145 - mark constructor for std::error_category as inline and constexpr. Leave the (existing, out-of-line, non-constexpr) in the dylib for compatibility with existing programs) git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@188858 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/system_error | 5 +++++ src/system_error.cpp | 1 + www/cxx1y_status.html | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/system_error b/include/system_error index ac3fb4474..df668cc64 100644 --- a/include/system_error +++ b/include/system_error @@ -22,6 +22,7 @@ class error_category public: virtual ~error_category() noexcept; + constexpr error_category(); error_category(const error_category&) = delete; error_category& operator=(const error_category&) = delete; @@ -366,7 +367,11 @@ class _LIBCPP_TYPE_VIS error_category public: virtual ~error_category() _NOEXCEPT; +#ifdef _LIBCPP_BUILDING_SYSTEM_ERROR error_category() _NOEXCEPT; +#else + _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR_AFTER_CXX11 error_category() _NOEXCEPT {} +#endif private: error_category(const error_category&);// = delete; error_category& operator=(const error_category&);// = delete; diff --git a/src/system_error.cpp b/src/system_error.cpp index 7376b770e..b40409f85 100644 --- a/src/system_error.cpp +++ b/src/system_error.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +#define _LIBCPP_BUILDING_SYSTEM_ERROR #include "system_error" #include "string" #include "cstring" diff --git a/www/cxx1y_status.html b/www/cxx1y_status.html index 89f0efe28..99c803572 100644 --- a/www/cxx1y_status.html +++ b/www/cxx1y_status.html @@ -143,7 +143,7 @@ 2094duration conversion overflow shouldn't participate in overload resolutionBristol 2122merge() stability for lists versus forward listsBristol 2128Absence of global functions cbegin/cendBristol - 2145error_category default constructorBristol + 2145error_category default constructorBristolComplete 2147Unclear hint type in Allocator's allocate functionBristol 2148Hashing enums should be supported directly by std::hashBristol 2149Concerns about 20.8/5Bristol