[Bug c++/18028] nested calls to template constructors generate incorrect result

bangerth at dealii dot org gcc-bugzilla@gcc.gnu.org
Sat Oct 16 15:26:00 GMT 2004


------- Additional Comments From bangerth at dealii dot org  2004-10-16 15:26 -------
Yes, to be more specific: in this situation 
------------- 
struct X { 
  template <typename T> X(T t); 
}; 
 
int main () { 
  X x; 
  X y(x); 
} 
------------- 
the compiler has to generate a copy constructor itself, the template 
copy constructor is only used for arguments T which are not of type 
X. You will want to have an additional, non-template constructor. 
 
W. 

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18028



More information about the Gcc-bugs mailing list