public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "marxin at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug target/106827] operator++ doesn't work for enum -O2 -mcpu=cortex-m0plus Date: Mon, 05 Sep 2022 10:26:16 +0000 [thread overview] Message-ID: <bug-106827-4-4yplnYhUFK@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-106827-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106827 Martin Liška <marxin at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|WAITING |NEW CC| |marxin at gcc dot gnu.org --- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> --- Copied test-case: enum Foo{a,b,c,d,e,f}; Foo operator+(Foo n,int m) { return Foo(int(n)+m); } Foo operator++(Foo n,int) { return Foo(int(n)+1); } Foo operator++(Foo n) { return Foo(int(n)+1); } void test1() { for (Foo i=a; i<=f; i++) { volatile Foo z=i; } } void test2() { for (Foo i=a; i<=f; ++i) { volatile Foo z=i; } } void test3() { for (Foo i=a; i<=f; i=i+1) { volatile Foo z=i; } }
next prev parent reply other threads:[~2022-09-05 10:26 UTC|newest] Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-09-04 18:39 [Bug target/106827] New: " bugzilla@little-bat.de 2022-09-04 18:43 ` [Bug target/106827] " bugzilla@little-bat.de 2022-09-05 9:59 ` rearnsha at gcc dot gnu.org 2022-09-05 10:26 ` marxin at gcc dot gnu.org [this message] 2022-09-05 11:48 ` bugzilla@little-bat.de 2022-09-05 12:12 ` schwab@linux-m68k.org 2022-09-05 12:51 ` jakub at gcc dot gnu.org 2022-09-05 18:55 ` bugzilla@little-bat.de 2022-09-06 9:55 ` rearnsha 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-106827-4-4yplnYhUFK@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).