This is the mail archive of the
mailing list for the GCC project.
c++/7863: Member function template argument deduction broken by declaration of name in different scope
- From: timb at bluearc dot com
- To: gcc-gnats at gcc dot gnu dot org
- Date: 9 Sep 2002 13:33:30 -0000
- Subject: c++/7863: Member function template argument deduction broken by declaration of name in different scope
- Reply-to: timb at bluearc dot com
>Synopsis: Member function template argument deduction broken by declaration of name in different scope
>Arrival-Date: Mon Sep 09 06:36:02 PDT 2002
Debian GNU/Linux x86 unstable
Attempting to compile the code below gets the error message "no matching function for call to `A::Foo(int&)'" even though A::Foo<int> would clearly match. Strangely, the problem goes away if the declaration of struct X::Foo is removed, or if the return type of A::Foo<> is changed so it does not involve the template parameter.
template<class T> static T& Foo(T p);