/cp
[official-gcc.git] / gcc / testsuite / g++.dg / cpp1y / var-templ37.C
blob11021a3f5bc458e12e890225db6df702521f9af7
1 // PR c++/65195
2 // { dg-do compile { target c++14 } }
4 template<typename T>
5 T constant {};
7 template<typename T>
8 struct foo {
9     int operator()() const
10     { return 3; }
13 template<typename T>
14 auto& f = constant<foo<T>>;
16 int main()
18     // fine
19     auto& ref = f<int>; ref();
21     // error: f<int> cannot be used as a function
22     f<int>();