From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7D06A3858D33; Wed, 19 Apr 2023 20:23:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7D06A3858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1681935787; bh=umGNoKDBlTrz/CH0Z+J2NxXBabFXR4OC7gzrMnSWokA=; h=From:To:Subject:Date:From; b=ZWDUu1ms1M2M7n+JoAOXIzk9P2/l2syQszbv0rencb58VZLv/QwIvCFGe+P+0YNlH 70++hJiZiF3dxPo0ZC131XbbdEiygWHSrWFxBIK7VbiHXBwTyAwKCMJmBS63E8Gop2 zc/4Z85wfDQmzGyDQHuBjnQVZfwO/twmkQj9y2x0= From: "mpolacek at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/109559] New: Unexpected -Wmaybe-uninitialized warning when inlining with system header Date: Wed, 19 Apr 2023 20:23:07 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mpolacek 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109559 Bug ID: 109559 Summary: Unexpected -Wmaybe-uninitialized warning when inlining with system header Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: mpolacek at gcc dot gnu.org Target Milestone: --- The following testcase (the directives simulate a system header) triggers a -Wmaybe-uninitialized warning: $ xg++ -c un.cc -Wall -O2 In member function =E2=80=98int function1::swap(function1)=E2=80=99, inlined from =E2=80=98int function::operator=3D(Functor) [with Functor = =3D FilonIntegral::integrate() const::]=E2=80=99 at :8:56, inlined from =E2=80=98double FilonIntegral::integrate() const=E2=80=99 = at :9:6: :5:49: warning: =E2=80=98f1=E2=80=99 may be used uninitialized [-Wmaybe-uni= nitialized] : In member function =E2=80=98double FilonIntegral::integrate() const=E2=80= =99: :1:3: note: by argument 1 of type =E2=80=98const function_base*=E2=80=99 to= =E2=80=98int function_base::has_trivial_copy_and_destroy() const=E2=80=99 declared here :8:12: note: =E2=80=98f1=E2=80=99 declared here $ xg++ -c un.cc -Wall -O2 -fno-inline # nothing # 0 "" 3 struct function_base { has_trivial_copy_and_destroy() const; int functor; }; struct function1 : function_base { swap(function1) { has_trivial_copy_and_destroy(); } }; struct function : function1 { template operator=3D(Functor) { swap(*this); } }; # 4 "" struct FilonIntegral { double integrate() const; }; double FilonIntegral::integrate() const { function f1; f1 =3D [] {}; return 0; }=