[Bug c++/28179] New: No diag for dflt arg on out-of-line tmpl member func def

cbowler at ca dot ibm dot com gcc-bugzilla@gcc.gnu.org
Tue Jun 27 14:47:00 GMT 2006


t.C:

template<int I>
struct S  {
  void dump(char *);
};

template<int I>
void S<I>::dump(char *m = 0) {}

void foo() { S<0> s; }
<end test>

>From the standard:

8.3.6 paragraph 6:

... "Default arguments for a member function of a class template
shall be specified on the initial declaration of the member function within the
class template."

This error is not diagnosed in any version of g++ that I've tried.  I request
that g++ implement this diagnostic to help users write standard compliant code.


-- 
           Summary: No diag for dflt arg on out-of-line tmpl member func def
           Product: gcc
           Version: 3.3.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: cbowler at ca dot ibm dot com


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



More information about the Gcc-bugs mailing list