This is the mail archive of the libstdc++@sources.redhat.com mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [c++] builtin functions and namespaces



Brent, we can go with just this slightly simplified example:

// start
namespace _C_ {
  extern "C" {
    extern int abs(int a);
  }
}
namespace std {
  using ::_C_::abs;
}

using namespace std;

int
main()
{
  abs(1);
}
// end

%eccp --strict kill.cc

%g++ -c -fno-builtin kill.cc

%g++ -c kill.cc
kill.cc:8: `abs' is already declared in this scope
kill.cc: In function `int main ()':
kill.cc:16: `abs' undeclared (first use this function)
kill.cc:16: (Each undeclared identifier is reported only once for each 
function it appears in.)

This appears to be a bug or limitation of g++. Jason, Martin, what are
the options for namespace-using libraries such as libstdc++-v3? Should
we default to not using builtins for the moment? It would be nice for
this to work in a similar manner with and without builtins.

-benjamin

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]