Commit afa56c17 by Jonathan Wakely Committed by Jonathan Wakely

PR libstdc++/80446 cope with libc defining __has_builtin

	PR libstdc++/80446
	* include/std/type_traits (is_aggregate): Change __has_builtin checks.
	* libsupc++/new (launder): Likewise.

From-SVN: r246992
parent fd1ca3fe
2017-04-19 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/80446
* include/std/type_traits (is_aggregate): Change __has_builtin checks.
* libsupc++/new (launder): Likewise.
2017-04-18 Jonathan Wakely <jwakely@redhat.com> 2017-04-18 Jonathan Wakely <jwakely@redhat.com>
* include/std/functional (default_searcher, __boyer_moore_array_base) * include/std/functional (default_searcher, __boyer_moore_array_base)
......
...@@ -3062,14 +3062,16 @@ template <typename _From, typename _To> ...@@ -3062,14 +3062,16 @@ template <typename _From, typename _To>
#endif #endif
#undef _GLIBCXX_NO_BUILTIN_HAS_UNIQ_OBJ_REP #undef _GLIBCXX_NO_BUILTIN_HAS_UNIQ_OBJ_REP
#ifdef __has_builtin #if __GNUC__ >= 7
# if !__has_builtin(__is_aggregate) # define _GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE 1
// Try not to break non-GNU compilers that don't support the built-in: #elif defined __has_builtin
# define _GLIBCXX_NO_BUILTIN_IS_AGGREGATE 1 // For non-GNU compilers:
# if __has_builtin(__is_aggregate)
# define _GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE 1
# endif # endif
#endif #endif
#ifndef _GLIBCXX_NO_BUILTIN_IS_AGGREGATE #ifdef _GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE
#define __cpp_lib_is_aggregate 201703 #define __cpp_lib_is_aggregate 201703
/// is_aggregate /// is_aggregate
template<typename _Tp> template<typename _Tp>
...@@ -3080,7 +3082,7 @@ template <typename _From, typename _To> ...@@ -3080,7 +3082,7 @@ template <typename _From, typename _To>
template<typename _Tp> template<typename _Tp>
inline constexpr bool is_aggregate_v = is_aggregate<_Tp>::value; inline constexpr bool is_aggregate_v = is_aggregate<_Tp>::value;
#endif #endif
#undef _GLIBCXX_NO_BUILTIN_IS_AGGREGATE #undef _GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE
#endif // C++17 #endif // C++17
......
...@@ -177,14 +177,16 @@ inline void operator delete[](void*, void*) _GLIBCXX_USE_NOEXCEPT { } ...@@ -177,14 +177,16 @@ inline void operator delete[](void*, void*) _GLIBCXX_USE_NOEXCEPT { }
} // extern "C++" } // extern "C++"
#if __cplusplus > 201402L #if __cplusplus > 201402L
#ifdef __has_builtin #if __GNUC__ >= 7
# if !__has_builtin(__builtin_launder) # define _GLIBCXX_HAVE_BUILTIN_LAUNDER 1
// Try not to break non-GNU compilers that don't support the built-in: #elif defined __has_builtin
# define _GLIBCXX_NO_BUILTIN_LAUNDER 1 // For non-GNU compilers:
# if __has_builtin(__builtin_launder)
# define _GLIBCXX_HAVE_BUILTIN_LAUNDER 1
# endif # endif
#endif #endif
#ifndef _GLIBCXX_NO_BUILTIN_LAUNDER #ifdef _GLIBCXX_HAVE_BUILTIN_LAUNDER
namespace std namespace std
{ {
#define __cpp_lib_launder 201606 #define __cpp_lib_launder 201606
...@@ -208,7 +210,7 @@ namespace std ...@@ -208,7 +210,7 @@ namespace std
void launder(const volatile void*) = delete; void launder(const volatile void*) = delete;
} }
#endif // _GLIBCXX_NO_BUILTIN_LAUNDER #endif // _GLIBCXX_NO_BUILTIN_LAUNDER
#undef _GLIBCXX_NO_BUILTIN_LAUNDER #undef _GLIBCXX_HAVE_BUILTIN_LAUNDER
#endif // C++17 #endif // C++17
#pragma GCC visibility pop #pragma GCC visibility pop
......
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