-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[libc++] Remove a few __has_foo defines in __config #90511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-libcxx Author: Louis Dionne (ldionne) ChangesAll the compilers we support implement those macros or builtins, so it's not useful to have a fallback to 0 when they're not implemented. Full diff: https://github.com/llvm/llvm-project/pull/90511.diff 1 Files Affected:
diff --git a/libcxx/include/__config b/libcxx/include/__config
index 97cdd020c55d1f..ed55be2eaa76a1 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -334,26 +334,6 @@ _LIBCPP_HARDENING_MODE_DEBUG
# define _LIBCPP_CXX03_LANG
# endif
-# ifndef __has_attribute
-# define __has_attribute(__x) 0
-# endif
-
-# ifndef __has_builtin
-# define __has_builtin(__x) 0
-# endif
-
-# ifndef __has_extension
-# define __has_extension(__x) 0
-# endif
-
-# ifndef __has_feature
-# define __has_feature(__x) 0
-# endif
-
-# ifndef __has_cpp_attribute
-# define __has_cpp_attribute(__x) 0
-# endif
-
# ifndef __has_constexpr_builtin
# define __has_constexpr_builtin(x) 0
# endif
@@ -375,10 +355,6 @@ _LIBCPP_HARDENING_MODE_DEBUG
# define __has_keyword(__x) !(__is_identifier(__x))
-# ifndef __has_include
-# define __has_include(...) 0
-# endif
-
# ifndef __has_warning
# define __has_warning(...) 0
# endif
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with __has_feature
and __has_extension
added (until we switch to GCC 14). Maybe add a TODO for that.
libcxx/include/__config
Outdated
# ifndef __has_extension | ||
# define __has_extension(__x) 0 | ||
# endif | ||
|
||
# ifndef __has_feature | ||
# define __has_feature(__x) 0 | ||
# endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These aren't available in GCC until 14.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with
__has_feature
and__has_extension
added (until we switch to GCC 14). Maybe add a TODO for that.
FYI GCC 14 is planned for next week. So we might be able to land this review quite soon. (Assuming there are no GCC 14 migration issues.)
LGTM!
All the compilers we support implement those macros or builtins, so it's not useful to have a fallback to 0 when they're not implemented.
7e9885a
to
66483e0
Compare
Where did you find that info? |
|
All the compilers we support implement those macros or builtins, so it's not useful to have a fallback to 0 when they're not implemented.