public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/18177] New: [4.0 regression] ICE with const_cast for undeclared variable
@ 2004-10-27 13:54 reichelt at gcc dot gnu dot org
  2004-10-27 13:58 ` [Bug c++/18177] " pinskia at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2004-10-27 13:54 UTC (permalink / raw)
  To: gcc-bugs

The following invalid code snippet causes an ICE when compiled with mainline:

=============================
void foo()
{
    X;
    const_cast<int&>(X);
}
=============================

bug.cc: In function `void foo()':
bug.cc:3: error: 'X' was not declared in this scope
bug.cc:4: internal compiler error: tree check: expected class 'type', have
'exceptional' (error_mark) in build_pointer_type_for_mode, at tree.c:4118
Please submit a full bug report, [etc.]

The regression appeared in March 2004:
: Search converges between 2004-03-01-trunk (#446) and 2004-04-01-trunk (#447).

-- 
           Summary: [4.0 regression] ICE with const_cast for undeclared
                    variable
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code, error-recovery, monitored
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: reichelt at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18177


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

* [Bug c++/18177] [4.0 regression] ICE with const_cast for undeclared variable
  2004-10-27 13:54 [Bug c++/18177] New: [4.0 regression] ICE with const_cast for undeclared variable reichelt at gcc dot gnu dot org
@ 2004-10-27 13:58 ` pinskia at gcc dot gnu dot org
  2004-10-27 14:29 ` reichelt at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-27 13:58 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-10-27 13:57 -------
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-10-27 13:57:53
               date|                            |
   Target Milestone|---                         |4.0.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18177


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

* [Bug c++/18177] [4.0 regression] ICE with const_cast for undeclared variable
  2004-10-27 13:54 [Bug c++/18177] New: [4.0 regression] ICE with const_cast for undeclared variable reichelt at gcc dot gnu dot org
  2004-10-27 13:58 ` [Bug c++/18177] " pinskia at gcc dot gnu dot org
@ 2004-10-27 14:29 ` reichelt at gcc dot gnu dot org
  2004-10-28 18:19 ` mmitchel at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2004-10-27 14:29 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From reichelt at gcc dot gnu dot org  2004-10-27 14:29 -------
Mark, the regression appears with your patch for PR14401:
http://gcc.gnu.org/ml/gcc-cvs/2004-03/msg00427.html

Could you please have a look?


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mark at codesourcery dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18177


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

* [Bug c++/18177] [4.0 regression] ICE with const_cast for undeclared variable
  2004-10-27 13:54 [Bug c++/18177] New: [4.0 regression] ICE with const_cast for undeclared variable reichelt at gcc dot gnu dot org
  2004-10-27 13:58 ` [Bug c++/18177] " pinskia at gcc dot gnu dot org
  2004-10-27 14:29 ` reichelt at gcc dot gnu dot org
@ 2004-10-28 18:19 ` mmitchel at gcc dot gnu dot org
  2004-11-03  2:48 ` cvs-commit at gcc dot gnu dot org
  2004-11-03  2:56 ` mmitchel at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-10-28 18:19 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |mark at codesourcery dot com
                   |dot org                     |
             Status|NEW                         |ASSIGNED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18177


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

* [Bug c++/18177] [4.0 regression] ICE with const_cast for undeclared variable
  2004-10-27 13:54 [Bug c++/18177] New: [4.0 regression] ICE with const_cast for undeclared variable reichelt at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2004-10-28 18:19 ` mmitchel at gcc dot gnu dot org
@ 2004-11-03  2:48 ` cvs-commit at gcc dot gnu dot org
  2004-11-03  2:56 ` mmitchel at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-11-03  2:48 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-11-03 02:48 -------
Subject: Bug 18177

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	mmitchel@gcc.gnu.org	2004-11-03 02:48:45

Modified files:
	gcc/cp         : ChangeLog parser.c typeck.c 
	gcc/testsuite  : ChangeLog 
	gcc/testsuite/g++.dg/parse: crash13.C 
Added files:
	gcc/testsuite/g++.dg/conversion: const3.C 
	gcc/testsuite/g++.dg/template: crash25.C typedef2.C 

Log message:
	PR c++/18124
	* parser.c (cp_parser_type_parameter): Robustify.
	
	PR c++/18155
	* parser.c (cp_parser_single_declaration): Disallow template
	typedefs.
	
	PR c++/18177
	* typeck.c (build_const_cast): Use error_operand_p.
	
	PR c++/18124
	* g++.dg/template/crash25.C: New test.
	
	PR c++/18155
	* g++.dg/template/typedef2.C: New test.
	* g++.dg/parse/crash13.C: Adjust error markers.
	
	PR c++/18177
	* g++.dg/conversion/const3.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4471&r2=1.4472
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&r1=1.275&r2=1.276
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/typeck.c.diff?cvsroot=gcc&r1=1.591&r2=1.592
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4537&r2=1.4538
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/conversion/const3.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/crash13.C.diff?cvsroot=gcc&r1=1.2&r2=1.3
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/crash25.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/typedef2.C.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18177


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

* [Bug c++/18177] [4.0 regression] ICE with const_cast for undeclared variable
  2004-10-27 13:54 [Bug c++/18177] New: [4.0 regression] ICE with const_cast for undeclared variable reichelt at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2004-11-03  2:48 ` cvs-commit at gcc dot gnu dot org
@ 2004-11-03  2:56 ` mmitchel at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-11-03  2:56 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2004-11-03 02:56 -------
Fixed in GCC 4.0.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18177


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

end of thread, other threads:[~2004-11-03  2:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-27 13:54 [Bug c++/18177] New: [4.0 regression] ICE with const_cast for undeclared variable reichelt at gcc dot gnu dot org
2004-10-27 13:58 ` [Bug c++/18177] " pinskia at gcc dot gnu dot org
2004-10-27 14:29 ` reichelt at gcc dot gnu dot org
2004-10-28 18:19 ` mmitchel at gcc dot gnu dot org
2004-11-03  2:48 ` cvs-commit at gcc dot gnu dot org
2004-11-03  2:56 ` 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).