Can template args be member fn calls of fn params?

Is the Following Syntax Valid?

The following syntax:

#include <type_traits>

template<class T>
auto f(T x) -> std::enable_if_t<x.size() == 4>;

is valid for Clang and MSVC but invalid according to GCC. See this Godbolt link to compare the results between compilers.

No, the following syntax is not valid for all compilers. It is valid for Clang and MSVC, but invalid for GCC.