www.digitalmars.com         C & C++   DMDScript  

c++ - extern const definition has internal linkage only

This is, I believe, a bug in the way that DMC++ 
treats the construct:
  extern const int whatever = 0;
It will be compiled without being exposed
for use by other translation units (in the
beta compiler as of Aug 8).

My understanding of C++ is that a const
object can be given external linkage
by prefixing its definition with the
keyword 'const'.

This can be seen in section "9.2 Linkage" of
Stroustrup's "The C++ Programming Language"
3rd Ed.  I'm pretty sure I've seen it in the
standard as well, but I'm too lazy to dredge
it up from my failed previous work machine.

-Larry Brasfield
(address munged, s/sn/h/ to reply)
Aug 13 2002