blob: 27bc7e5cf94e0cfe86a79b666a6fec5d223e7432 [file] [log] [blame]
Richard Smithba41a732014-03-17 08:20:10 +00001// RUN: %clang_cc1 -std=c++98 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -DNOEXCEPT="throw()" -DBAD_ALLOC="throw(std::bad_alloc)"
2// RUN: %clang_cc1 -std=c++11 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -DNOEXCEPT=noexcept -DBAD_ALLOC=
Richard Smith09c07782014-09-28 21:56:04 +00003// RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -DNOEXCEPT=noexcept -DBAD_ALLOC=
4// RUN: %clang_cc1 -std=c++1z %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -DNOEXCEPT=noexcept -DBAD_ALLOC=
Richard Smithba41a732014-03-17 08:20:10 +00005
6// dr412: yes
7// lwg404: yes
8// lwg2340: yes
9
Richard Smith6a70c642014-03-18 00:30:09 +000010// FIXME: __SIZE_TYPE__ expands to 'long long' on some targets.
11__extension__ typedef __SIZE_TYPE__ size_t;
Richard Smithba41a732014-03-17 08:20:10 +000012namespace std { struct bad_alloc {}; }
Richard Smith65045972014-03-17 16:53:13 +000013
Richard Smithba41a732014-03-17 08:20:10 +000014inline void* operator new(size_t) BAD_ALLOC; // expected-error {{cannot be declared 'inline'}}
15inline void* operator new[](size_t) BAD_ALLOC; // expected-error {{cannot be declared 'inline'}}
16inline void operator delete(void*) NOEXCEPT; // expected-error {{cannot be declared 'inline'}}
17inline void operator delete[](void*) NOEXCEPT; // expected-error {{cannot be declared 'inline'}}
Reid Kleckner7ffc3fb2015-03-20 00:31:07 +000018#ifdef __cpp_sized_deallocation
Richard Smithba41a732014-03-17 08:20:10 +000019inline void operator delete(void*, size_t) NOEXCEPT; // expected-error {{cannot be declared 'inline'}}
20inline void operator delete[](void*, size_t) NOEXCEPT; // expected-error {{cannot be declared 'inline'}}
21#endif