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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2006-01-15 21:09:27         |2018-4-23

--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Reduced to remove the irrelevant parts and demonstrate the difference between
calls to non-template and temploid functions:

template<typename T> void Func( T ) { }

typedef bool (*op_func)( int );

void Exec( op_func ) { }

template<typename T>
struct Op
{
  static void Exec( op_func ) { }
};

int main( )
{
  Exec( &Func<int> );
  Op<int>::Exec( &Func<int> );
}

t.cc:17:20: error: no matches converting function 'Func' to type 'op_func' {aka
'bool (*)(int)'}
   Exec( &Func<int> );
                    ^
t.cc:1:27: note: candidate is: 'template<class T> void Func(T)'
 template<typename T> void Func( T ) { }
                           ^~~~
t.cc:18:29: error: no matching function for call to 'Op<int>::Exec(<unresolved
overloaded function type>)'
   Op<int>::Exec( &Func<int> );
                             ^
t.cc:10:15: note: candidate: 'static void Op<T>::Exec(op_func) [with T = int;
op_func = bool (*)(int)]'
   static void Exec( op_func ) { }
               ^~~~
t.cc:10:15: note:   no known conversion for argument 1 from '<unresolved
overloaded function type>' to 'op_func' {aka 'bool (*)(int)'}

Reply via email to