Skip to content

Commit 3ad0d63

Browse files
[AST] Use std::bool_constant instead of std::integral_constant (NFC)
This patch replaces, std::integral_constant<bool, ...> 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.
1 parent c8b5b6e commit 3ad0d63

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

clang/include/clang/AST/TypeBase.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9093,9 +9093,8 @@ inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &PD,
90939093
// Helper class template that is used by Type::getAs to ensure that one does
90949094
// not try to look through a qualified type to get to an array type.
90959095
template <typename T>
9096-
using TypeIsArrayType =
9097-
std::integral_constant<bool, std::is_same<T, ArrayType>::value ||
9098-
std::is_base_of<ArrayType, T>::value>;
9096+
using TypeIsArrayType = std::bool_constant<std::is_same_v<T, ArrayType> ||
9097+
std::is_base_of_v<ArrayType, T>>;
90999098

91009099
// Member-template getAs<specific type>'.
91019100
template <typename T> const T *Type::getAs() const {

0 commit comments

Comments
 (0)