This is the mail archive of the
libstdc++@sources.redhat.com
mailing list for the libstdc++ project.
Re: [c++] builtin functions and namespaces
- To: gcc-bugs at gcc dot gnu dot org, libstdc++ at sources dot redhat dot com, loewis at informatik dot hu-berlin dot de, jason at cygnus dot com
- Subject: Re: [c++] builtin functions and namespaces
- From: Benjamin Kosnik <bkoz at redhat dot com>
- Date: Tue, 26 Sep 2000 09:24:55 -0700
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