Following code triggers "error: uninitialized variable: s.val2 [uninitvar]"
struct S { int val; int val2{123}; }; S fn() { S s; s.val = 0; return s; }
Note: Initializing val2 via ctor (and not val) is a viable workaround.
This is fixed in head, possibly 2.9 as well.
Log in to post a comment.
Following code triggers "error: uninitialized variable: s.val2 [uninitvar]"
Note: Initializing val2 via ctor (and not val) is a viable workaround.
Last edit: Mark Bourgeault 2022-11-09
This is fixed in head, possibly 2.9 as well.