[Bug c++/77440] New: [[noreturn]] does not work at end of main().
kataoka-instructor at ka2 dot so-net.ne.jp
gcc-bugzilla@gcc.gnu.org
Thu Sep 1 08:56:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77440
Bug ID: 77440
Summary: [[noreturn]] does not work at end of main().
Product: gcc
Version: 5.4.1
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: kataoka-instructor at ka2 dot so-net.ne.jp
Target Milestone: ---
First, I know Bug ID 52003.
Why need warning about evident dead code?
[[noreturn]]
int main()
{
while(true)
{
//do something...
}
} //the attribute cannot remove implicit 'return 0;' from here.
sample.cpp: In function 'int main()':
sample.cpp:8:1: warning: function declared 'noreturn' has a 'return' statement
} //the attribute cannot remove implicit 'return 0;' from here.
^
More information about the Gcc-bugs
mailing list