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

brent@rcfile.org brent@rcfile.org
Fri Oct 6 23:23:00 GMT 2000

On 07 Oct 2000 at 01:25 (-0400), brent@rcfile.org wrote:
| On 06 Oct 2000 at 20:24 (-0700), Kriang Lerdsuwanakij wrote:
| | Hi
| | 
| | The included patch fix the extern "C" function and namespace handling
| | to comply with 7.5p6 of the standard.  Declarations for such functions
| | in different namespaces are treated as the same function.  One
| | definition rule is also enforced for these functions across the
| | namespaces.
| nice! works afaict.

well, mostly :) 
The following does not compile -- it should.

namespace _C_ { 
  extern "C" int abs(int a); 
using ::_C_::abs;

int main()
  return 0;

dust$ Compile n.cc
g++ -g -Wall -I. -DDEBUG_ASSERT n.cc -o n 
n.cc:4: `abs' is already declared in this scope


All opinions expressed are My own, unless otherwise attributed. In
presenting facts, I expressly reserve the right to be Wrong. Portions
of this message authored by Me are subject to the Free Thought License.

More information about the Gcc-patches mailing list