Joe Buck <[EMAIL PROTECTED]> writes:

| On Thu, Jul 13, 2006 at 01:36:46AM +0200, Gabriel Dos Reis wrote:
| > So, -concretely- what happens to a class S (e.g. associated type info object
| > address, address of member functions, etc.) with external linkage,
| > defined in multiple translation units, with say hidden visibility?
| 
| Well, there are the C++ rules, and then there are the ELF rules.  At the
| object code level we have only symbol definitions (corresponding to
| the addresses of member functions, virtual tables, and typeinfo). If
| the relevant symbols are hidden, then it's as if they aren't there, so
| we can violate the one-definition rule. 

Thanks.  So both notions are not as orthogonal as they may appear.
Now, this being a conscious decision for ODR violation, it would
probably need to be documented because then we may have

   typeinfo1 != typeinfo2

and yet

    !typeinfo1.before(typeinfo2) && !typeinfo2.before(typeinfo1)

There are probably other inconsistencies to audit.

| We can have two distinct
| classes named S, and no one can tell.  Each bit of code will see one
| definition of S.

-- Gaby

Reply via email to