aa.cpp:
template<class T> void f(int x, T t)
{
        f(t);
}

void f(int);

void h()
{
        f(1,2); 
}

when compiled with g++ aa.cpp -c, it shows:

aa.cpp: In function 'void f(int, T) [with T = int]':
aa.cpp:10:   instantiated from here
aa.cpp:3: error: no matching function for call to 'f(int&)'

once the template instantiated from aa.cpp:10 the function void f(int f) should
has already been declared....


-- 
           Summary: name lookup fails in function template
           Product: gcc
           Version: 4.4.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: yao_yin at 163 dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43506

Reply via email to