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++/112899] odr-using constexpr static data member of class exported from module results in linker error
Date: Fri, 26 Jan 2024 11:29:10 +0000	[thread overview]
Message-ID: <bug-112899-4-WjzPch6jYy@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-112899-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Nathaniel Shead <nshead@gcc.gnu.org>:

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

commit r14-8451-ga0dde47f84f17cbe7fa2fb41c14c5a2db8c4d63a
Author: Nathaniel Shead <nathanieloshead@gmail.com>
Date:   Wed Jan 3 09:27:06 2024 +1100

    c++: Emit definitions of ODR-used static members imported from modules
[PR112899]

    Static data members marked 'inline' should be emitted in TUs where they
    are ODR-used.  We need to make sure that inlines imported from modules
    are correctly added to the 'pending_statics' map so that they get
    emitted if needed, otherwise the attached testcase fails to link.

            PR c++/112899

    gcc/cp/ChangeLog:

            * cp-tree.h (note_variable_template_instantiation): Rename to...
            (note_vague_linkage_variable): ...this.
            * decl2.cc (note_variable_template_instantiation): Rename to...
            (note_vague_linkage_variable): ...this.
            * pt.cc (instantiate_decl): Rename usage of above function.
            * module.cc (trees_in::read_var_def): Remember pending statics
            that we stream in.

    gcc/testsuite/ChangeLog:

            * g++.dg/modules/init-4_a.C: New test.
            * g++.dg/modules/init-4_b.C: New test.
            * g++.dg/modules/init-6_a.H: New test.
            * g++.dg/modules/init-6_b.C: New test.

    Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
    Reviewed-by: Patrick Palka <ppalka@redhat.com>
    Reviewed-by: Jason Merrill <jason@redhat.com

  parent reply	other threads:[~2024-01-26 11:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-07 10:34 [Bug c++/112899] New: " michael.kenzel at gmail dot com
2023-12-17 16:39 ` [Bug c++/112899] " ppalka at gcc dot gnu.org
2024-01-07 10:52 ` cvs-commit at gcc dot gnu.org
2024-01-26 11:29 ` cvs-commit at gcc dot gnu.org [this message]
2024-01-27 10:18 ` nshead at gcc dot gnu.org
2024-03-06 20:24 ` 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-112899-4-WjzPch6jYy@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).