This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/43506] New: name lookup fails in function template


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]