public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jconner at apple dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/23708] Non-inline function incorrectly treated as inline when using precompiled headers
Date: Sat, 03 Sep 2005 02:09:00 -0000	[thread overview]
Message-ID: <20050903020915.19299.qmail@sourceware.org> (raw)
In-Reply-To: <20050903015707.23708.jconner@apple.com>


------- Additional Comments From jconner at apple dot com  2005-09-03 02:09 -------
When generating a precompiled header, finish_member_declaration() invokes note_decl_for_pch() for 
the function "testfn<T>", and assigns it to the COMDAT section with weak linkage.

Then, when the test.C file is compiled, a function "testfn<int> (implicit declaration)" is generated, and 
inherits the COMDAT properties of "testfn<T>".  Finally, when the explicit specialization is actually 
seen, the function duplicate_decls() attempts to merge the declarations, and assigns the specialization 
function (incorrectly) to the COMDAT section.

When not using precompiled headers, the "testfn<T>" function is not assigned to the COMDAT section 
until after its attributes are merged with the specialization by duplicate_decls(), and since checks are 
already in place to make sure that the specialization doesn't inherit the DECL_DECLARED_INLINE_P 
attribute (which is a prerequesite for ending up in COMDAT), both decls are assigned to the correct 
sections.


-- 


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


  reply	other threads:[~2005-09-03  2:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-03  1:57 [Bug c++/23708] New: " jconner at apple dot com
2005-09-03  2:09 ` jconner at apple dot com [this message]
2005-09-03  2:11 ` [Bug c++/23708] [4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
2005-09-08 19:55 ` pinskia at gcc dot gnu dot org
2005-09-09 16:38 ` [Bug c++/23708] [4.0 " mmitchel at gcc dot gnu dot org
2005-09-27 16:17 ` mmitchel at gcc dot gnu dot org

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=20050903020915.19299.qmail@sourceware.org \
    --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).