| 1 | // RUN: %check_clang_tidy -std=c++20 %s modernize-use-constraints %t -- -- -fno-delayed-template-parsing |
| 2 | |
| 3 | // NOLINTBEGIN |
| 4 | namespace std { |
| 5 | template <bool B, class T = void> struct enable_if { }; |
| 6 | |
| 7 | template <class T> struct enable_if<true, T> { typedef T type; }; |
| 8 | |
| 9 | template <bool B, class T = void> |
| 10 | using 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 | |
| 18 | template <typename T, typename = std::enable_if_t<T::some_value>> |
| 19 | void 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 | |