
On December 3, 2012 11:58:54 PM Marshall Clow <mclow.lists@gmail.com> wrote:
On Dec 3, 2012, at 9:43 AM, Felipe Magno de Almeida <felipe.m.almeida@gmail.com> wrote:
http://boost.2283326.n4.nabble.com/Boost-inspection-notification-2007-06-09-...
AFAIK, an unnamed namespace creates different entities for each translation on which it is defined (by #inclusion, for example).
Yes.
If any entity defined in a unnamed namespace is used in an external linkage definition, such as a inline function or a template definition and this definition is used in multiple TUs it causes ODR violations, because it is defined differently (uses different entities) in each TU.
And No. Because the call to it (in each TU) will call the entity in the specific unnamed namespace that was part of that translation unit.
Exactly, and that's what makes ODR violated. Imagine an inline function in a header, the function depends on the entity in an unnamed namespace. The function will be defined differently in each TU that includes the header, and that's UB.