OSDN Git Service

gcc/cp/
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / init / new25.C
1 // PR c++/31988
2 #include <new>
3
4 class C
5 {
6 public:
7   void* operator new(std::size_t = 32) throw (std::bad_alloc); // { dg-error "first parameter" }
8   void* operator new[](std::size_t = 32) throw (std::bad_alloc); // { dg-error "first parameter" }
9   void* operator new(std::size_t = 32, const std::nothrow_t&) throw(); // { dg-error "first parameter" }
10   void* operator new[](std::size_t = 32, const std::nothrow_t&) throw(); // { dg-error "first parameter" }
11 };
12
13 class D
14 {
15 public:
16   void* operator new(std::size_t,
17                      const std::nothrow_t& = std::nothrow_t()) throw();
18   void* operator new[](std::size_t,
19                        const std::nothrow_t& = std::nothrow_t()) throw();
20 };
21
22 class E
23 {
24 public:
25   void* operator new(std::size_t = 0,
26                      const std::nothrow_t& = std::nothrow_t()) throw(); // { dg-error "first parameter" }
27   void* operator new[](std::size_t = 0,
28                        const std::nothrow_t& = std::nothrow_t()) throw(); // { dg-error "first parameter" }
29 };