summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.jason/template40.C
blob: e56833caaa0fa07b91f7988bca381b9e5792b30a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// { dg-do run  }
// PRMS id: 11315
// Bug: g++ doesn't recognize the copy ctor for Array<long>.

template <class Type>
class Array {
public:
  Array(int sz=12)
    : ia (new Type[sz]), size(sz) {}
  ~Array() { delete[] ia;}
  Array(const Array<long>& r) : size(0) {} // just for testing
private:
  Type *ia;
  int size;
};

int main(int argc, char *argv[])
{
  Array<long> ia;	// looping occurs on this line
}