From 3ad0d63a8d7990cc3536ac11ed0d112f123545a0 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Mon, 15 Sep 2025 09:09:05 -0700 Subject: [PATCH 1/2] [AST] Use std::bool_constant instead of std::integral_constant (NFC) This patch replaces, std::integral_constant with std::bool_constant for brevity. Note that std::bool_constant was introduced as part of C++17. While I am at it, this patch uses the "_v" variants of type traits. --- clang/include/clang/AST/TypeBase.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/clang/include/clang/AST/TypeBase.h b/clang/include/clang/AST/TypeBase.h index 9074992a3de8c..3725cd98394fb 100644 --- a/clang/include/clang/AST/TypeBase.h +++ b/clang/include/clang/AST/TypeBase.h @@ -9093,9 +9093,8 @@ inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &PD, // Helper class template that is used by Type::getAs to ensure that one does // not try to look through a qualified type to get to an array type. template -using TypeIsArrayType = - std::integral_constant::value || - std::is_base_of::value>; +using TypeIsArrayType = std::bool_constant || + std::is_base_of_v>; // Member-template getAs'. template const T *Type::getAs() const { From 07dfa5b5ca849d967b94bee998184003d034a8a1 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Mon, 15 Sep 2025 23:19:29 -0700 Subject: [PATCH 2/2] Address a comment. --- clang/include/clang/AST/TypeBase.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/clang/include/clang/AST/TypeBase.h b/clang/include/clang/AST/TypeBase.h index 3725cd98394fb..b02d9c7499fe5 100644 --- a/clang/include/clang/AST/TypeBase.h +++ b/clang/include/clang/AST/TypeBase.h @@ -9092,9 +9092,7 @@ inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &PD, // Helper class template that is used by Type::getAs to ensure that one does // not try to look through a qualified type to get to an array type. -template -using TypeIsArrayType = std::bool_constant || - std::is_base_of_v>; +template using TypeIsArrayType = std::is_base_of; // Member-template getAs'. template const T *Type::getAs() const {