]>
Commit | Line | Data |
---|---|---|
e0b2a9fb | 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" } | |
40e2decb | 8 | // { dg-error "dynamic exception specification" "" { target c++17 } .-1 } |
9 | // { dg-warning "deprecated" "" { target { c++11 && { ! c++17 } } } .-2 } | |
e0b2a9fb | 10 | void* operator new[](std::size_t = 32) throw (std::bad_alloc); // { dg-error "first parameter" } |
40e2decb | 11 | // { dg-error "dynamic exception specification" "" { target c++17 } .-1 } |
12 | // { dg-warning "deprecated" "" { target { c++11 && { ! c++17 } } } .-2 } | |
e0b2a9fb | 13 | void* operator new(std::size_t = 32, const std::nothrow_t&) throw(); // { dg-error "first parameter" } |
14 | void* operator new[](std::size_t = 32, const std::nothrow_t&) throw(); // { dg-error "first parameter" } | |
15 | }; | |
16 | ||
17 | class D | |
18 | { | |
19 | public: | |
20 | void* operator new(std::size_t, | |
21 | const std::nothrow_t& = std::nothrow_t()) throw(); | |
22 | void* operator new[](std::size_t, | |
23 | const std::nothrow_t& = std::nothrow_t()) throw(); | |
24 | }; | |
25 | ||
26 | class E | |
27 | { | |
28 | public: | |
29 | void* operator new(std::size_t = 0, | |
30 | const std::nothrow_t& = std::nothrow_t()) throw(); // { dg-error "first parameter" } | |
31 | void* operator new[](std::size_t = 0, | |
32 | const std::nothrow_t& = std::nothrow_t()) throw(); // { dg-error "first parameter" } | |
33 | }; |