public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Matt Austern <austern@apple.com>
To: gcc@gcc.gnu.org
Subject: When to emit the vtable for a class template
Date: Thu, 10 Oct 2002 13:50:00 -0000	[thread overview]
Message-ID: <F9DAC6A9-DC89-11D6-80E4-00039390D9E0@apple.com> (raw)

I'm not sure whether the compiler is following what the ABI
specification (http://www.codesourcery.com/cxx-abi/abi.html)
says.  Entirely possible that I'm misunderstanding what the
ABI document is saying, of course.

The question: if you've got a polymorphic class template,
which translation units do you emit the vtable in?

5.2.3 says that you emit a vtable in the object file where you've
got the definition of the key function, or in every object file if
no key function exists.  5.2.3 may or may not apply to a class
template, of course.

5.2.7 seems to say that you emit a vtable for a class template
in every object file where the class template is instantiated,
irrespective of key functions.

What I'm not completely clear of is what exactly it means to
say that a class template is instantiated.  The most reasonable
interpretation is that the ABI specification is using this language
in the same sense of the C++ Standard, meaning that a class
template is instantiated "if the class type is used in a context that
requires a completely-defined object type or if the completeness
of the class type affects the semantics of the program".  Was that
the intention of the ABI specification and of the implementation?

			--Matt

             reply	other threads:[~2002-10-10 19:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-10 13:50 Matt Austern [this message]
2002-10-10 15:15 ` Matt Austern
2002-10-10 15:24   ` Gabriel Dos Reis
2002-10-10 15:30     ` Matt Austern
2002-10-10 19:42       ` Gabriel Dos Reis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=F9DAC6A9-DC89-11D6-80E4-00039390D9E0@apple.com \
    --to=austern@apple.com \
    --cc=gcc@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).