[Bug c++/71882] elaborated-type-specifier friend not looked up in unnamed namespace
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Mar 16 16:04:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71882
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
IMHO that's a reasonable interpretation, but so is GCC's :-)
Transforming the program as per 10.3.1.1 [namespace.unnamed] we get:
namespace N { }
using namespace N;
namespace N { struct S; }
class C {
friend struct S;
static void f();
};
namespace N { struct S { void f() { C::f(); } }; }
GCC and EDG still reject this, and Clang still accepts it.
This seems related to https://wg21.link/cwg138
More information about the Gcc-bugs
mailing list