OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.law/] [operators23.C] - Rev 305

Compare with Previous | Blame | View Log

// { dg-do run  }
// GROUPS passed operators
// opr-new file
// From: (The Crossjammer) <xjam@cork.cs.berkeley.edu>
// Date:     Mon, 23 Nov 92 23:35:26 PST
// Subject:  g++-2.3.1 : Incorrectly calls overloaded operator new
// Message-ID: <9211240735.AA06872@cork.CS.Berkeley.EDU>


#include <stdio.h>
#include <stdlib.h>

class blah {
     int j;
   public:
     blah();
     void *operator new(size_t size) throw();
};

inline blah::blah() : j(0) {
          
}


void *blah::operator new(size_t size) throw(){
     printf ("FAIL\n");
     exit (1);
     return NULL;
}

int main(int arg, char** argv) {
     blah* blahPtr;

     blahPtr = new blah[100];
     printf ("PASS\n");
}

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.