X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=gcc%2Ftestsuite%2Fg%2B%2B.old-deja%2Fg%2B%2B.other%2Fdelete4.C;fp=gcc%2Ftestsuite%2Fg%2B%2B.old-deja%2Fg%2B%2B.other%2Fdelete4.C;h=0000000000000000000000000000000000000000;hb=6fed43773c9b0ce596dca5686f37ac3fc0fa11c0;hp=74ddcdd15456c9cfb33a268fafb330c5c520c636;hpb=27b11d56b743098deb193d510b337ba22dc52e5c;p=msp430-gcc.git diff --git a/gcc/testsuite/g++.old-deja/g++.other/delete4.C b/gcc/testsuite/g++.old-deja/g++.other/delete4.C deleted file mode 100644 index 74ddcdd1..00000000 --- a/gcc/testsuite/g++.old-deja/g++.other/delete4.C +++ /dev/null @@ -1,53 +0,0 @@ -// Build don't link: - -// Copyright (C) 1999 Free Software Foundation, Inc. -// Contributed by Nathan Sidwell 15 Apr 1999 - -// delete (void *)e and delete[] (void *)e result in undefined behaviour -// [expr.delete/3]. Check we warn about them -// operator new functions can only return NULL, if their exceptions -// specification is `throw()'. All other cases must return a non-null pointer -// [expr.new/13]. - -typedef __SIZE_TYPE__ size_t; - -void *operator new(size_t) -{ - return 0; // ERROR - cannot return NULL -} -void *operator new[](size_t) -{ - return 0; // ERROR - cannot return NULL -} - -struct X -{ - void *operator new(size_t) - { - return 0; // ERROR - cannot return NULL - } - void *operator new[](size_t) - { - return 0; // ERROR - cannot return NULL - } -}; - -struct Y -{ - void *operator new(size_t) throw() - { - return 0; // ok - } - void *operator new[](size_t) throw() - { - return 0; // ok - } -}; - -void fn(double *d, void *v) -{ - delete d; // ok - delete v; // WARNING - deleting void - delete[] d; // ok - delete[] v; // WARNING - deleting void -}