From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 94E043854829; Thu, 4 Mar 2021 19:26:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 94E043854829 From: "nathan at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/99389] New: [modules] bad serialization of data Date: Thu, 04 Mar 2021 19:26:00 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: nathan at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 19:26:00 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99389 Bug ID: 99389 Summary: [modules] bad serialization of data Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: nathan at gcc dot gnu.org Target Milestone: --- Triaging 99377 runs into this: // bug_a.ii template class basic_string_view { public: basic_string_view(const _CharT* __str) noexcept {} bool empty() const noexcept { return !_M_len; } private: unsigned _M_len; }; using string_view =3D basic_string_view; // bug_b.ii export module hello; import "bug_a.ii"; export inline bool Check (const string_view& n) { return !n.empty (); } // bug_c.ii import hello; int main () { return Check ("World") ? 0 : 1; } ./cc1plus -quiet -fmodule-header bug_a.ii && ./cc1plus -quiet -fmodules-ts bug_b.ii && ./cc1plus -quiet -fmodules-ts bug_c.ii In module imported at bug_c.ii:1:1: hello: In function 'int main()': hello: error: failed to read compiled module cluster 1: Bad file data hello: note: compiled module file is 'gcm.cache/hello.gcm' hello: error: failed to read compiled module cluster 2: Bad file data bug_c.ii:5:10: fatal error: failed to load binding '::Check@hello' 5 | return Check ("World") ? 0 : 1; | ^~~~~ we failed to find _M_len as that instantiation's not (yet?) loaded=