[Bug c++/54278] New: "control reaches end of non-void function
travis at gockelhut dot com
gcc-bugzilla@gcc.gnu.org
Thu Aug 16 00:00:00 GMT 2012
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]
More information about the Gcc-bugs
mailing list