Files
scylladb/test/lib/expr_test_utils.cc
Kefu Chai fe80b5e0d0 test: lib: do not return a local reference
the type of return value of `get_table_views()` is a reference, so we
cannot return a reference to a temporary value.

in this change, a member variable is added to hold the _table_schema,
so it can outlive the function call.

this should silence following warning from Clang:
```
  test/lib/expr_test_utils.cc:543:16: error: returning reference to local temporary object [-Werror,-Wreturn-stack-address]
          return {view_ptr(_table_schema)};
                 ^~~~~~~~~~~~~~~~~~~~~~~~~
```

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
2023-03-05 17:37:33 +02:00

24 KiB