[Bug c++/90291] [8/9/10 Regression] Inline namespace erroneously extends another namespace

igusarov at mail dot ru gcc-bugzilla@gcc.gnu.org
Fri May 3 10:13:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90291

--- Comment #10 from Igor A. Goussarov <igusarov at mail dot ru> ---
Having reflected on my feelings about the described scenario, I came up with a
slightly different wording for my complaints about the behaviour of gcc-8.x:

The fact that using an inline namespace at one point in source may alter the
interpretation of an unrelated, unaware and otherwise well-defined code at some
other point further down the same translation unit looks unsafe. That's
dangerous interference right there.

Given the following source text:

namespace B
{
    namespace A
    {
        void foo() {}
    }
}

I would expect the compiler to generate B::A::foo() no matter what header files
may have been included prior to these lines.

BTW, is that core working group forum public? Maybe I'm missing some important
reasoning why the behaviour exhibited by gcc 8.x is actually desired?

P.S. I'm having days off now; most likely, I'll not be able to reply before May
9.


More information about the Gcc-bugs mailing list