[C++ PATCH] Fix extern "C" function and namespace handling

Kriang Lerdsuwanakij lerdsuwa@scf.usc.edu
Sun Oct 8 16:36:00 GMT 2000


On Sun, 8 Oct 2000, brent verner wrote:

> FWIW, the following code is still busted after both patches applied.
> AFAICT, it looks like another test will have to be added to 
> do_nonmember_using_decl() to accomodate this, what are your 
> (group-at-large, also) thoughts on this approach?
> 
> thanks.
>   brent
> 
> 
> namespace _C_ {
>   extern "C" int abs(int a);
> }
> namespace std {
>   inline int abs(int a){ return a >= 0 ? a : - a; }   // error
>   inline long abs(long a){ return a >= 0 ? a : - a; } // OK
> }
> 
> using namespace std  // OK

Is it just because the trailing ';' is missing from the above line?
It works for me after the fix.

> using std::abs;      // error
> 
> int main() 
> {
>   using std::abs; // OK
>   abs(5); 
>   return 0; 
> }



More information about the Gcc-patches mailing list