Skip to content

Commit b27bb09

Browse files
[AST] Simplify TypeIsArrayType (NFC) (#158784)
This patch simplifies replaces TypeIsArrayType. If std::is_same<ArrayType, ArrayType> is true, then std::is_base_of<ArrayType, ArrayType> must also be true, so std::is_base_of<ArrayType, ArrayType> alone is sufficient.
1 parent 3938ce9 commit b27bb09

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

clang/include/clang/AST/TypeBase.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9092,10 +9092,7 @@ inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &PD,
90929092

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.
9095-
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>;
9095+
template <typename T> using TypeIsArrayType = std::is_base_of<ArrayType, T>;
90999096

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

0 commit comments

Comments
 (0)