https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97946

            Bug ID: 97946
           Summary: passing templated function without template argument
           Product: gcc
           Version: 10.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: niklas at nolte dot dev
  Target Milestone: ---

The compiler accepts the following code.
`fun` without template arguments should not be accepted, should it?
```
template<typename T = bool>
void fun() {}

template<typename F>
void higher_order_fun( const F & f) {
    f();
}

int main () {
    //higher_order_fun(fun<>); //works
    higher_order_fun(fun);
}
```

The related stackoverflow question:

https://stackoverflow.com/questions/64872397/passing-function-template-prototype-as-argument

Reply via email to