[libc++][NFC] Remove trailing whitespace from release notes
[llvm-project.git] / clang / test / CXX / basic / basic.stc / basic.stc.dynamic / p2.cpp
bloba5d80fd0ce3fbadc7019f7e1cd224cc6aab312f9
1 // RUN: %clang_cc1 -fsyntax-only -fexceptions -fcxx-exceptions -verify -Wno-dynamic-exception-spec %std_cxx98- %s
2 int *use_new(int N) {
3 if (N == 1)
4 return new int;
6 return new int [N];
9 void use_delete(int* ip, int N) {
10 if (N == 1)
11 delete ip;
12 else
13 delete [] ip;
16 namespace std {
17 class bad_alloc { };
19 typedef __SIZE_TYPE__ size_t;
22 void* operator new(std::size_t) throw(std::bad_alloc);
23 #if __cplusplus < 201103L
24 // expected-note@-2 {{previous declaration}}
25 #endif
27 void* operator new[](std::size_t) throw(std::bad_alloc);
28 void operator delete(void*) throw(); // expected-note{{previous declaration}}
29 void operator delete[](void*) throw();
31 void* operator new(std::size_t);
32 #if __cplusplus < 201103L
33 // expected-warning@-2 {{'operator new' is missing exception specification 'throw(std::bad_alloc)'}}
34 #endif
35 void operator delete(void*);
36 #if __cplusplus < 201103L
37 // expected-warning@-2 {{'operator delete' is missing exception specification 'throw()'}}
38 #else
39 // expected-warning@-4 {{previously declared with an explicit exception specification redeclared with an implicit}}
40 #endif