From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21150 invoked by alias); 19 Feb 2004 15:06:49 -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 20979 invoked by uid 48); 19 Feb 2004 15:06:45 -0000 Date: Thu, 19 Feb 2004 15:06:00 -0000 From: "d dot binderman at virgin dot net" To: gcc-bugs@gcc.gnu.org Message-ID: <20040219150624.14211.d.binderman@virgin.net> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/14211] New: missing lvalue check ? X-Bugzilla-Reason: CC X-SW-Source: 2004-02/txt/msg01910.txt.bz2 List-Id: // Given the following C++ code void f( char * str) { char * & m = const_cast( str); } /* then g++ 332 says not a lot. [dcb@localhost src]$ ~/gnu/gcc332/results/bin/g++ -c -g -O2 -Wall -ansi -pedantic cc.cc cc.cc: In function `void f(char*)': cc.cc:7: warning: unused variable `char*&m' [dcb@localhost src]$ But Intel C++ 8.0 says [dcb@localhost src]$ icc cc.cc cc.cc(7): error: initial value of reference to non-const must be an lvalue char * & m = const_cast( str); ^ compilation aborted for cc.cc (code 2) [dcb@localhost src]$ One compiler must be wrong. */ -- Summary: missing lvalue check ? Product: gcc Version: 3.3.2 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: d dot binderman at virgin dot net CC: gcc-bugs at gcc dot gnu dot org GCC host triplet: linux/i386 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14211