https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125885
--- Comment #4 from Thad House <thadhouse1 at gmail dot com> --- I realized I forgot to mention this is a regression in 16.x. 15.x and before compile this just fine with no warnings/errors, even with optimizations enabled.
