Possibly dangling reference to a temporary QuadratureRule

When compiling some code with g++14 and warning enabled, I get the following:

warning: possibly dangling reference to a temporary [-Wdangling-reference]
   57 |   const QuadratureRule<double, dim>& quad = QuadratureRules<double, dim>::rule(element.type(), order);
      |                                      ^~~~
dune-functions/examples/poisson-pq2.cc:57:79: note: the temporary was destroyed at the end of the full expression ‘Dune::QuadratureRules<double, 3>::rule((& element)->Dune::Entity<0, 3, const Dune::UGGrid<3>, Dune::UGGridEntity>::type(), order, Dune::QuadratureType::GaussLegendre)’
   57 |   const QuadratureRule<double, dim>& quad = QuadratureRules<double, dim>::rule(element.type(), order);

I have already started to investigate, but am not yet sure why this would be a dangling reference. So, is it a false positive warning, if yes, how to silence it? If not, what can we do to fix it?