[Bug c++/82309] Compiled binary received SIGSEGV when -g
sergio_nsk at yahoo dot de
gcc-bugzilla@gcc.gnu.org
Sun Sep 24 06:49:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82309
--- Comment #6 from Sergey Markelov <sergio_nsk at yahoo dot de> ---
(In reply to Andrew Pinski from comment #5)
> The temp variable goes out if scope is the result of v0 + v1. And not the
> auto. IIRC -fsanitize=undefined will catch this.
Yes, I agree, I understood it from your previous comment. Sorry, I was mistaken
with the extra minimized bug.cpp, so you can not see Vector constructor from
'VectorSum'.
'auto sum = v0 + v1 + v2' deduces the type VectorSum<VectorSum<Vector, Vector>
Vector> with a reference to a temp variable of the type VectorSum<Vector,
Vector>.
'Vector sum = v0 + v1 + v2' sums and copies values during the temp scope is
valid.
Unfortunately -fsanitize=undefined does not catch this. Thank you for your
help.
More information about the Gcc-bugs
mailing list