[Bug c++/29165] New: dependent name resolution finds static functions

andrew dot stubbs at st dot com gcc-bugzilla@gcc.gnu.org
Thu Sep 21 13:07:00 GMT 2006


Under the current standard, the following program should not compile:

static void f(int) {}
template <class T> void t(T t) { f(t); }
void g() { t(1); }

EDG 3.0 rejects it.

The C++ standard clause 14.6.4.2 states that function calls depending on
template parameters may only consider function declarations with external
linkage.

I have no doubt this is a bug, but I'm not sure whether anybody should bother
fixing it or not, because issue 561 may change this situation:
 http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#561


-- 
           Summary: dependent name resolution finds static functions
           Product: gcc
           Version: 4.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: andrew dot stubbs at st dot com


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



More information about the Gcc-bugs mailing list