From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F06B43858D32; Tue, 11 Oct 2022 19:03:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F06B43858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665514980; bh=haYRtcHKRPLTXjrxZnvcT9T0gxMUgSBRykHZkcOKJ/A=; h=From:To:Subject:Date:In-Reply-To:References:From; b=pwkFppdaIlhZm1uXMHVsh+9OAetB5poQtLYhf8/LkAnGcAyFQNzjvY+nu1hpafHVf Jt0TIjHaRFRVMiXanvt+oJzz6kriIIjKaivFi99VKLSUoF4DhN5KOmTTjQgStz7gCC O64SR2CJ2cBIi8bVHvD0P6tFCtiUcCCXEIdNJXlM= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/99377] [modules] undefined std::string_view::empty() if referenced in inline exported function Date: Tue, 11 Oct 2022 19:02:59 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: link-failure X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: REOPENED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: nathan at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99377 --- Comment #14 from CVS Commits --- The master branch has been updated by Patrick Palka : https://gcc.gnu.org/g:2ceb4d531a303f3e70d8bb218c8759e6c0688f62 commit r13-3235-g2ceb4d531a303f3e70d8bb218c8759e6c0688f62 Author: Patrick Palka Date: Tue Oct 11 15:02:01 2022 -0400 c++ modules: lazy loading from within template [PR99377] Here when lazily loading the binding for f due to its first use from the template g, processing_template_decl is set which causes the call to note_vague_linkage_fn from module_state::read_cluster to have no effect, and thus we never push f onto deferred_fns and end up never emitting its definition despite needing it. The behavior of the lazy loading machinery shouldn't be sensitive to whether we're inside a template, so to that end this patch makes us clear processing_template_decl in the entrypoints lazy_load_binding and lazy_load_pendings. PR c++/99377 gcc/cp/ChangeLog: * module.cc (lazy_load_binding): Clear processing_template_decl. (lazy_load_pendings): Likewise. gcc/testsuite/ChangeLog: * g++.dg/modules/pr99377-2_a.C: New test. * g++.dg/modules/pr99377-2_b.C: New test.=