https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108234
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- If I change func to: template <auto &V> int func(X<V>) { return 1; } And then clang accepts it. The question becomes what can be deduced as the type of V. Here is a slightly different testcase: ``` template <int&> struct X{}; template <typename T> void ff(){}; template <typename T, T V> int func(X<V>) { return 1; } int i; int main() { return func(X<i>{}); } ``` Note GCC rejects the above testcase for C++14 but accepts it for C++17. So I am not 100% this is invalid and clang just does not implement some rule of C++17 correctly dealing with reference types ...