1// RUN: %check_clang_tidy -std=c++20 %s modernize-use-constraints %t -- -- -fno-delayed-template-parsing
2
3// NOLINTBEGIN
4namespace std {
5template <bool B, class T = void> struct enable_if { };
6
7template <class T> struct enable_if<true, T> { typedef T type; };
8
9template <bool B, class T = void>
10using enable_if_t = typename enable_if<B, T>::type;
11
12} // namespace std
13// NOLINTEND
14
15// Separate test file for the case where the first '>>' token part of
16// an enable_if expression correctly handles the synthesized token.
17
18template <typename T, typename = std::enable_if_t<T::some_value>>
19void first_greatergreater_is_enable_if() {
20}
21// CHECK-MESSAGES: :[[@LINE-3]]:23: warning: use C++20 requires constraints instead of enable_if [modernize-use-constraints]
22// CHECK-FIXES: {{^}}void first_greatergreater_is_enable_if() requires T::some_value {{{$}}
23

source code of clang-tools-extra/test/clang-tidy/checkers/modernize/use-constraints-first-greatergreater.cpp