From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 55BEA385843A; Wed, 31 Jan 2024 19:32:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 55BEA385843A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1706729542; bh=LEt0BrSPXh5Hhb7rG3MFYUVZBpFgFe5RS/pNE6iCsWA=; h=From:To:Subject:Date:From; b=DA6bv7W50t+XYGglI1Uz9WanO563EYRVWc3FC2XBNvLrgvgvUp5231g9JSTU+gIbQ G2dzoCiQ9o/4fiWCJGCi3QpUyYh4eKHJ63vMOTZFZ4GfBslRpRuAcoY6tpbPK+1R7G ZHJ6log2/E6hAYSPUQDUFRUrLklS5Zxn4CySgkTQ= From: "nmmm at nmmm dot nu" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/113687] New: -Warray-bounds is not emitted inside class method Date: Wed, 31 Jan 2024 19:32:22 +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: 13.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: nmmm at nmmm dot nu 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=3D113687 Bug ID: 113687 Summary: -Warray-bounds is not emitted inside class method Product: gcc Version: 13.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: nmmm at nmmm dot nu Target Milestone: --- No warning -Warray-bounds is shown when code is inside class method, defined inside the class body or outside if they are inline or constexpr. struct S{ int p(){ int x[2] =3D {0, 0}; return x[3]; // no warning shown } static int ps(){ int x[2] =3D {0, 0}; return x[3]; // no warning shown } int ps2inl(); int ps2(); }; inline int S::ps2inl(){ int x[2] =3D {0, 0}; return x[3]; // no warning shown } int S::ps2(){ int x[2] =3D {0, 0}; return x[3]; // warning shown correctly } int f(){ int x[2] =3D {0, 0}; return x[3]; // warning shown correctly } int main(){ }=