From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 58DBA3851ABA; Mon, 5 Jun 2023 11:27:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 58DBA3851ABA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685964448; bh=deG5hclqu5hDgBTxnybk03fT5pw+/xaowFOPvA69abA=; h=From:To:Subject:Date:From; b=rnNT+MZjxaN8pZh1lyUaoDWA9rMZD7EXJSKU9zi/VHFKYL+atuT85RumJIpiTS89Y X5zwLLhXykjoRIo4e2L6NMkB2Gj1nY+m7TejMPi7L5vcoNxb5186cHIZXEzrKSP+RO FouaSwmL+rayd34oih9FrSOr6QlinEGYT2OC0E8A= From: "vakili at live dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/110124] New: Not inlining comparison operator when using std::tie with -std=c++20 Date: Mon, 05 Jun 2023 11:27:27 +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: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vakili at live dot com 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D110124 Bug ID: 110124 Summary: Not inlining comparison operator when using std::tie with -std=3Dc++20 Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: vakili at live dot com Target Milestone: --- Here is a simple class with a operator<(): struct A { int a0; int a1; int a2; friend inline constexpr bool operator<(const A& x, const A& y) { return std::tie(x.a0, x.a1, x.a2) < std::tie(y.a0, y.a1, y.a2); } }; When compiling this code with -std=3Dc++17 the operator will be inlined at = usage location. But when compiled with -std=3Dc++20 it will not be inlined. Here is the compiler explorer snippet showing the situation: https://godbolt.org/z/4KdzWjvx4 The problem exists from g++ 10.0 to the trunk (14.0).=