PR c++/56973, DR 696 - capture constant variables only as needed.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp1y / auto-fn10.C
blob8e08911465db66023a51a5ba2ce1aa58aeea3c61
1 // A template declared with auto should be declared with auto in an
2 // explicit instantiation or explicit specialization, too.
3 // { dg-do compile { target c++14 } }
5 template <class T>
6 auto f(T t) { return t; }
8 template<> auto f<int>(int);
9 template auto f<float>(float);
10 template<> auto f(int*);
11 template auto f(float*);
13 template<> short f<short>(short); // { dg-error "does not match" }
14 template char f<char>(char);      // { dg-error "does not match" }
15 template<> short f(short*);       // { dg-error "does not match" }
16 template char f(char*);           // { dg-error "does not match" }