This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c++/9436: passing a class template followed by a template value of this class


>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:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]