<div style="font-family: arial, helvetica, sans-serif"><font size="2"><div class="gmail_quote">On Wed, Jun 20, 2012 at 12:51 AM, Chandler Carruth <span dir="ltr"><<a href="mailto:chandlerc@google.com" target="_blank">chandlerc@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="font-family:arial,helvetica,sans-serif"><font size="2"><div class="gmail_quote"><div class="im">On Mon, Jun 18, 2012 at 3:09 PM, Jordan Rose <span dir="ltr"><<a href="mailto:jordan_rose@apple.com" target="_blank">jordan_rose@apple.com</a>></span> wrote:<br>

</div><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: jrose<br>
Date: Mon Jun 18 17:09:19 2012<br>
New Revision: 158683<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=158683&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=158683&view=rev</a><br>
Log:<br>
Support -Winternal-linkage-in-inline in C++ code.<br>
<br>
This includes treating anonymous namespaces like internal linkage, and allowing<br>
const variables to be used even if internal. The whole thing's been broken out<br>
into a separate function to avoid nested ifs.<br></blockquote></div></div></font></div></blockquote><div><br></div><div>I also think this warning may be firing erroneously on some code in Clang:</div><div><br></div><div>
<div>../tools/clang/lib/AST/Type.cpp:2020:50: warning: function 'getVisibility' is in an anonymous namespace but is used in an inline method with external linkage [-Winternal-linkage-in-inline]</div><div>           T->TypeBits.getVisibility() == Result.getVisibility());</div>
<div>                                                 ^</div><div>/usr/include/assert.h:89:5: note: expanded from macro 'assert'</div><div>  ((expr)                                                               \</div>
<div>    ^</div><div>../tools/clang/lib/AST/Type.cpp:1964:14: note: 'getVisibility' declared here</div><div>  Visibility getVisibility() const { return LV.visibility(); }</div><div>             ^</div><div>1 warning generated.</div>
</div><div><br></div><div><br></div><div>Here, 'getVisibility' is certainly in an anonymous namespace, and one might expect the function on line 2020 to have external linkage, but in fact this line is inside of a template, and that template is only ever instantiated with type parameters which have internal linkage, so I would expect all of that templates methods etc to also only have internal linkage in the final binary?</div>
</div></font></div>