blob: cb33e206a632fb56eb0d84f2b843f0e0cb97ca34 [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=
3// RUN: %clang_cc1 -std=c++1y %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -DNOEXCEPT=noexcept -DBAD_ALLOC=
4
5// dr412: yes
6// lwg404: yes
7// lwg2340: yes
8
Richard Smith6a70c642014-03-18 00:30:09 +00009// FIXME: __SIZE_TYPE__ expands to 'long long' on some targets.
10__extension__ typedef __SIZE_TYPE__ size_t;
Richard Smithba41a732014-03-17 08:20:10 +000011namespace std { struct bad_alloc {}; }
Richard Smith65045972014-03-17 16:53:13 +000012
Richard Smithba41a732014-03-17 08:20:10 +000013inline void* operator new(size_t) BAD_ALLOC; // expected-error {{cannot be declared 'inline'}}
14inline void* operator new[](size_t) BAD_ALLOC; // expected-error {{cannot be declared 'inline'}}
15inline void operator delete(void*) NOEXCEPT; // expected-error {{cannot be declared 'inline'}}
16inline void operator delete[](void*) NOEXCEPT; // expected-error {{cannot be declared 'inline'}}
17#if __cplusplus >= 201402L
18inline void operator delete(void*, size_t) NOEXCEPT; // expected-error {{cannot be declared 'inline'}}
19inline void operator delete[](void*, size_t) NOEXCEPT; // expected-error {{cannot be declared 'inline'}}
20#endif