https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42000
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Known to work| |5.3.0
Depends on| |79345
Resolution|--- |FIXED
Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot
gnu.org
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
Do constructors really need to initialize all members?? I would expect a
warning for the use of i and I do get that when optimizing (needs inlining of
the constructor) and the patch for PR79345.
It also worked with GCC5:
> ../../gcc5-g/gcc/cc1plus -quiet t.C -Wall -fdump-tree-all-lineno -O
t.C: In function ‘int main()’:
t.C:7:15: warning: ‘s.main()::S::i’ is used uninitialized in this function
[-Wuninitialized]
return s.i;
^
Let's say "fixed" then, the regression is tracked in PR79345.
Referenced Bugs:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79345
[Bug 79345] [6/7 Regression] passing yet-uninitialized member as argument to
base class constructor should warn (-Wunitialized)