public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "bernie at codewiz dot org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/105438] Incorrect array-bounds warning with array size carried over from a previous template instantiation Date: Mon, 02 May 2022 06:05:44 +0000 [thread overview] Message-ID: <bug-105438-4-yn3mJqX7ig@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-105438-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105438 --- Comment #2 from Bernie Innocenti <bernie at codewiz dot org> --- GCC 12.0.1 20220413 (Red Hat 12.0.1-0) gives a more helpful diagnostic with inlining backtrace: In function ‘void configure(const int (&)[N], int) [with int N = 7]’, inlined from ‘void configure(const int (&)[N], int) [with int N = 2]’ at testcase.cc:8:6, inlined from ‘int main()’ at gcc-array-bounds-bug-testcase.cc:22:12: testcase.cc:14:24: warning: array subscript ‘const int [7][0]’ is partly outside array bounds of ‘int [2]’ [-Warray-bounds] 14 | out[i] = in[i]; | ~~^ Note how configure<N=7>() was inlined into configure<N=7>().
next prev parent reply other threads:[~2022-05-02 6:05 UTC|newest] Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-04-30 8:24 [Bug c++/105438] New: " bernie at codewiz dot org 2022-04-30 8:27 ` [Bug c++/105438] " bernie at codewiz dot org 2022-05-02 6:05 ` bernie at codewiz dot org [this message] 2022-05-02 6:07 ` bernie at codewiz dot org 2022-05-02 6:11 ` bernie at codewiz dot org 2022-05-02 6:54 ` [Bug ipa/105438] " rguenth at gcc dot gnu.org 2022-05-02 6:57 ` [Bug ipa/105438] [11/12/13 Regression] " pinskia at gcc dot gnu.org 2022-05-03 12:27 ` [Bug ipa/105438] [11/12/13 Regression] Incorrect array-bounds warning with array size carried over from a previous template instantiation since r11-4987-g602c6cfc79ce4ae6 since r11-4987-g602c6cfc79ce4ae6 marxin at gcc dot gnu.org 2022-05-03 12:42 ` marxin at gcc dot gnu.org 2022-07-26 11:39 ` [Bug ipa/105438] [11/12/13 Regression] Incorrect array-bounds warning with array size carried over from a previous template instantiation " rguenth at gcc dot gnu.org 2023-01-22 0:55 ` bernie at codewiz dot org 2023-02-09 11:37 ` marxin at gcc dot gnu.org 2023-05-29 10:06 ` [Bug ipa/105438] [11/12/13/14 " jakub at gcc dot gnu.org 2023-07-20 7:23 ` bernie at codewiz dot org 2023-07-27 9:22 ` rguenth at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-105438-4-yn3mJqX7ig@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).