This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Oh dear. I regret to inform you that commit 'RAII-fy make_cleanup_restore_current_thread & friends' might be unfortunate
On 05/04/2017 10:49 PM, Pedro Alves wrote:
> $ /opt/gcc/bin/g++ optional.cc -g3 -O2 -Wmaybe-uninitialized -std=gnu++17 -c
> optional.cc: In function ‘void func()’:
> optional.cc:28:15: warning:
> ‘maybe_a.optional<A>::<anonymous>.optional<A>::<unnamed union>::m_dummy’
> may be used uninitialized in this function [-Wmaybe-uninitialized]
> ~A () { set (m); }
> ~~~~^~~
> optional.cc:41:15: note:
> ‘maybe_a.optional<A>::<anonymous>.optional<A>::<unnamed union>::m_dummy’
> was declared here
> Optional<A> maybe_a;
> ^~~~~~~
>
> Looks like a compiler bug to me.
>
Now reported:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80635
Thanks,
Pedro Alves