Skip to content

Commit 1d75c59

Browse files
authored
Fix detection of __datasizeof with Clang. (llvm#94174)
The `__has_extension` builtin macro is the same as __has_feature when -pedantic-errors is specified, which means we don't get the right information about __datasizeof being available. Using __has_keyword (really !__is_identifier) will tell the truth even when -pedantic-errors is specified. This means we always have __datasizeof under Clang
1 parent 55d2fff commit 1d75c59

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libcxx/include/__type_traits/datasizeof.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
_LIBCPP_BEGIN_NAMESPACE_STD
2828

29-
#if __has_extension(datasizeof)
29+
#if __has_keyword(__datasizeof) || __has_extension(datasizeof)
3030
template <class _Tp>
3131
inline const size_t __datasizeof_v = __datasizeof(_Tp);
3232
#else

0 commit comments

Comments
 (0)