public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/57724] New: wrong error: returning a value from a constructor
@ 2013-06-26 11:15 joerg.richter@pdv-fs.de
  2013-06-26 11:31 ` [Bug c++/57724] " fanael4 at gmail dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: joerg.richter@pdv-fs.de @ 2013-06-26 11:15 UTC (permalink / raw)
  To: gcc-bugs

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


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

end of thread, other threads:[~2013-06-27  7:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-26 11:15 [Bug c++/57724] New: wrong error: returning a value from a constructor joerg.richter@pdv-fs.de
2013-06-26 11:31 ` [Bug c++/57724] " fanael4 at gmail dot com
2013-06-26 11:46 ` joerg.richter@pdv-fs.de
2013-06-26 23:30 ` paolo.carlini at oracle dot com
2013-06-27  7:14 ` joerg.richter@pdv-fs.de

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