From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15504 invoked by alias); 17 Mar 2007 18:07:30 -0000 Received: (qmail 13755 invoked by uid 48); 17 Mar 2007 18:07:18 -0000 Date: Sat, 17 Mar 2007 18:07:00 -0000 Message-ID: <20070317180718.13751.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug libstdc++/31246] Strange -Wunreachable-code warning with _GLIBCXX_DEBUG In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "chris at bubblescope dot net" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-03/txt/msg01683.txt.bz2 ------- Comment #4 from chris at bubblescope dot net 2007-03-17 18:07 ------- Here is a minimal code example: #include int* get_ptr(void* ptr) { return new(ptr) int(); } Which gives (on my computer) /usr/include/c++/4.0.0/new: In function 'int* get_ptr(void*)': /usr/include/c++/4.0.0/new:94: warning: will never be executed But a similar problem exists in much of the templated code, and in general. The real problem I think here is that the system_header pragma is still broken for templates. If that was fixed, this warning would go away. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31246