C++ PATCH to implement P1094R2, Nested inline namespaces

Ville Voutilainen ville.voutilainen@gmail.com
Thu Nov 22 08:04:00 GMT 2018


On Tue, Nov 20, 2018 at 04:59:46PM -0500, Jason Merrill wrote:
> On 11/19/18 5:12 PM, Marek Polacek wrote:
>> > +  /* Don't forget that the innermost namespace might have been
>> > +     marked as inline.  */
>> > +  is_inline |= nested_inline_p;
>> This looks wrong: an inline namespace does not make its nested namespaces
>> inline as well.

>A nested namespace definition cannot be inline.  This is supposed to handle
>cases such as
>namespace A::B::inline C { ... }
>because after 'C' we don't see :: so it breaks and we call push_namespace
>outside the for loop.  So I still don't see a bug; do you have a test that
>I got wrong?

The way I read the question is "what does

namespace A::inline B::C::D {...}

do?".

C and D are not inline. For what it's worth, I had an earlier very incomplete
stab at it, haven't looked how complete it really was; I know that it didn't
handle diagnostics as well as yours, and I have no recollection
of whether it handles the cases like the above. See attached.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: P1094.diff
Type: text/x-patch
Size: 2084 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20181122/a51e31a6/attachment.bin>


More information about the Gcc-patches mailing list