public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/14211] New: missing lvalue check ?
@ 2004-02-19 15:06 d dot binderman at virgin dot net
  2004-02-20 21:30 ` [Bug c++/14211] " bangerth at dealii dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: d dot binderman at virgin dot net @ 2004-02-19 15:06 UTC (permalink / raw)
  To: gcc-bugs

// Given the following C++ code

void f( char * str)
{

	char * & m = const_cast<char *>( 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<char *>( 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


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

end of thread, other threads:[~2004-06-10 14:30 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-19 15:06 [Bug c++/14211] New: missing lvalue check ? d dot binderman at virgin dot net
2004-02-20 21:30 ` [Bug c++/14211] " bangerth at dealii dot org
2004-02-23  1:42 ` [Bug c++/14211] [3.3/3.4/3.5 Regression] const_cast should return lvalues giovannibajo at libero dot it
2004-04-28  2:05 ` [Bug c++/14211] [3.3/3.4/3.5 Regression] const_cast returns lvalue but should be rvalue pinskia at gcc dot gnu dot org
2004-06-06  3:36 ` giovannibajo at libero dot it
2004-06-09 19:11 ` mmitchel at gcc dot gnu dot org
2004-06-10 14:27 ` cvs-commit at gcc dot gnu dot org
2004-06-10 14:27 ` cvs-commit at gcc dot gnu dot org
2004-06-10 14:30 ` mmitchel at gcc dot gnu dot org
2004-06-10 14:30 ` mmitchel at gcc dot gnu dot 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).