From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18599 invoked by alias); 15 Jul 2004 01:55:01 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 18589 invoked by alias); 15 Jul 2004 01:55:00 -0000 Date: Thu, 15 Jul 2004 01:55:00 -0000 From: "gcc-bugzilla at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org Message-ID: <20040715015458.16558.snyder@fnal.gov> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/16558] New: 3.5: bogus missing-return warning X-Bugzilla-Reason: CC X-SW-Source: 2004-07/txt/msg01802.txt.bz2 List-Id: g++ mainline erroneously warns about a missing return for the code below. $ g++ -c -Wall x.cc x.cc: In function `int getref(int)': x.cc:17: warning: control reaches end of non-void function $ Environment: System: Linux karma 2.6.7 #18 Wed Jul 14 03:27:01 EDT 2004 i686 i686 i386 GNU/Linux Architecture: i686 host: i686-pc-linux-gnu build: i686-pc-linux-gnu target: i686-pc-linux-gnu configured with: /home/sss/gcc/gcc/configure --prefix=/usr/local/gcc --enable-threads=posix --enable-long-long --enable-languages=c,c++,f95 How-To-Repeat: ----------------------------------------- struct C { C (); ~C (); }; int getref (int ndx) { C d; if (ndx != 0) { C base; return 0; } else return 0; } ----------------------------------------- ------- Additional Comments From snyder at fnal dot gov 2004-07-15 01:54 ------- Fix: -- Summary: 3.5: bogus missing-return warning Product: gcc Version: 3.5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: snyder at fnal dot gov CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16558