gcc/testsuite/g++.old-deja/g++.jason/template14.C
raw| 1 | // { dg-do run } |
| 2 | // PRMS Id: 4745 |
| 3 | // Bug: g++ gets the constructor and destructor confused because the default |
| 4 | // parm prevents the two constructor types from satisfying ==. |
| 5 | |
| 6 | template <class T> struct A { |
| 7 | A(int = 1); |
| 8 | ~A(); |
| 9 | }; |
| 10 | |
| 11 | template <class T> A<T>::A(int) { } // causes compiler abort |
| 12 | template <class T> A<T>::~A() { } |
| 13 | |
| 14 | int main() |
| 15 | { |
| 16 | A<int> a; |
| 17 | } |