Both KDE and OOo fail to build with the anon namespace not exported changes. A short testcase of what they are doing: cat > test.h <<EOF namespace { struct A {}; } struct B { A *a; B (); }; EOF cat > test1.C <<EOF #include "test.h" B::B () : a(0) { } B b; int main (void) { } EOF cat > test2.C <<EOF #include "test.h" B c; EOF g++ -c test1.C g++ -c test2.C g++ -o test test1.o test2.o This doesn't link with GCC head, because B::B() constructor is a local symbol in test1.s. My understanding is that this is a [basic.def.odr]/5 violation, as lthough each definition consists of the same sequence of tokens, corresponding names (in this case A) don't refer to the same entity (as A's definition in anonymous namespace means it is a different thing in each translation unit), but I'd like some confirmation about this.
B violates ODR rules as the class for A is different between the TUs as it is in an anon namespace. See PR 28360 for full details. *** This bug has been marked as a duplicate of 28360 ***
Subject: Re: New: Anon namespace pointers in exported classes Yes, this is an ODR violation. However, the patch I'm working on will allow it to compile (as a side effect of other desired changes). Jason