diff options
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.jason/template14.C')
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.jason/template14.C | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/template14.C b/gcc/testsuite/g++.old-deja/g++.jason/template14.C new file mode 100644 index 000000000..4576ec3f8 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.jason/template14.C @@ -0,0 +1,17 @@ +// { dg-do run } +// PRMS Id: 4745 +// Bug: g++ gets the constructor and destructor confused because the default +// parm prevents the two constructor types from satisfying ==. + +template <class T> struct A { + A(int = 1); + ~A(); +}; + +template <class T> A<T>::A(int) { } // causes compiler abort +template <class T> A<T>::~A() { } + +int main() +{ + A<int> a; +} |