re PR c++/12883 (destructor of array object not called if no prior instantiation...
authorAdam Nemet <anemet@lnxw.com>
Thu, 27 May 2004 19:10:49 +0000 (19:10 +0000)
committerAdam Nemet <nemet@gcc.gnu.org>
Thu, 27 May 2004 19:10:49 +0000 (19:10 +0000)
PR c++/12883
* g++.dg/init/array14.C: New test.

From-SVN: r82334

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/init/array14.C [new file with mode: 0644]

index 9f04f74c9de965bd915aac877468000ede15cdf7..38cf2d7aa22181c0bb71ce554bdb87462873e4a4 100644 (file)
@@ -1,3 +1,8 @@
+2004-05-27  Adam Nemet  <anemet@lnxw.com>
+
+       PR c++/12883
+       * g++.dg/init/array14.C: New test.
+
 2004-05-25  Janis Johnson  <janis187@us.ibm.com>
 
        * lib/compat.exp (compat-get-options-main): New.
diff --git a/gcc/testsuite/g++.dg/init/array14.C b/gcc/testsuite/g++.dg/init/array14.C
new file mode 100644 (file)
index 0000000..847bd1f
--- /dev/null
@@ -0,0 +1,21 @@
+// PR c++/12883
+// Bug: Destructor of array object not called if no prior
+// instantiation of the template has happened.
+
+// { dg-do run }
+
+int ret = 1;
+
+template <int> struct X
+{
+  X(int) { }
+  ~X() { ret = 0; }
+}; 
+int main()
+{
+  { 
+    X<0> array[] = { 0 };
+  }
+  return ret;
+}