[Bug c++/78495] [7 regression][new inheriting ctors] variant members lead to uninitialized parameter

2017-01-19 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78495

--- Comment #2 from Nathan Sidwell  ---
Created attachment 40543
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40543=edit
reduced testcase

The problem is not with unnamed union members, but with inheriting ctors
passing by value.  The temporary 'Ptr' object is passed by implicit reference,
but in the inheriting ctor we pass the address of that reference to the Base
ctor.   In this case that means we end up initializing Base::val with a pointer
into the stack frame, rather than NULL.

Note the original testcase has a typo ': val(static_cast(val))' --
the ctor parm and the member variable have the same name, so that's doing self
initialization -- not copying the incoming parm. (not that that;s the bug being
exposed).

[Bug c++/78495] [7 regression][new inheriting ctors] variant members lead to uninitialized parameter

2017-01-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78495

Richard Biener  changed:

   What|Removed |Added

   Keywords||wrong-code
   Priority|P3  |P1
  Known to work||6.3.0

[Bug c++/78495] [7 regression][new inheriting ctors] variant members lead to uninitialized parameter

2017-01-11 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78495

Marek Polacek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-01-11
 CC||mpolacek at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Marek Polacek  ---
Confirmed.

[Bug c++/78495] [7 regression][new inheriting ctors] variant members lead to uninitialized parameter

2016-11-23 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78495

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |7.0