xref: /minix3/external/bsd/llvm/dist/clang/test/CXX/drs/dr412.cpp (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -std=c++98 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -DNOEXCEPT="throw()" -DBAD_ALLOC="throw(std::bad_alloc)"
2*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -std=c++11 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -DNOEXCEPT=noexcept -DBAD_ALLOC=
3*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -DNOEXCEPT=noexcept -DBAD_ALLOC=
4*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -std=c++1z %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -DNOEXCEPT=noexcept -DBAD_ALLOC=
5*0a6a1f1dSLionel Sambuc 
6*0a6a1f1dSLionel Sambuc // dr412: yes
7*0a6a1f1dSLionel Sambuc // lwg404: yes
8*0a6a1f1dSLionel Sambuc // lwg2340: yes
9*0a6a1f1dSLionel Sambuc 
10*0a6a1f1dSLionel Sambuc // FIXME: __SIZE_TYPE__ expands to 'long long' on some targets.
11*0a6a1f1dSLionel Sambuc __extension__ typedef __SIZE_TYPE__ size_t;
12*0a6a1f1dSLionel Sambuc namespace std { struct bad_alloc {}; }
13*0a6a1f1dSLionel Sambuc 
14*0a6a1f1dSLionel Sambuc inline void* operator new(size_t) BAD_ALLOC; // expected-error {{cannot be declared 'inline'}}
15*0a6a1f1dSLionel Sambuc inline void* operator new[](size_t) BAD_ALLOC; // expected-error {{cannot be declared 'inline'}}
16*0a6a1f1dSLionel Sambuc inline void operator delete(void*) NOEXCEPT; // expected-error {{cannot be declared 'inline'}}
17*0a6a1f1dSLionel Sambuc inline void operator delete[](void*) NOEXCEPT; // expected-error {{cannot be declared 'inline'}}
18*0a6a1f1dSLionel Sambuc #if __cplusplus >= 201402L
19*0a6a1f1dSLionel Sambuc inline void operator delete(void*, size_t) NOEXCEPT; // expected-error {{cannot be declared 'inline'}}
20*0a6a1f1dSLionel Sambuc inline void operator delete[](void*, size_t) NOEXCEPT; // expected-error {{cannot be declared 'inline'}}
21*0a6a1f1dSLionel Sambuc #endif
22