Commit 5a95794c by Jonathan Wakely Committed by Jonathan Wakely

Only define __cpp_lib_constexpr_char_traits for C++17

	* include/bits/char_traits.h (__cpp_lib_constexpr_char_traits): Only
	define for C++17 and above.

From-SVN: r261634
parent 490cced4
2018-06-15 Jonathan Wakely <jwakely@redhat.com> 2018-06-15 Jonathan Wakely <jwakely@redhat.com>
* include/bits/char_traits.h (__cpp_lib_constexpr_char_traits): Only
define for C++17 and above.
LWG 2993 reference_wrapper<T> conversion from T&& LWG 2993 reference_wrapper<T> conversion from T&&
* doc/xml/manual/intro.xml: Document LWG 2993 change. * doc/xml/manual/intro.xml: Document LWG 2993 change.
* include/bits/refwrap.h (reference_wrapper(_Tp&)): Remove. * include/bits/refwrap.h (reference_wrapper(_Tp&)): Remove.
......
...@@ -143,8 +143,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -143,8 +143,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return !eq_int_type(__c, eof()) ? __c : to_int_type(char_type()); } { return !eq_int_type(__c, eof()) ? __c : to_int_type(char_type()); }
}; };
#define __cpp_lib_constexpr_char_traits 201611
template<typename _CharT> template<typename _CharT>
_GLIBCXX14_CONSTEXPR int _GLIBCXX14_CONSTEXPR int
char_traits<_CharT>:: char_traits<_CharT>::
...@@ -216,7 +214,9 @@ namespace std _GLIBCXX_VISIBILITY(default) ...@@ -216,7 +214,9 @@ namespace std _GLIBCXX_VISIBILITY(default)
{ {
_GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_BEGIN_NAMESPACE_VERSION
#if __cplusplus > 201402 #if __cplusplus >= 201703L
#define __cpp_lib_constexpr_char_traits 201611
/** /**
* @brief Determine whether the characters of a NULL-terminated * @brief Determine whether the characters of a NULL-terminated
* string are known at compile time. * string are known at compile time.
...@@ -299,7 +299,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -299,7 +299,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
static _GLIBCXX17_CONSTEXPR int static _GLIBCXX17_CONSTEXPR int
compare(const char_type* __s1, const char_type* __s2, size_t __n) compare(const char_type* __s1, const char_type* __s2, size_t __n)
{ {
#if __cplusplus > 201402 #if __cplusplus >= 201703L
if (__builtin_constant_p(__n) if (__builtin_constant_p(__n)
&& __constant_char_array_p(__s1, __n) && __constant_char_array_p(__s1, __n)
&& __constant_char_array_p(__s2, __n)) && __constant_char_array_p(__s2, __n))
...@@ -313,7 +313,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -313,7 +313,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
static _GLIBCXX17_CONSTEXPR size_t static _GLIBCXX17_CONSTEXPR size_t
length(const char_type* __s) length(const char_type* __s)
{ {
#if __cplusplus > 201402 #if __cplusplus >= 201703L
if (__constant_string_p(__s)) if (__constant_string_p(__s))
return __gnu_cxx::char_traits<char_type>::length(__s); return __gnu_cxx::char_traits<char_type>::length(__s);
#endif #endif
...@@ -323,7 +323,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -323,7 +323,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
static _GLIBCXX17_CONSTEXPR const char_type* static _GLIBCXX17_CONSTEXPR const char_type*
find(const char_type* __s, size_t __n, const char_type& __a) find(const char_type* __s, size_t __n, const char_type& __a)
{ {
#if __cplusplus > 201402 #if __cplusplus >= 201703L
if (__builtin_constant_p(__n) if (__builtin_constant_p(__n)
&& __builtin_constant_p(__a) && __builtin_constant_p(__a)
&& __constant_char_array_p(__s, __n)) && __constant_char_array_p(__s, __n))
...@@ -408,7 +408,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -408,7 +408,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
static _GLIBCXX17_CONSTEXPR int static _GLIBCXX17_CONSTEXPR int
compare(const char_type* __s1, const char_type* __s2, size_t __n) compare(const char_type* __s1, const char_type* __s2, size_t __n)
{ {
#if __cplusplus > 201402 #if __cplusplus >= 201703L
if (__builtin_constant_p(__n) if (__builtin_constant_p(__n)
&& __constant_char_array_p(__s1, __n) && __constant_char_array_p(__s1, __n)
&& __constant_char_array_p(__s2, __n)) && __constant_char_array_p(__s2, __n))
...@@ -423,7 +423,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -423,7 +423,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
static _GLIBCXX17_CONSTEXPR size_t static _GLIBCXX17_CONSTEXPR size_t
length(const char_type* __s) length(const char_type* __s)
{ {
#if __cplusplus > 201402 #if __cplusplus >= 201703L
if (__constant_string_p(__s)) if (__constant_string_p(__s))
return __gnu_cxx::char_traits<char_type>::length(__s); return __gnu_cxx::char_traits<char_type>::length(__s);
else else
...@@ -434,7 +434,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -434,7 +434,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
static _GLIBCXX17_CONSTEXPR const char_type* static _GLIBCXX17_CONSTEXPR const char_type*
find(const char_type* __s, size_t __n, const char_type& __a) find(const char_type* __s, size_t __n, const char_type& __a)
{ {
#if __cplusplus > 201402 #if __cplusplus >= 201703L
if (__builtin_constant_p(__n) if (__builtin_constant_p(__n)
&& __builtin_constant_p(__a) && __builtin_constant_p(__a)
&& __constant_char_array_p(__s, __n)) && __constant_char_array_p(__s, __n))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment