Skip to content

Forbid creation of LocalFunction from temporary

Since the LocalFunction stores a pointer to the DiscreteGlobalBasisFunction, calling localFunction(...) with a temporary leads to a dangling reference.

This happens, e.g., when passing a temporary DiscreteGlobalBasisFunction to VTKWriter::addVertexData(...) because the latter does not store its argument, but only the obtained LocalFunction.

Thanks to @max.kahnt for pointing out the issue.

Merge request reports