This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c++/9436: passing a class template followed by a template value of this class
- From: dfredoui at irisa dot fr
- To: gcc-gnats at gcc dot gnu dot org
- Date: 24 Jan 2003 18:55:54 -0000
- Subject: c++/9436: passing a class template followed by a template value of this class
- Reply-to: dfredoui at irisa dot fr
>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: