blob: 11021a3f5bc458e12e890225db6df702521f9af7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
// PR c++/65195
// { dg-do compile { target c++14 } }
template<typename T>
T constant {};
template<typename T>
struct foo {
int operator()() const
{ return 3; }
};
template<typename T>
auto& f = constant<foo<T>>;
int main()
{
// fine
auto& ref = f<int>; ref();
// error: f<int> cannot be used as a function
f<int>();
}
|