(root)/
gcc-13.2.0/
gcc/
testsuite/
g++.dg/
cpp1y/
var-templ37.C
// 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>();
}