aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/libvtv/testsuite/libvtv.cc/template-list2.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/libvtv/testsuite/libvtv.cc/template-list2.cc')
-rw-r--r--gcc-4.9/libvtv/testsuite/libvtv.cc/template-list2.cc46
1 files changed, 46 insertions, 0 deletions
diff --git a/gcc-4.9/libvtv/testsuite/libvtv.cc/template-list2.cc b/gcc-4.9/libvtv/testsuite/libvtv.cc/template-list2.cc
new file mode 100644
index 000000000..3df8d3724
--- /dev/null
+++ b/gcc-4.9/libvtv/testsuite/libvtv.cc/template-list2.cc
@@ -0,0 +1,46 @@
+// { dg-do run }
+
+#include <assert.h>
+
+extern "C" int printf(const char *, ...);
+
+class Subscriptor
+{
+ public:
+
+ Subscriptor()
+ { counter = 1;}
+
+ virtual ~Subscriptor()
+ {
+ counter--;
+ assert(counter == 0);
+ }
+
+ private:
+ static int counter;
+};
+
+int Subscriptor::counter;
+
+template <typename number>
+class Polynomial : public Subscriptor
+{
+};
+
+class LagrangeEquidistant: public Polynomial<double>
+{
+};
+
+template<typename _Tp>
+inline void
+_MyDestroy(_Tp* __pointer)
+ { __pointer->~_Tp(); }
+
+int main()
+{
+ LagrangeEquidistant * s1 = new LagrangeEquidistant;
+ _MyDestroy(s1);
+
+ return 0;
+}