public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/17670] New: [4.0 regression] new (type-id) parsed as array-new
@ 2004-09-25 19:40 schwab at suse dot de
  2004-09-25 19:48 ` [Bug c++/17670] " pinskia at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: schwab at suse dot de @ 2004-09-25 19:40 UTC (permalink / raw)
  To: gcc-bugs

The expression "new (type-id)" is always parsed as array new operator even if  
type-id is not an array type.  
  
$ cat new.cc  
struct X {};  
X *new_X () { return new (X); }  
$ gcc -S new.cc  
$ c++filt < new.s | grep operator  
	br.call.sptk.many b0 = operator new[](unsigned long)#  
  
  
This is caused by this change:  
  
2004-06-21  Mark Mitchell  <mark@codesourcery.com>  
  
	* cp-tree.def (NEW_EXPR): Add a fourth slot.  
	...

-- 
           Summary: [4.0 regression] new (type-id) parsed as array-new
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: critical
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: schwab at suse dot de
                CC: gcc-bugs at gcc dot gnu dot org,mark at codesourcery dot
                    com


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


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

* [Bug c++/17670] [4.0 regression] new (type-id) parsed as array-new
  2004-09-25 19:40 [Bug c++/17670] New: [4.0 regression] new (type-id) parsed as array-new schwab at suse dot de
@ 2004-09-25 19:48 ` pinskia at gcc dot gnu dot org
  2004-10-03 23:30 ` mmitchel 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-09-25 19:48 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-09-25 19:48 -------
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-09-25 19:48:45
               date|                            |
   Target Milestone|---                         |4.0.0


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


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

* [Bug c++/17670] [4.0 regression] new (type-id) parsed as array-new
  2004-09-25 19:40 [Bug c++/17670] New: [4.0 regression] new (type-id) parsed as array-new schwab at suse dot de
  2004-09-25 19:48 ` [Bug c++/17670] " pinskia at gcc dot gnu dot org
@ 2004-10-03 23:30 ` mmitchel at gcc dot gnu dot org
  2004-10-10  5:03 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-10-03 23:30 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=17670


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

* [Bug c++/17670] [4.0 regression] new (type-id) parsed as array-new
  2004-09-25 19:40 [Bug c++/17670] New: [4.0 regression] new (type-id) parsed as array-new schwab at suse dot de
  2004-09-25 19:48 ` [Bug c++/17670] " pinskia at gcc dot gnu dot org
  2004-10-03 23:30 ` mmitchel at gcc dot gnu dot org
@ 2004-10-10  5:03 ` cvs-commit at gcc dot gnu dot org
  2004-10-10  5:28 ` cvs-commit at gcc dot gnu dot org
  2004-10-10  5:35 ` 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-10-10  5:03 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-10-10 05:03 -------
Subject: Bug 17670

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	mmitchel@gcc.gnu.org	2004-10-10 05:02:54

Modified files:
	gcc/testsuite  : ChangeLog 
	gcc/cp         : ChangeLog error.c init.c parser.c tree.c 
Added files:
	gcc/testsuite/g++.dg/init: new11.C 
	gcc/testsuite/g++.dg/parse: error19.C error20.C 
	gcc/testsuite/g++.dg/template: crash24.C 

Log message:
	PR c++/17867
	* error.c (dump_expr): Correct handling of AGGR_INIT_EXPRs using a
	constructor.
	
	PR c++/17670
	* init.c (build_new): Correct comments.
	* parser.c (cp_parser_new_expression): Use NULL_TREE for nelts in
	the non-array case.
	
	PR c++/17821
	* parser.c (cp_parser_postfix_dot_deref_expression): If the
	pseduo-destructor-name production does not work, fall back to the
	ordinary production.
	
	PR c++/17826
	* tree.c (cp_tree_equal): Handle a BASELINK.
	
	PR c++/17687
	* g++.dg/parse/error19.C: New test.
	
	PR c++/17670
	* g++.dg/init/new11.C: New test.
	
	PR c++/17821
	* g++.dg/parse/error20.C: New test.
	
	PR c++/17826
	* g++.dg/template/crash24.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4426&r2=1.4427
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4416&r2=1.4417
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/error.c.diff?cvsroot=gcc&r1=1.266&r2=1.267
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/init.c.diff?cvsroot=gcc&r1=1.398&r2=1.399
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&r1=1.261&r2=1.262
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/tree.c.diff?cvsroot=gcc&r1=1.413&r2=1.414
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/init/new11.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/error19.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/error20.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/crash24.C.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


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


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

* [Bug c++/17670] [4.0 regression] new (type-id) parsed as array-new
  2004-09-25 19:40 [Bug c++/17670] New: [4.0 regression] new (type-id) parsed as array-new schwab at suse dot de
                   ` (2 preceding siblings ...)
  2004-10-10  5:03 ` cvs-commit at gcc dot gnu dot org
@ 2004-10-10  5:28 ` cvs-commit at gcc dot gnu dot org
  2004-10-10  5:35 ` 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-10-10  5:28 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-10-10 05:28 -------
Subject: Bug 17670

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	mmitchel@gcc.gnu.org	2004-10-10 05:28:32

Modified files:
	gcc/testsuite  : ChangeLog 
	gcc/cp         : ChangeLog parser.c tree.c 
Added files:
	gcc/testsuite/g++.dg/parse: error20.C 
	gcc/testsuite/g++.dg/template: crash24.C 

Log message:
	PR c++/17867
	* error.c (dump_expr): Correct handling of AGGR_INIT_EXPRs using a
	constructor.
	
	PR c++/17670
	* init.c (build_new): Correct comments.
	* parser.c (cp_parser_new_expression): Use NULL_TREE for nelts in
	the non-array case.
	
	PR c++/17821
	* parser.c (cp_parser_postfix_dot_deref_expression): If the
	pseduo-destructor-name production does not work, fall back to the
	ordinary production.
	
	PR c++/17826
	* tree.c (cp_tree_equal): Handle a BASELINK.
	
	PR c++/17687
	* g++.dg/parse/error19.C: New test.
	
	PR c++/17670
	* g++.dg/init/new11.C: New test.
	
	PR c++/17821
	* g++.dg/parse/error20.C: New test.
	
	PR c++/17826
	* g++.dg/template/crash24.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3389.2.281&r2=1.3389.2.282
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3892.2.165&r2=1.3892.2.166
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.157.2.42&r2=1.157.2.43
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/tree.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.360.4.9&r2=1.360.4.10
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/error20.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/crash24.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1



-- 


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


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

* [Bug c++/17670] [4.0 regression] new (type-id) parsed as array-new
  2004-09-25 19:40 [Bug c++/17670] New: [4.0 regression] new (type-id) parsed as array-new schwab at suse dot de
                   ` (3 preceding siblings ...)
  2004-10-10  5:28 ` cvs-commit at gcc dot gnu dot org
@ 2004-10-10  5:35 ` 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-10  5:35 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2004-10-10 05:35 -------
Fixed in GCC 4.0.

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


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


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

end of thread, other threads:[~2004-10-10  5:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-25 19:40 [Bug c++/17670] New: [4.0 regression] new (type-id) parsed as array-new schwab at suse dot de
2004-09-25 19:48 ` [Bug c++/17670] " pinskia at gcc dot gnu dot org
2004-10-03 23:30 ` mmitchel at gcc dot gnu dot org
2004-10-10  5:03 ` cvs-commit at gcc dot gnu dot org
2004-10-10  5:28 ` cvs-commit at gcc dot gnu dot org
2004-10-10  5:35 ` 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).