<p dir="ltr">In the c++ case the difference is that we use the canonical decl, so we will need a different way to test this.</p>
<p dir="ltr">I think I have a fix, but it depends on the patch I posted yesterday fixing tentative definitions. I also need a testcase I can include in the clang test suite. A file that currently has an incorrect error or warning would be ideal, but a unit test will do.</p>

<p dir="ltr">Would you mind making a test out of your visitor?</p>
<div class="gmail_quote">On Dec 16, 2012 5:15 AM, "Enea Zaffanella" <<a href="mailto:zaffanella@cs.unipr.it">zaffanella@cs.unipr.it</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 12/15/2012 04:24 PM, Rafael Espíndola wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
static int y;<br>
void foo(void) {<br>
   extern int y;<br>
}<br>
<br>
the second declaration of `y' is now getting external linkage, while it<br>
should be internal linkage (tested on r170126).<br>
</blockquote>
<br>
BTW, how are you testing this? I tried<br>
<br>
template<int &x><br>
void zed() {<br>
}<br>
static int y;<br>
void foo(void) {<br>
   extern int y;<br>
   zed<y>();<br>
}<br>
<br>
But I get an internal _Z3zedILZL1yEEvv.<br>
</blockquote>
<br>
We got a regression in one of our tests for the C code I reported above.<br>
We have lots of AST visitors (checking for compliance wrt many different coding standards guidelines): one of those was calling method<br>
  NamedDecl::getLinkage()<br>
and getting a result different wrt the expected one.<br>
<br>
As for your C++ testcase ... I can not tell without studying clang source code. As a wild guess, could it be the case that clang has significantly different code for the C++ case?<br>
<br>
Enea.<br>
<br>
</blockquote></div>