gcc/testsuite/g++.old-deja/g++.jason/template40.C
raw| 1 | // { dg-do run } |
| 2 | // PRMS id: 11315 |
| 3 | // Bug: g++ doesn't recognize the copy ctor for Array<long>. |
| 4 | |
| 5 | template <class Type> |
| 6 | class Array { |
| 7 | public: |
| 8 | Array(int sz=12) |
| 9 | : ia (new Type[sz]), size(sz) {} |
| 10 | ~Array() { delete[] ia;} |
| 11 | Array(const Array<long>& r) : size(0) {} // just for testing |
| 12 | private: |
| 13 | Type *ia; |
| 14 | int size; |
| 15 | }; |
| 16 | |
| 17 | int main(int argc, char *argv[]) |
| 18 | { |
| 19 | Array<long> ia; // looping occurs on this line |
| 20 | } |