https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87155
--- Comment #3 from Artem Yurchenko <artiom.yurol at ya dot ru> --- (In reply to Nathan Sidwell from comment #2) > Hm, while I understand the intent here, I wonder if clang is succeeding by > accident? The std is not completely clear whether all anonymous namespaces > may share the same unique identifier or not. We do, and hence fail here for > the same reasons as-if the two anonymous namespaces were named 'bob'. Will > ask. If two namespaces named 'bob' are in the same enclosing namespace, the second should extend the first one, not redeclare it. Also, I checked it on https://godbolt.org/z/4PhIG0, and the code compiles with virtually every compiler that I choose (besides gcc 8.1+)