From 3a37da1799bc19ee7ec6c0396e35218c3d00766f Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Fri, 19 Sep 2025 18:58:37 -0700 Subject: [PATCH] [ADT] Simplify enable_if_struct_deref_supported (NFC) This patch simplifies enable_if_struct_deref_supported by using a default template parameter as a temporary type alias. This way, we do not have to repeat decltype(...). --- llvm/include/llvm/ADT/fallible_iterator.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/llvm/include/llvm/ADT/fallible_iterator.h b/llvm/include/llvm/ADT/fallible_iterator.h index b42f62b67fd66..76fa054f2eb94 100644 --- a/llvm/include/llvm/ADT/fallible_iterator.h +++ b/llvm/include/llvm/ADT/fallible_iterator.h @@ -67,10 +67,9 @@ namespace llvm { /// without requiring redundant error checks. template class fallible_iterator { private: - template - using enable_if_struct_deref_supported = std::enable_if_t< - !std::is_void().operator->())>::value, - decltype(std::declval().operator->())>; + template ().operator->())> + using enable_if_struct_deref_supported = + std::enable_if_t, U>; public: /// Construct a fallible iterator that *cannot* be used as an end-of-range