On Thu, Nov 22, 2018 at 10:04:26AM +0200, Ville Voutilainen wrote: > 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?".
Thanks. This case is still handled correctly; I just checked the push_namespace calls in gdb and just the one for B is with make_inline=true. Arguably I should've added tests testing that some of the namespaces *aren't* inline. > 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. I wasn't aware you had worked on this. Perhaps we should track the progress of C++20 features in Bugzilla (to keep track of who's working on what). Marek