[Bug c++/57724] New: wrong error: returning a value from a constructor
joerg.richter@pdv-fs.de
gcc-bugzilla@gcc.gnu.org
Wed Jun 26 11:15:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57724
Bug ID: 57724
Summary: wrong error: returning a value from a constructor
Product: gcc
Version: 4.7.3
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: joerg.richter@pdv-fs.de
cat > t.cc <<EOF
void func();
struct A
{
A()
{
return func();
}
};
EOF
gcc t.cc
Produces:
t.cc: In constructor 'A::A()':
t.cc:6:19: error: returning a value from a constructor
I think this should work. (At least clang accepts it.)
More information about the Gcc-bugs
mailing list