public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug c++/113687] New: -Warray-bounds is not emitted inside class method @ 2024-01-31 19:32 nmmm at nmmm dot nu 2024-01-31 19:42 ` [Bug c++/113687] " pinskia at gcc dot gnu.org 2024-02-01 7:43 ` rguenth at gcc dot gnu.org 0 siblings, 2 replies; 3+ messages in thread From: nmmm at nmmm dot nu @ 2024-01-31 19:32 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113687 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] = {0, 0}; return x[3]; // no warning shown } static int ps(){ int x[2] = {0, 0}; return x[3]; // no warning shown } int ps2inl(); int ps2(); }; inline int S::ps2inl(){ int x[2] = {0, 0}; return x[3]; // no warning shown } int S::ps2(){ int x[2] = {0, 0}; return x[3]; // warning shown correctly } int f(){ int x[2] = {0, 0}; return x[3]; // warning shown correctly } int main(){ } ^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/113687] -Warray-bounds is not emitted inside class method 2024-01-31 19:32 [Bug c++/113687] New: -Warray-bounds is not emitted inside class method nmmm at nmmm dot nu @ 2024-01-31 19:42 ` pinskia at gcc dot gnu.org 2024-02-01 7:43 ` rguenth at gcc dot gnu.org 1 sibling, 0 replies; 3+ messages in thread From: pinskia at gcc dot gnu.org @ 2024-01-31 19:42 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113687 Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |diagnostic --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- The warning only happens if the vague linkage function is used. and IIRC that is by design. ^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/113687] -Warray-bounds is not emitted inside class method 2024-01-31 19:32 [Bug c++/113687] New: -Warray-bounds is not emitted inside class method nmmm at nmmm dot nu 2024-01-31 19:42 ` [Bug c++/113687] " pinskia at gcc dot gnu.org @ 2024-02-01 7:43 ` rguenth at gcc dot gnu.org 1 sibling, 0 replies; 3+ messages in thread From: rguenth at gcc dot gnu.org @ 2024-02-01 7:43 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113687 Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |56456 Ever confirmed|0 |1 Status|UNCONFIRMED |NEW Last reconfirmed| |2024-02-01 --- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #1) > The warning only happens if the vague linkage function is used. and IIRC > that is by design. Yeah, we try to avoid diagnosing things on "dead" code and here the whole functions are dead. IIRC even -fanalyzer runs after cgraph removes unreachable functions. It would be still nice to diagnose these kind of trivial cases. Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56456 [Bug 56456] [meta-bug] bogus/missing -Warray-bounds ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-02-01 7:43 UTC | newest] Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2024-01-31 19:32 [Bug c++/113687] New: -Warray-bounds is not emitted inside class method nmmm at nmmm dot nu 2024-01-31 19:42 ` [Bug c++/113687] " pinskia at gcc dot gnu.org 2024-02-01 7:43 ` rguenth at gcc dot gnu.org
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).