[cfe-commits] r168410 - /cfe/trunk/lib/AST/Decl.cpp

Rafael EspĂ­ndola rafael.espindola at gmail.com
Sun Dec 16 08:54:45 PST 2012


In the c++ case the difference is that we use the canonical decl, so we
will need a different way to test this.

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.

Would you mind making a test out of your visitor?
On Dec 16, 2012 5:15 AM, "Enea Zaffanella" <zaffanella at cs.unipr.it> wrote:

> On 12/15/2012 04:24 PM, Rafael EspĂ­ndola wrote:
>
>> static int y;
>>> void foo(void) {
>>>    extern int y;
>>> }
>>>
>>> the second declaration of `y' is now getting external linkage, while it
>>> should be internal linkage (tested on r170126).
>>>
>>
>> BTW, how are you testing this? I tried
>>
>> template<int &x>
>> void zed() {
>> }
>> static int y;
>> void foo(void) {
>>    extern int y;
>>    zed<y>();
>> }
>>
>> But I get an internal _Z3zedILZL1yEEvv.
>>
>
> We got a regression in one of our tests for the C code I reported above.
> We have lots of AST visitors (checking for compliance wrt many different
> coding standards guidelines): one of those was calling method
>   NamedDecl::getLinkage()
> and getting a result different wrt the expected one.
>
> 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?
>
> Enea.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20121216/0b193182/attachment.html>


More information about the cfe-commits mailing list