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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [init/] [placement4.C] - Rev 801

Go to most recent revision | Compare with Previous | Blame | View Log

// PR c++/34158

typedef __SIZE_TYPE__ size_t;
extern "C" void* malloc (size_t);
extern "C" void free (void *);

template <class T> class undef;

struct A {
  A() { throw 1; }
};

template<typename T> class Pool { };

void *operator new(size_t size,Pool<int>& pool)
{
  return malloc(size);
}

template<typename T>
void operator delete(void *p,Pool<T>& pool)
{
  undef<T> t;                   // { dg-error "incomplete" }
  free(p);
}

int main ()
{
  Pool<int> pool;
  new (pool) A();               // { dg-message "required" }
  return 0;
}

Go to most recent revision | 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.