mardi 28 avril 2015

Controversial results between GCC and clang related to [basic.link]/7 in the C++ Standard

This snippet compiles in clang,

namespace A {
    void f() {
        void g();
        g();
    }
}

void A::g() { }

but GCC only accepts the code if g is defined inside the namespace A as follows:

namespace A {
    void f() {
        void g();
        g();
    }
    void g() {}
}

But I believe there's nothing in [basic.link]/7 disallowing the first snippet above.

Aucun commentaire:

Enregistrer un commentaire