------- Additional Comments From giovannibajo at libero dot it 2005-02-07 19:46 ------- My understanding is that this should create one definition *per* instantiation so there is an ODR conflict if the signatures match. Notice that it is still useful to do something as:
template <class T> struct A { friend void foo(A<T> t) { .... } }; template class A<int>; template class A<float>; thus different overloads are injected into the global namespace. Now, the standard says that we are not forced to detect ODR violations. On the other hand, we used to do so for this case, so I qualify this as a QoI regression. CC'ing Kriang as he surely knows if this is fixable in the 4.0 timeframe. -- What |Removed |Added ---------------------------------------------------------------------------- CC| |lerdsuwa at gcc dot gnu dot | |org Status|UNCONFIRMED |NEW Ever Confirmed| |1 Keywords| |accepts-invalid Known to fail| |3.4.4 4.0.0 Known to work| |3.3.4 Last reconfirmed|0000-00-00 00:00:00 |2005-02-07 19:46:48 date| | Summary|Multiple definitions of |[3.4/4.0 Regression] |friend functions in template|Multiple definitions of |classes |friend functions in template | |classes Target Milestone|--- |3.4.4 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19809