This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/19625] New: GCC accepts a default value for the first argument of a template function
- From: "Matthieu dot Moy at imag dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Jan 2005 16:21:17 -0000
- Subject: [Bug c++/19625] New: GCC accepts a default value for the first argument of a template function
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following code compiles, and should not :
template<class T>
T f2(const char * s2, T arg2, T arg3);
template<class T>
T f2(const char * s2 = 0, // bug
T arg2, T arg3) {
return (s2)?arg2:arg3;
}
Same for the following :
template<class T>
class foo {
T f2(const char * s2, T arg2, T arg3);
};
template<class T>
T foo<T>::f2(const char * s2 = 0, // bug
T arg2, T arg3) {
return (s2)?arg2:arg3;
}
Or for the even simpler
template<class T>
class foo {
T f2(const char * s2 = 0, T arg2, T arg3); // bug
};
--
Summary: GCC accepts a default value for the first argument of a
template function
Product: gcc
Version: 3.4.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: Matthieu dot Moy at imag dot fr
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19625