PR c++/56973, DR 696 - capture constant variables only as needed.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp1y / auto-fn20.C
bloba516bcfb0e84cdad033b74816331c780fdc8ca1f
1 // { dg-do compile { target c++14 } }
3 template <class T>
4 auto f(T) { return 42; }
5 template <class T>
6 auto g(T) { return 0.0; }
8 int main()
10   int (*p)(int) = &f; // OK
11   p = &g; // { dg-error "no match" }