diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2019-07-02 11:50:27 +0000 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2019-07-02 11:50:27 +0000 |
commit | e83f5f0ce8d13ca59e097ff7f5a8a8b7648a8738 (patch) | |
tree | 9e81b71ff21870788ad227c9b6432113e683ef8a /libstdc++-v3/include/bits/c++config | |
parent | d5909a92e16ddd936ed4847dda6e18c087486cc2 (diff) |
Fix preprocessor checks for Clang builtins
Clang seems to define built-ins that start with "__builtin_" as
non-keywords, which means that we need to use __has_builtin to detect
them, not __is_identifier. The built-ins that don't start with
"__builtin_" are keywords, and can only be detected using
__is_identifier and not by __has_builtin.
* include/bits/c++config (_GLIBCXX_HAVE_BUILTIN_LAUNDER)
(_GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED): Use __has_builtin
instead of __is_identifier to detect Clang support.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@272931 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/bits/c++config')
-rw-r--r-- | libstdc++-v3/include/bits/c++config | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libstdc++-v3/include/bits/c++config b/libstdc++-v3/include/bits/c++config index 746e35efbfc..c8e099aaadd 100644 --- a/libstdc++-v3/include/bits/c++config +++ b/libstdc++-v3/include/bits/c++config @@ -636,7 +636,7 @@ namespace std # if __GNUC__ >= 9 # define _GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED 1 # endif -#elif defined(__is_identifier) +#elif defined(__is_identifier) && defined(__has_builtin) // For non-GNU compilers: # if ! __is_identifier(__has_unique_object_representations) # define _GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP 1 @@ -644,10 +644,10 @@ namespace std # if ! __is_identifier(__is_aggregate) # define _GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE 1 # endif -# if ! __is_identifier(__builtin_launder) +# if __has_builtin(__builtin_launder) # define _GLIBCXX_HAVE_BUILTIN_LAUNDER 1 # endif -# if ! __is_identifier(__builtin_is_constant_evaluated) +# if __has_builtin(__builtin_is_constant_evaluated) # define _GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED 1 # endif #endif // GCC |