[comp.lang.c++] extern "C" friends

dld@F.GP.CS.CMU.EDU (David Detlefs) (10/28/89)

Should the following work?

----------------------------------------------------------------------
extern "C" {
  int foo(int);
}

struct bar {
  // ...
  friend int foo(int);
}
----------------------------------------------------------------------

I had a need for such a function recently, and tried to compile the
eqivalent of the above using g++.  It told me that foo had been
"implicitly overloaded" by its friend declaration in struct bar.  Is
this a language problem, or just a g++ bug?  I couldn't figure it out
from reading Lippmann (though I must admit I didn't try very hard -- I
know the C++ experts in this group enjoy displaying their knowledge).
Does 2.0 compile this?

Thanks!

--
Dave Detlefs			Any correlation between my employer's opinion
Carnegie-Mellon CS		and my own is statistical rather than causal,
dld@cs.cmu.edu			except in those cases where I have helped to
				form my employer's opinion.  (Null disclaimer.)