https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67010
--- Comment #1 from Anders Granlund <anders.granlund.0 at gmail dot com> --- Detailed explanation of how the c++ standard can be applied to the program: By [namespace.udir]/2 during the unqualified name lookup of x in sizeof (x), the declaration struct x {}; appears as if it was declared in the declarative region of the global namespace, so the name lookup will appear to be affected by the type of name hiding described in [basic.scope.hiding]/2. Because of this name hiding we should not get any ambiguity in the name lookup.