public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "brutus at free dot fr" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/66590] New: switch statement: incorrect warning "reaches end of non-void function" Date: Thu, 18 Jun 2015 18:29:00 -0000 [thread overview] Message-ID: <bug-66590-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66590 Bug ID: 66590 Summary: switch statement: incorrect warning "reaches end of non-void function" Product: gcc Version: 4.9.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: brutus at free dot fr Target Milestone: --- Created attachment 35803 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35803&action=edit code snippet generated erroneous "end of non-void function" warning If the attached code is compiled with -Wall, gcc versions 4.9.2, 5.1 and others incorrectly warn about reaching end of non-void function. this is typically reproduced with: /opt/install/gcc-4.9.2/bin/g++ -Wall -c switch.cpp warning disappears if: -optimisation is at least -O1 -OR declaration of ~A() line 1 is removed -OR declaration of variable "a" line 6 is removed -OR declaration of variable "tmp" line 9 is removed -OR break on line 9 is removed
next reply other threads:[~2015-06-18 18:29 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2015-06-18 18:29 brutus at free dot fr [this message] 2015-06-19 0:24 ` [Bug c++/66590] " pinskia at gcc dot gnu.org 2015-06-19 7:47 ` manu at gcc dot gnu.org 2015-09-23 18:06 ` miyuki at gcc dot gnu.org 2021-08-10 0:53 ` pinskia at gcc dot gnu.org 2021-08-10 1:00 ` pinskia at gcc dot gnu.org 2021-08-10 1:04 ` pinskia at gcc dot gnu.org 2021-08-10 1:31 ` pinskia at gcc dot gnu.org 2021-08-25 21:28 ` cvs-commit at gcc dot gnu.org 2021-08-25 21:29 ` pinskia 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-66590-4@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).