From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12907 invoked by alias); 12 Apr 2006 14:00:54 -0000 Received: (qmail 12879 invoked by uid 48); 12 Apr 2006 14:00:48 -0000 Date: Wed, 12 Apr 2006 14:00:00 -0000 Message-ID: <20060412140048.12878.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/27129] [4.1/4.2 Regression] ICE in get_expr_operands In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "prigault at oricom dot ca" 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 X-SW-Source: 2006-04/txt/msg00964.txt.bz2 List-Id: ------- Comment #2 from prigault at oricom dot ca 2006-04-12 14:00 ------- IMO, the line defining c should trigger an error message because it needs to use c before creating the variable, or else undefined behaviour occurs. This message could be: error: ‘c’ was not declared in this scope or: error: 'c' is used uninitialized Consider: $ more test.cc #include static const float f = 1 - a; int main(void) { printf("%f\n", f); return 0; } $ g++ -Wall -O2 -o test test.cc test.cc:3: error: ‘a’ was not declared in this scope $ more test1.cc #include static const float f = 1 - f; int main(void) { printf("%f\n", f); return 0; } $ g++ -Wall -O2 -o test1 test1.cc $ There should be an error message there as well. -- prigault at oricom dot ca changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |prigault at oricom dot ca http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27129