Skip to content

Use aligned_storage in PolymorphicSmallObject

  • Use std::aligned_storage in PolymorphicSmallObject. This automatically selects an alignment which is large enough to store any type fitting into the buffer. This fixes a bug with misaligned objects if the derived class stored in the buffer has stricter alignment requirements than the base class. The fixed bug is probably the origin of the segfault mentioned in !257 (merged) and https://gitlab.dune-project.org/snippets/56
  • Add a test case checking if we have proper alignment in case of alignof(Derived)>alignof(Base).
  • Fix a bug in polymorphicsmallobjecttest which always passed regardless of potentially failing checks.

Merge request reports