This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/28179] New: No diag for dflt arg on out-of-line tmpl member func def
- From: "cbowler at ca dot ibm dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Jun 2006 14:40:14 -0000
- Subject: [Bug c++/28179] New: No diag for dflt arg on out-of-line tmpl member func def
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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