https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72708
--- Comment #4 from 高橋将 <the1987.6 at gmail dot com> --- cppreference.com also says: "Namespace-scope anonymous unions must be declared static unless they appear in an unnamed namespace." on Union declaration. It would be best if this bug was fixed.