public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/59916] New: [4.9 Regression] constructors and destructors can cause "control reaches end of non-void function" warnings with -Os
@ 2014-01-23 11:35 Bernhard.Rosenkranzer at linaro dot org
  2014-01-27 11:05 ` [Bug c++/59916] " paolo.carlini at oracle dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Bernhard.Rosenkranzer at linaro dot org @ 2014-01-23 11:35 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 59916
           Summary: [4.9 Regression] constructors and destructors can
                    cause "control reaches end of non-void function"
                    warnings with -Os
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: Bernhard.Rosenkranzer at linaro dot org

Created attachment 31929
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31929&action=edit
test case

The following C++ code:

class A
{
};

class B : virtual public A
{
public:
        B();
        virtual ~B();
};

B::B()
{
}

B::~B()
{
}


causes an incorrect warning with current 4.9 git with -Os:

[bero@localhost gcc-test]$ arm-linux-androideabi-g++ -Werror=return-type -Os -o
test.o test.cpp
test.cpp: In constructor 'B::B()':
test.cpp:14:1: error: control reaches end of non-void function
[-Werror=return-type]
 }
 ^
test.cpp: In constructor 'B::B()':
test.cpp:14:1: error: control reaches end of non-void function
[-Werror=return-type]
 }
 ^
test.cpp: In destructor 'B::~B()':
test.cpp:18:1: error: control reaches end of non-void function
[-Werror=return-type]
 }
 ^
test.cpp: In destructor 'virtual B::~B()':
test.cpp:18:1: error: control reaches end of non-void function
[-Werror=return-type]
 }
 ^
cc1plus: some warnings being treated as errors


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

end of thread, other threads:[~2014-01-29 17:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-23 11:35 [Bug c++/59916] New: [4.9 Regression] constructors and destructors can cause "control reaches end of non-void function" warnings with -Os Bernhard.Rosenkranzer at linaro dot org
2014-01-27 11:05 ` [Bug c++/59916] " paolo.carlini at oracle dot com
2014-01-28 13:04 ` rguenth at gcc dot gnu.org
2014-01-29 13:34 ` rguenth at gcc dot gnu.org
2014-01-29 14:12 ` jason at gcc dot gnu.org
2014-01-29 17:13 ` jason at gcc dot gnu.org
2014-01-29 17:13 ` jason 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).