public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/40056] implicit instantiation of function templates fails with -O2, works with -O and -g...
Date: Thu, 08 Mar 2012 15:49:00 -0000	[thread overview]
Message-ID: <bug-40056-4-WyYfdXpG5H@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-40056-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40056

--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-03-08 15:48:34 UTC ---
(In reply to comment #6)
> Assuming an implicit instantiation will happen is an incorrect.

... is an incorrect /assumption/  :)

(In reply to comment #7)
> Ok, thanks for clarification. The problem is that I'm not a developer of this
> program, I just maintain its package for Gentoo. To make things worse I can't
> reproduce the build failure myself on any of my hosts. But users continue to
> complain one after another, so this issue needs to be cleared out.

Looking at the preprocessed source I see that the member function template
TStreamerInfo::ReadBuffer is declared in TStreamerInfo.h but only defined in
the .cxx file.  If that function (which is public) is called from a different
.cxx file then it will be implicitly instantiated, which isn't possible if the
definition isn't visible.  The member function template definition should be
moved to the header or there should be an explicit instantiation declaration
(i.e. 'extern template' declaration) in the header and an explicit
instantiation definition in the .cxx file.


  parent reply	other threads:[~2012-03-08 15:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-40056-4@http.gcc.gnu.org/bugzilla/>
2011-09-28 22:05 ` paolo.carlini at oracle dot com
2012-03-08 14:29 ` bircoph at gmail dot com
2012-03-08 14:44 ` redi at gcc dot gnu.org
2012-03-08 15:12 ` bircoph at gmail dot com
2012-03-08 15:49 ` redi at gcc dot gnu.org [this message]
2012-03-08 20:45 ` bircoph at gmail dot com
2012-03-08 21:06 ` redi at gcc dot gnu.org
2012-03-08 21:17 ` Fons.Rademakers at cern dot ch
2012-03-08 23:27 ` bircoph at gmail dot com
2009-05-07  9:59 [Bug c++/40056] New: " Fons dot Rademakers at cern dot ch
2009-05-07 10:02 ` [Bug c++/40056] " Fons dot Rademakers at cern dot ch
2009-05-07 12:24 ` pinskia at gcc dot gnu dot org
2009-05-07 12:25 ` pinskia at gcc dot gnu dot org
2009-05-07 13:55 ` Fons dot Rademakers at cern dot ch

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=bug-40056-4-WyYfdXpG5H@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).