Created attachment 570 [details]
coeff(Index) and coeffRef(Index), and corresponding operator()(Index) and operator, should probably require LinearAccessBit, right?
The attached testcase is how I came across this: I was mistakenly using operator()(Index) on a Block<MatrixXf>, so I was addressing coefficients outside of the block.
Also attaching a patch that does this static-assertion; but I can't push it at the moment, because it seems to be breaking lots of tests, and I don't currently have time to look into them...
Created attachment 571 [details]
Add static assertions on linear access. Breaks lots of tests at the moment.
This flags is now handled by the evaluator, so the test should be internal::evaluator<Derived>::Flags&LinearAccessBit, but that does not seem to be sufficient. If I relax it to:
bool(internal::evaluator<Derived>::Flags & LinearAccessBit) || Derived::IsVectorAtCompileTime
then everything compile again meaning that some vector expressions does not have the LinearAccessBit flag...
Summary: Bug 1009, part 1/2: make sure vector expressions expose LinearAccessBit flag.
Summary: Bug 1009, part 2/2: add static assertion on LinearAccessBit in coeff(index)-like methods.
-- GitLab Migration Automatic Message --
This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity.
You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/1009.