public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/104433] [modules] Importing <memory> and using std::make_shared causes linker errors
Date: Fri, 07 Oct 2022 13:33:30 +0000	[thread overview]
Message-ID: <bug-104433-4-Cqc1yimHEl@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-104433-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104433

--- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>:

https://gcc.gnu.org/g:edbb2551d156d69a2e337dcd8daa69f2680d57ea

commit r13-3163-gedbb2551d156d69a2e337dcd8daa69f2680d57ea
Author: Patrick Palka <ppalka@redhat.com>
Date:   Fri Oct 7 09:32:45 2022 -0400

    c++ modules: static var in inline function [PR104433]

    The below testcase fails to link with the error

      undefined reference to `f()::y'

    ultimately because during stream out for the static VAR_DECL y we
    override DECL_EXTERNAL to true, which later during IPA confuses
    symbol_table::remove_unreachable_nodes into thinking it's safe
    to not emit the symbol.

    The streaming code here already avoids overriding DECL_EXTERNAL for
    inline vars and functions, so it seems natural to extend this to
    static vars from an inline function.

            PR c++/104433

    gcc/cp/ChangeLog:

            * module.cc (trees_out::core_bools): Don't override
            DECL_EXTERNAL to true for static variables from an inline
            function.

    gcc/testsuite/ChangeLog:

            * g++.dg/modules/static-2_a.H: New test.
            * g++.dg/modules/static-2_b.C: New test.

  parent reply	other threads:[~2022-10-07 13:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-07 20:17 [Bug c++/104433] New: " lhlaurini at hotmail dot com
2022-10-06 14:54 ` [Bug c++/104433] " ppalka at gcc dot gnu.org
2022-10-07 13:33 ` cvs-commit at gcc dot gnu.org [this message]
2022-10-07 13:36 ` ppalka at gcc dot gnu.org
2022-10-11 18:50 ` lhlaurini at hotmail dot com
2022-10-12  9:25 ` redi at gcc dot gnu.org
2022-10-12 19:13 ` ppalka at gcc dot gnu.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=bug-104433-4-Cqc1yimHEl@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).