[PATCH] gdbsupport: mark array_view::slice with [[nodiscard]]

Tom Tromey tom@tromey.com
Fri Nov 3 18:12:44 GMT 2023


>>>>> "Simon" == Simon Marchi <simon.marchi@polymtl.ca> writes:

Simon> The first one does nothing, it creates a new array_view but without
Simon> using it, it's useless.  Mark the slice methods with [[nodiscard]]
Simon> (which is standard C++17) so that error would generate a warning.

Looks good to me.

Unfortunately std::span::subspan doesn't seem to have this annotation.
I wonder if it could be added.

Approved-By: Tom Tromey <tom@tromey.com>

Tom


More information about the Gdb-patches mailing list