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