2014-03-17 08:20:10 +00:00
|
|
|
// RUN: %clang_cc1 -std=c++98 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -DNOEXCEPT="throw()" -DBAD_ALLOC="throw(std::bad_alloc)"
|
|
|
|
// RUN: %clang_cc1 -std=c++11 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -DNOEXCEPT=noexcept -DBAD_ALLOC=
|
2014-09-28 21:56:04 +00:00
|
|
|
// RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -DNOEXCEPT=noexcept -DBAD_ALLOC=
|
2023-12-08 12:10:57 +04:00
|
|
|
// RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -DNOEXCEPT=noexcept -DBAD_ALLOC=
|
|
|
|
// RUN: %clang_cc1 -std=c++20 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -DNOEXCEPT=noexcept -DBAD_ALLOC=
|
|
|
|
// RUN: %clang_cc1 -std=c++23 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -DNOEXCEPT=noexcept -DBAD_ALLOC=
|
|
|
|
// RUN: %clang_cc1 -std=c++2c %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -DNOEXCEPT=noexcept -DBAD_ALLOC=
|
2014-03-17 08:20:10 +00:00
|
|
|
|
2024-04-13 08:28:02 +03:00
|
|
|
// cwg412: 3.4
|
2014-03-17 08:20:10 +00:00
|
|
|
// lwg404: yes
|
|
|
|
// lwg2340: yes
|
|
|
|
|
2014-03-18 00:30:09 +00:00
|
|
|
// FIXME: __SIZE_TYPE__ expands to 'long long' on some targets.
|
|
|
|
__extension__ typedef __SIZE_TYPE__ size_t;
|
2014-03-17 08:20:10 +00:00
|
|
|
namespace std { struct bad_alloc {}; }
|
2014-03-17 16:53:13 +00:00
|
|
|
|
2023-12-08 12:10:57 +04:00
|
|
|
inline void* operator new(size_t) BAD_ALLOC;
|
|
|
|
// expected-error@-1 {{replacement function 'operator new' cannot be declared 'inline'}}
|
|
|
|
inline void* operator new[](size_t) BAD_ALLOC;
|
|
|
|
// expected-error@-1 {{replacement function 'operator new[]' cannot be declared 'inline'}}
|
|
|
|
inline void operator delete(void*) NOEXCEPT;
|
|
|
|
// expected-error@-1 {{replacement function 'operator delete' cannot be declared 'inline'}}
|
|
|
|
inline void operator delete[](void*) NOEXCEPT;
|
|
|
|
// expected-error@-1 {{replacement function 'operator delete[]' cannot be declared 'inline'}}
|
2015-03-20 00:31:07 +00:00
|
|
|
#ifdef __cpp_sized_deallocation
|
2023-12-08 12:10:57 +04:00
|
|
|
inline void operator delete(void*, size_t) NOEXCEPT;
|
|
|
|
// expected-error@-1 {{replacement function 'operator delete' cannot be declared 'inline'}}
|
|
|
|
inline void operator delete[](void*, size_t) NOEXCEPT;
|
|
|
|
// expected-error@-1 {{replacement function 'operator delete[]' cannot be declared 'inline'}}
|
2014-03-17 08:20:10 +00:00
|
|
|
#endif
|