title: Eigen evaluation with an auto hits temporal
body: <p>I am trying to perform an evaluation in Eigen.</p>
  <pre><code>        const Eigen::Vector3d position = m_rigidBody-&gt;pos().segment&lt;3&gt;(0); // pos() returns a const `Eigen::VectorXd &amp;`
          const Eigen::Quaterniond &amp;rotation = m_rigidBody-&gt;rot();
  
          const auto p = rotation * m_r + position; // Lazy evaluation, but rotation, m_r and position are always available afaik
  
          const auto skew = [](const Eigen::Vector3d &amp;v) -&gt; Eigen::Matrix3d {
              return Eigen::Matrix3d{{0, -v[2], v[1]},  //
                                  {v[2], 0, -v[0]},
                                  {-v[1], v[0], 0}};
          };
  
          MapType j = MapType::Zero();
          j.block&lt;3, 3&gt;(0, 0).setIdentity();
          j.block&lt;3, 3&gt;(0, 3) = skew((-(p - position)).eval()); // here it hits the temporal and crashes
          return j;
  </code></pre>
  <p>AFAIK the <code>const auto p</code> is just an expression template describing the operation, and it has to store the values that it operates on. Those values, afaik, exists when the operation is requested.</p>
  <p>On the <code>(-(p - position)).eval()</code> the program crashes, according to sanitizers, trying to access a wrong location.</p>
  <p>However, I dont get why. All the values should be still alive. Any idea why this is wrong?</p>
  <p>I have prepared a minimal reproducible example in godbolt, adding the sanitizers which show the issue:
  <a href="https://godbolt.org/z/7r9PEjeGM" rel="nofollow noreferrer">https://godbolt.org/z/7r9PEjeGM</a></p>
  <p>I have tested using the quaternion * vector, which fails. If using matrix * vector, then it works fine.</p>