[PATCH] make rich_location safe to copy

Martin Sebor msebor@gmail.com
Wed Jun 16 01:48:37 GMT 2021


While debugging locations I noticed the semi_embedded_vec template
in line-map.h doesn't declare a copy ctor or copy assignment, but
is being copied in a couple of places in the C++ parser (via
gcc_rich_location).  It gets away with it most likely because it
never grows beyond the embedded buffer.

The attached patch defines the copy ctor and also copy assignment
and adds the corresponding move functions.

Tested on x86_64-linux.

Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcc-semi_embedded_vec.diff
Type: text/x-patch
Size: 3089 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20210615/94c68949/attachment.bin>


More information about the Gcc-patches mailing list