public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/54278] New: "control reaches end of non-void function
@ 2012-08-16  0:00 travis at gockelhut dot com
  2012-08-16  0:07 ` [Bug c++/54278] __attribute__((noreturn)) called from destructor when another auto-scoped variable has a non-trivial dtor erroneously fails with "control reaches end of non-void function" at -O0 travis at gockelhut dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: travis at gockelhut dot com @ 2012-08-16  0:00 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54278

             Bug #: 54278
           Summary: "control reaches end of non-void function
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: travis@gockelhut.com


Created attachment 28027
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28027
compile with g++-4.7 -Wreturn-type to recreate

struct ThingWithDtor
    {
        ~ThingWithDtor();
    };

    struct Aborter
    {
        __attribute__((noreturn)) ~Aborter();
    };

    int foo(int x)
    {
        ThingWithDtor t __attribute__((unused));
        if (x)
            return x;
        Aborter();
    }


noreturn.cpp: In function ‘int foo(int)’:
noreturn.cpp:16:1: warning: control reaches end of non-void function
[-Wreturn-type]


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

end of thread, other threads:[~2020-11-21 22:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-16  0:00 [Bug c++/54278] New: "control reaches end of non-void function travis at gockelhut dot com
2012-08-16  0:07 ` [Bug c++/54278] __attribute__((noreturn)) called from destructor when another auto-scoped variable has a non-trivial dtor erroneously fails with "control reaches end of non-void function" at -O0 travis at gockelhut dot com
2013-08-21 10:19 ` paolo.carlini at oracle dot com
2020-11-21 19:53 ` [Bug c++/54278] [6 regression] " danikiw542 at bcpfm dot com
2020-11-21 22:58 ` 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).