This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/17670] New: [4.0 regression] new (type-id) parsed as array-new


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]