[cfe-commits] r50538 - /cfe/trunk/lib/Sema/SemaDecl.cpp

Argiris Kirtzidis akyrtzi at gmail.com
Thu May 1 16:18:42 PDT 2008


Neil Booth wrote:
>> Author: akirtzidis
>> Date: Thu May  1 16:04:16 2008
>> New Revision: 50538
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=50538&view=rev
>> Log:
>> Implicitly defined functions were getting the DeclContext of the function where they appeared, causing the bug: http://llvm.org/bugs/show_bug.cgi?id=2266.
>> Fix it by making implicitly defined functions get the DeclContext of translation unit.
>>     
>
> Does this give them local or global scope?  They should only have local
> scope; it sounds like you're making them global.
>   

I don't quite understand what you mean. Given:

void f1() {
  g(); // #1
}

void f2() {
  g(); // #2
}

int g() { // #3
....
}

Aren't both 'g' references supposed to refer to the same function, later 
defined (on #3) ?

In any case, clang was already assigning implicitly defined functions to 
the translation unit scope.




More information about the cfe-commits mailing list