When asked to compile the following code:

  template <typename> void f();
  void g() { f<int>; }

G++ opines:

  "error: statement cannot resolve address of overloaded function"

However, f is not overloaded. (The standard says: "When two or more different
declarations are specified for a single name in the same scope, that name is
said to be overloaded.")

PS. As for the validity of the code: while I personally really wouldn't know
whether it is valid, I should for completeness at least mention that it is
accepted by Comeau.


-- 
           Summary: Diagnostic mistakenly characterizes function as being
                    overloaded
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: gcc-bugzilla at contacts dot eelis dot net


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

Reply via email to