Commit 62b21ea0 by Benjamin Kosnik Committed by Benjamin Kosnik

11584.cc: Correct new and delete declarations, add include and test variable.


2004-01-27  Benjamin Kosnik  <bkoz@redhat.com>

	* testsuite/27_io/ios_base/storage/11584.cc: Correct new and
	delete declarations, add include and test variable.

From-SVN: r76766
parent 826b47cc
2004-01-27 Benjamin Kosnik <bkoz@redhat.com>
* testsuite/27_io/ios_base/storage/11584.cc: Correct new and
delete declarations, add include and test variable.
2003-01-27 Jerry Quinn <jlquinn@optonline.net>
* include/bits/codecvt.h, include/bits/locale_facets.h,
......
......@@ -22,24 +22,26 @@
#include <cstdlib>
#include <new>
#include <iostream>
#include <testsuite_hooks.h>
int new_fails;
void* operator new (size_t n)
void* operator new(std::size_t n) throw (std::bad_alloc)
{
if (new_fails)
throw std::bad_alloc();
return malloc(n);
}
void* operator new[] (std::size_t n) throw (std::bad_alloc)
{ return operator new(n); }
void operator delete (void *p) { free(p); }
void* operator new[] (size_t n) { return operator new(n); }
void operator delete[] (void *p) { operator delete(p); }
void operator delete (void *p) throw() { free(p); }
void operator delete[] (void *p) throw() { operator delete(p); }
int main ()
{
bool test __attribute__((unused)) = true;
const int i = std::ios::xalloc ();
new_fails = 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment