From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 18402388451B; Wed, 12 Oct 2022 15:13:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 18402388451B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665587614; bh=nUjMNGhLDf8bPdDGE0LMB/j8/Ex5UVFbN0RASKH/sIA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=M8KbsDJtfISrTxSLZxWf6IkYhAF0N02+58yM76YVdScFi4th9o2KsAVXpnIvrAIRF c694GTVaByofut7h6Zn9D0gGTfdJVCpRvZEr0KSdSYOebzo0xqTnwmuFtpnGtU2zw1 MgsunDEZyd9x5dXcRVLtF3JmfQAoJBmpUqp8QTKc= From: "ppalka 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: Wed, 12 Oct 2022 15:13:31 +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: ppalka 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: cc 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 Patrick Palka changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ppalka at gcc dot gnu.org --- Comment #15 from Patrick Palka --- The comment #5 testcase now works on trunk, but the comment #4 testcase sti= ll fails to link. Reduced: $ cat 99377_a.H=20 template struct Widget { Widget (int) { } bool First() const { return true; } bool Second () const { return true;} }; inline void Frob (const Widget& w) noexcept { w.First (); } $ 99377_b.C=20 export module Foo:check; import "99377_a.H"; export inline bool Check (const Widget& w) { return w.Second (); } $ cat 99377_c.C=20 export module Foo; export import :check; $ cat 99377_d.C=20 import Foo; int main () { return Check (0) ? 0 : 1; } $ g++ -fmodules-ts 99377_a.H 99377_b.C 99377_c.C 99377_d.C /usr/bin/ld: /tmp/ccBHt33S.o: in function `Check@Foo(Widget const&)': 99377_d.C:(.text._ZW3Foo5CheckRK6WidgetIiE[_ZW3Foo5CheckRK6WidgetIiE]+0x14): undefined reference to `Widget::Second() const'=