public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/66590] New: switch statement: incorrect warning "reaches end of non-void function"
@ 2015-06-18 18:29 brutus at free dot fr
  2015-06-19  0:24 ` [Bug c++/66590] " pinskia at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: brutus at free dot fr @ 2015-06-18 18:29 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-08-25 21:29 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-18 18:29 [Bug c++/66590] New: switch statement: incorrect warning "reaches end of non-void function" brutus at free dot fr
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

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).