On 04/02/2018 06:18 PM, Jason Merrill wrote:
About d in the example, I'm not sure how you mean the global namespace is the current scope; we should be pushed into a when parsing the initializer for a::z.
this may be related to the brokenness I encountered in 85046. We push member structs into the wrong binding level. And there's this in name-lookup.c: do_pushtag:
&& (scope != ts_current /* We may be defining a new type in the initializer of a static member variable. We allow this when not pedantic, and it is particularly useful for type punning via an anonymous union. */ || COMPLETE_TYPE_P (b->this_entity))))
But I would think we should reject the definition of d because a is already complete, so it's too late to add members to it.
Agreed. -- Nathan Sidwell