From: Adam Nemet Date: Thu, 27 May 2004 19:10:49 +0000 (+0000) Subject: re PR c++/12883 (destructor of array object not called if no prior instantiation... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=18db8f19afa7464645b265b771c397b188b6d1f8;p=gcc.git re PR c++/12883 (destructor of array object not called if no prior instantiation of the template has happened) PR c++/12883 * g++.dg/init/array14.C: New test. From-SVN: r82334 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9f04f74c9de..38cf2d7aa22 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2004-05-27 Adam Nemet + + PR c++/12883 + * g++.dg/init/array14.C: New test. + 2004-05-25 Janis Johnson * 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 index 00000000000..847bd1f20f1 --- /dev/null +++ b/gcc/testsuite/g++.dg/init/array14.C @@ -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 struct X +{ + X(int) { } + ~X() { ret = 0; } +}; + +int main() +{ + { + X<0> array[] = { 0 }; + } + return ret; +}