From 1d75c59ace2c9fc4e9a94907748d9555cd4a7d14 Mon Sep 17 00:00:00 2001 From: Eric Date: Wed, 5 Jun 2024 18:29:46 -0400 Subject: [PATCH] Fix detection of __datasizeof with Clang. (#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 --- libcxx/include/__type_traits/datasizeof.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcxx/include/__type_traits/datasizeof.h b/libcxx/include/__type_traits/datasizeof.h index 54fde242ebcd..35c12921e8ff 100644 --- a/libcxx/include/__type_traits/datasizeof.h +++ b/libcxx/include/__type_traits/datasizeof.h @@ -26,7 +26,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD -#if __has_extension(datasizeof) +#if __has_keyword(__datasizeof) || __has_extension(datasizeof) template inline const size_t __datasizeof_v = __datasizeof(_Tp); #else