<div class="gmail_quote">On Fri, Jan 13, 2012 at 9:16 PM, Eli Friedman <span dir="ltr"><<a href="mailto:eli.friedman@gmail.com">eli.friedman@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Fri, Jan 13, 2012 at 7:22 PM, Matt Beaumont-Gay <<a href="mailto:matthewbg@google.com">matthewbg@google.com</a>> wrote:<br>
> Hi Eli,<br>
><br>
> On Fri, Jan 13, 2012 at 15:41, Eli Friedman <<a href="mailto:eli.friedman@gmail.com">eli.friedman@gmail.com</a>> wrote:<br>
>> Modified: cfe/trunk/test/SemaCXX/linkage.cpp<br>
>> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/linkage.cpp?rev=148158&r1=148157&r2=148158&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/linkage.cpp?rev=148158&r1=148157&r2=148158&view=diff</a><br>

>> ==============================================================================<br>
>> --- cfe/trunk/test/SemaCXX/linkage.cpp (original)<br>
>> +++ cfe/trunk/test/SemaCXX/linkage.cpp Fri Jan 13 17:41:25 2012<br>
>> @@ -76,13 +76,15 @@<br>
>>     struct X {<br>
>>       int f() {<br>
>>         extern int g();<br>
>> -        extern int a;<br>
>> +        // FIXME: We don't compute the correct linkage for this variable<br>
>> +        // at the moment<br>
>> +        // extern int a;<br>
><br>
> Are you planning on addressing this FIXME soon? We have some code<br>
> which looks roughly like this, and now Clang is producing a warning<br>
> "variable 'a' has internal linkage but is not defined".<br>
<br>
</div>Per the C++11 rules, this variable clearly has internal linkage, but<br>
the C++98 rules aren't very clear, and I'm not sure what the<br>
gcc-compatible rules are.  If you can point me to some description, I<br>
can implement it.</blockquote><div><br></div><div>I'm not sure what C++11 rules you're referring to (I just haven't read that part of the standard), but these definitely don't actually have internal linkage... Both Clang and GCC give them external linkage and C mangling. This is true even in C++11 mode, both with GCC and Clang in my tests... So this warning looks like a false positive. </div>
</div>