Files
scylladb/cql3
Kefu Chai 108f20c684 cql3: capture reference to temporary value by value
`data_dictionary::database::find_keyspace()` returns a temporary
object, and `data_dictionary::keyspace::user_types()` returns a
references pointing to a member of this temporary object. so we
cannot use the reference after the expression is evaluated. in
this change, we capture the return value of `find_keyspace()` using
universal reference, and keep the return value of `user_types()`
with a reference, to ensure us that we can use it later.

this change silences the warning from GCC-13, like:

```
/home/kefu/dev/scylladb/cql3/statements/authorization_statement.cc:68:21: error: possibly dangling reference to a temporary [-Werror=dangling-reference]
   68 |         const auto& utm = qp.db().find_keyspace(*keyspace).user_types();
      |                     ^~~
```

Fixes #13725
Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>

Closes #13726
2023-05-01 22:41:41 +03:00
..
2023-04-29 13:11:31 +02:00
2023-04-29 13:11:31 +02:00
2023-02-28 22:26:43 +02:00
2023-02-14 11:19:03 +02:00
2023-04-06 09:50:32 -04:00
2023-04-29 13:11:31 +02:00
2023-01-18 10:38:24 +02:00
2023-02-15 11:09:04 +02:00
2023-04-26 14:09:58 +08:00
2023-01-18 10:38:24 +02:00
2023-02-15 11:09:04 +02:00
2023-04-28 16:59:29 +08:00
2023-02-15 11:09:04 +02:00
2023-02-19 21:05:45 +02:00