aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.jason/template40.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.jason/template40.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/template40.C19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/template40.C b/gcc/testsuite/g++.old-deja/g++.jason/template40.C
new file mode 100644
index 00000000000..635dffcf143
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.jason/template40.C
@@ -0,0 +1,19 @@
+// 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;
+};
+
+main(int argc, char *argv[])
+{
+ Array<long> ia; // looping occurs on this line
+}