dataentry.cc 747 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // { dg-do run }
  2. template<int patch_dim, int patch_space_dim>
  3. class DataOutInterface
  4. {
  5. public:
  6. virtual ~DataOutInterface() {}
  7. };
  8. template <int dof_handler_dim, int patch_dim, int patch_space_dim=patch_dim>
  9. class DataOut_DoFData : public DataOutInterface<patch_dim,patch_space_dim>
  10. {
  11. public:
  12. virtual ~DataOut_DoFData() {}
  13. class DataEntryBase {
  14. public:
  15. virtual ~DataEntryBase () {}
  16. };
  17. template <typename T>
  18. class DataEntry : public DataEntryBase
  19. {
  20. public:
  21. virtual ~DataEntry() {}
  22. };
  23. };
  24. template <typename T> void Destroy(T * p) __attribute__((noinline));
  25. template <typename T> void Destroy(T * p)
  26. {
  27. delete p;
  28. }
  29. int main()
  30. {
  31. DataOut_DoFData<3,3>::DataEntryBase * p = new DataOut_DoFData<3,3>::DataEntry<int>();
  32. Destroy(p);
  33. }