c++/9436: passing a class template followed by a template value of this class
dfredoui@irisa.fr
dfredoui@irisa.fr
Fri Jan 24 18:56:00 GMT 2003
>Number: 9436
>Category: c++
>Synopsis: passing a class template followed by a template value of this class
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: ice-on-legal-code
>Submitter-Id: net
>Arrival-Date: Fri Jan 24 18:56:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: dfredoui@irisa.fr
>Release: g++-3.2.1
>Organization:
>Environment:
SunOS 5.8
>Description:
// well, just compile with g++-3.2.1 -c these few lines
// and magically the bug appears
// It comes from the affectation of defaultValue by T()
// in the following template
template <typename T, T defaultValue = T()>
struct A{
A() : t(defaultValue) {}
T t;
};
template <typename T> void fct(A<T> a){}
struct B{
void hello(){ fct( a );}
A<char> a;
};
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the Gcc-prs
mailing list