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
This commit is contained in:
parent
490cced415
commit
5a95794c58
|
@ -1,5 +1,8 @@
|
|||
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&&
|
||||
* doc/xml/manual/intro.xml: Document LWG 2993 change.
|
||||
* include/bits/refwrap.h (reference_wrapper(_Tp&)): Remove.
|
||||
|
|
|
@ -143,8 +143,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
|||
{ return !eq_int_type(__c, eof()) ? __c : to_int_type(char_type()); }
|
||||
};
|
||||
|
||||
#define __cpp_lib_constexpr_char_traits 201611
|
||||
|
||||
template<typename _CharT>
|
||||
_GLIBCXX14_CONSTEXPR int
|
||||
char_traits<_CharT>::
|
||||
|
@ -216,7 +214,9 @@ namespace std _GLIBCXX_VISIBILITY(default)
|
|||
{
|
||||
_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
|
||||
* string are known at compile time.
|
||||
|
@ -299,7 +299,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
|||
static _GLIBCXX17_CONSTEXPR int
|
||||
compare(const char_type* __s1, const char_type* __s2, size_t __n)
|
||||
{
|
||||
#if __cplusplus > 201402
|
||||
#if __cplusplus >= 201703L
|
||||
if (__builtin_constant_p(__n)
|
||||
&& __constant_char_array_p(__s1, __n)
|
||||
&& __constant_char_array_p(__s2, __n))
|
||||
|
@ -313,7 +313,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
|||
static _GLIBCXX17_CONSTEXPR size_t
|
||||
length(const char_type* __s)
|
||||
{
|
||||
#if __cplusplus > 201402
|
||||
#if __cplusplus >= 201703L
|
||||
if (__constant_string_p(__s))
|
||||
return __gnu_cxx::char_traits<char_type>::length(__s);
|
||||
#endif
|
||||
|
@ -323,7 +323,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
|||
static _GLIBCXX17_CONSTEXPR const char_type*
|
||||
find(const char_type* __s, size_t __n, const char_type& __a)
|
||||
{
|
||||
#if __cplusplus > 201402
|
||||
#if __cplusplus >= 201703L
|
||||
if (__builtin_constant_p(__n)
|
||||
&& __builtin_constant_p(__a)
|
||||
&& __constant_char_array_p(__s, __n))
|
||||
|
@ -408,7 +408,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
|||
static _GLIBCXX17_CONSTEXPR int
|
||||
compare(const char_type* __s1, const char_type* __s2, size_t __n)
|
||||
{
|
||||
#if __cplusplus > 201402
|
||||
#if __cplusplus >= 201703L
|
||||
if (__builtin_constant_p(__n)
|
||||
&& __constant_char_array_p(__s1, __n)
|
||||
&& __constant_char_array_p(__s2, __n))
|
||||
|
@ -423,7 +423,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
|||
static _GLIBCXX17_CONSTEXPR size_t
|
||||
length(const char_type* __s)
|
||||
{
|
||||
#if __cplusplus > 201402
|
||||
#if __cplusplus >= 201703L
|
||||
if (__constant_string_p(__s))
|
||||
return __gnu_cxx::char_traits<char_type>::length(__s);
|
||||
else
|
||||
|
@ -434,7 +434,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
|||
static _GLIBCXX17_CONSTEXPR const char_type*
|
||||
find(const char_type* __s, size_t __n, const char_type& __a)
|
||||
{
|
||||
#if __cplusplus > 201402
|
||||
#if __cplusplus >= 201703L
|
||||
if (__builtin_constant_p(__n)
|
||||
&& __builtin_constant_p(__a)
|
||||
&& __constant_char_array_p(__s, __n))
|
||||
|
|
Loading…
Reference in New Issue