This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/30344] New: template type argument cannot be initialized by a default parameter
- From: "Bernd dot Donner at gmx dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Jan 2007 18:56:10 -0000
- Subject: [Bug c++/30344] New: template type argument cannot be initialized by a default parameter
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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