public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Brian Budge <brian.budge@gmail.com>
To: John Graham <johngavingraham@googlemail.com>
Cc: gcc-help@gcc.gnu.org
Subject: Re: Template instantiation & inheritance - fixed, but can I scrap the  	warning I get to do it?
Date: Sat, 06 Mar 2010 17:14:00 -0000	[thread overview]
Message-ID: <5b7094581003060914h21321a65m5cf05995b05861a1@mail.gmail.com> (raw)
In-Reply-To: <94cf76f1003060400j53b805b9vbbfeaaeb0e1e19d7@mail.gmail.com>

I think we're saying the same thing :)  It will work for the program
when it can see the headers, and implicit instantiation is allowed.

On Sat, Mar 6, 2010 at 4:00 AM, John Graham
<johngavingraham@googlemail.com> wrote:
>> I believe that since you are forcing explicit instantiation,
>> you will probably have to instantiate ALL used templates, even if they
>> are templates used by an instantiated template.   Maybe someone in the
>> know could confirm?
>
> Fair enough - no mean feat since the compiler nicely tells you what
> it's missing, I guess. It's just a puzzle to me that I didn't seem to
> have to do any extra "instantiating" in my library but I do in a test
> case - I'm obviously missing something subtle in the library.
>
>
>> Perhaps you aren't using the same flag in the compilation of your
>> program, and the code can see the template directly?  Then you would
>> have the explicitly instantiated subclass, and because you aren't
>> telling the compiler to explicitly instantiate while compiling the
>> executable, it takes care of implicitly instantiating anything used by
>> the subclass?  This is just a guess.  Do you use that flag for
>> compilation of all units?
>
> In the example I sent earlier (as in the "real" case) I use
> -fno-implicit-templates for the library, but *not* for the program.
> And the program can definitely see all the template definitions as
> they're included in header files, so I don't think that'll be the
> case...
>
> John G
>

  reply	other threads:[~2010-03-06 17:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-27 22:43 John Graham
     [not found] ` <5b7094581002270824v669fa771y3d5f017c0aefa11c@mail.gmail.com>
2010-02-28  2:28   ` John Graham
2010-03-01 17:44     ` Brian Budge
2010-03-06 12:00       ` John Graham
2010-03-06 17:14         ` Brian Budge [this message]
2010-03-06 21:16           ` John Graham

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=5b7094581003060914h21321a65m5cf05995b05861a1@mail.gmail.com \
    --to=brian.budge@gmail.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=johngavingraham@googlemail.com \
    /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).