diff --git a/clang/include/clang/ASTMatchers/ASTMatchersInternal.h b/clang/include/clang/ASTMatchers/ASTMatchersInternal.h index 8290645768aa9..71dfc49b7fcca 100644 --- a/clang/include/clang/ASTMatchers/ASTMatchersInternal.h +++ b/clang/include/clang/ASTMatchers/ASTMatchersInternal.h @@ -871,14 +871,11 @@ IteratorT matchesFirstInPointerRange(const MatcherT &Matcher, IteratorT Start, return End; } -template ::value> - * = nullptr> -inline bool isDefaultedHelper(const T *) { +template inline bool isDefaultedHelper(const T *FD) { + if constexpr (std::is_base_of_v) + return FD->isDefaulted(); return false; } -inline bool isDefaultedHelper(const FunctionDecl *FD) { - return FD->isDefaulted(); -} // Metafunction to determine if type T has a member called getDecl. template