mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-01 13:45:53 +00:00
Add tests for new expr::visit to ensure that it is working correctly. expr::visit had a hidden bug where trying to return a reference actually returned a reference to freed location on the stack, so now there are tests to ensure that everything works. Sadly the test `expr_visit_const_ref` also passes before the fix, but at lest expr_visit_ref doesn't compile before the fix. It would be better to test this by taking references returned by std::visit and expr::visit and checking that they point to the same address in memory, but I can't do this because I would have to access private field of expression. Signed-off-by: Jan Ciolek <jan.ciolek@scylladb.com>