https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91423

--- Comment #5 from Anders Schau Knatten <anders at knatten dot org> ---
(In reply to Andrew Pinski from comment #4)
> Vec size = s.size;
> 
> you are invoking the copy constructor here ...
> Which means you are taking the address (implicitly).

Good point.

This should be safe though, as `Vec` itself is packed, so its copy constructor
would have to handle unaligned arguments. (In fact, if `Vec` wasn't packed, the
compiler would not allow `S` to be packed either.)

I'm however not sure if we should expect gcc to take this information into
account when deciding whether to emit the warning, what do you think?

Reply via email to