[Bug c++/30344] New: template type argument cannot be initialized by a default parameter
Bernd dot Donner at gmx dot net
gcc-bugzilla@gcc.gnu.org
Mon Jan 1 18:56:00 GMT 2007
The following code sample is compiled by several other compilers. Gcc compiles
the following example, when the function f is put into the global scope.
The example can also be compiled, when v has only a single template parameter.
template <class T1, class T2>
class v { };
class c2 {
void f(const v<int, int> &t = v<int, int>()) { }
};
int main() { }
The code cannot be compiled by gcc 3.4, 4.1.2 and 4.2
In the example it is of course essential that t is a _constant_ reference.
Bernd Donner
--
Summary: template type argument cannot be initialized by a
default parameter
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: Bernd dot Donner at gmx dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30344
More information about the Gcc-bugs
mailing list