[cfe-dev] Bug 16345 - spurious warning when using header scoped anonymous namespace

Richard Smith richard at metafoo.co.uk
Mon Jun 17 13:21:18 PDT 2013


On Mon, Jun 17, 2013 at 1:06 PM, Tomasz Mikolajczyk
<tmmikolajczyk at gmail.com> wrote:
> Hi,
>
> The following entry has been marked as invalid:
> http://llvm.org/bugs/show_bug.cgi?id=16345
>
> I'm not sure the reason is adequate. Any thoughts?

Your code would violate the one definition rule if 'foo' is
instantiated with the same type in two different translation units, so
Clang should certainly issue a warning for it. However, we're not
issuing the correct warning -- there are circumstances where internal
linkage functions in header files make sense, although your code is
not such a case.



More information about the cfe-dev mailing list