[PATCH, RFC] Implement N4230, Nested namespace definition

Jason Merrill jason@redhat.com
Fri Sep 18 17:26:00 GMT 2015


On 09/18/2015 12:58 PM, Ville Voutilainen wrote:
> On 18 September 2015 at 19:34, Jason Merrill <jason@redhat.com> wrote:
>>>>> This patch doesn't handle attributes yet, it looks to
>>>>> me as if gcc doesn't support namespace attributes in the location that
>>>>> the standard grammar puts them into.
>>>> Mind fixing that, too?
>>> Can we please do that separately?
>> I suppose so, but it seems pretty trivial.  In any case, looks like your
>> patch would accept the odd
>> namespace A __attribute ((visibility ("default"))) ::B { }
>
> Yes, or namespace A[[nonsense]]::B {}. Those cases are easy to fix,
> but namespace [[attribute_in_proper_location]] A {} seemingly caused
> weird barfing. That's why I didn't put in the rejection of the former, I'd prefer
> to figure out the latter and the former at the same time, and I'd prefer doing
> that once the basic facility is in. Yes, partly because I'll travel tomorrow. :)

To fix the former, you just need to keep

>    /* Parse any specified attributes.  */
>    attribs = cp_parser_attributes_opt (parser);

next to the open brace.  OK with that change, I suppose the other can wait.

Jason



More information about the Gcc-patches mailing list