Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
clang/test/SemaCXX/unavailable_aligned_allocation.cpp
Show First 20 Lines • Show All 68 Lines • ▼ Show 20 Lines | |||||
// expected-note@-17 {{if you supply your own aligned allocation functions}} | // expected-note@-17 {{if you supply your own aligned allocation functions}} | ||||
// expected-error-re@-18 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is {{only|not}} available on}} | // expected-error-re@-18 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is {{only|not}} available on}} | ||||
// expected-note@-19 {{if you supply your own aligned allocation functions}} | // expected-note@-19 {{if you supply your own aligned allocation functions}} | ||||
// expected-error-re@-20 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is {{only|not}} available on}} | // expected-error-re@-20 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is {{only|not}} available on}} | ||||
// expected-note@-21 {{if you supply your own aligned allocation functions}} | // expected-note@-21 {{if you supply your own aligned allocation functions}} | ||||
// expected-error-re@-22 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is {{only|not}} available on}} | // expected-error-re@-22 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is {{only|not}} available on}} | ||||
// expected-note@-23 {{if you supply your own aligned allocation functions}} | // expected-note@-23 {{if you supply your own aligned allocation functions}} | ||||
#if !defined(ZOS) | |||||
// expected-error-re@-24 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is {{only|not}} available on}} | // expected-error-re@-24 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is {{only|not}} available on}} | ||||
// expected-note@-25 {{if you supply your own aligned allocation functions}} | // expected-note@-25 {{if you supply your own aligned allocation functions}} | ||||
#else | |||||
// expected-error-re@-26 {{aligned allocation function of type 'void *(std::size_t, std::align_val_t, const std::nothrow_t &) noexcept' is {{only|not}} available on}} | // expected-error@-27 {{aligned deallocation function of type 'void (void *, std::size_t, std::align_val_t) noexcept' is not available on z/OS}} | ||||
// expected-note@-27 {{if you supply your own aligned allocation functions}} | // expected-note@-28 {{if you supply your own aligned allocation functions}} | ||||
// expected-error-re@-28 {{aligned deallocation function of type 'void (void *, std::align_val_t, const std::nothrow_t &) noexcept' is {{only|not}} available on}} | #endif | ||||
// expected-note@-29 {{if you supply your own aligned allocation functions}} | // expected-error-re@-29 {{aligned allocation function of type 'void *(std::size_t, std::align_val_t, const std::nothrow_t &) noexcept' is {{only|not}} available on}} | ||||
// expected-error-re@-29 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is {{only|not}} available on}} | |||||
// expected-note@-30 {{if you supply your own aligned allocation functions}} | // expected-note@-30 {{if you supply your own aligned allocation functions}} | ||||
// expected-error-re@-31 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is {{only|not}} available on}} | // expected-error-re@-31 {{aligned deallocation function of type 'void (void *, std::align_val_t, const std::nothrow_t &) noexcept' is {{only|not}} available on}} | ||||
// expected-note@-32 {{if you supply your own aligned allocation functions}} | // expected-note@-32 {{if you supply your own aligned allocation functions}} | ||||
// expected-error-re@-33 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is {{only|not}} available on}} | // expected-error-re@-32 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is {{only|not}} available on}} | ||||
// expected-note@-34 {{if you supply your own aligned allocation functions}} | // expected-note@-33 {{if you supply your own aligned allocation functions}} | ||||
// expected-error-re@-35 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is {{only|not}} available on}} | // expected-error-re@-34 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is {{only|not}} available on}} | ||||
// expected-note@-36 {{if you supply your own aligned allocation functions}} | // expected-note@-35 {{if you supply your own aligned allocation functions}} | ||||
// expected-error-re@-37 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is {{only|not}} available on}} | // expected-error-re@-36 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is {{only|not}} available on}} | ||||
// expected-note@-38 {{if you supply your own aligned allocation functions}} | // expected-note@-37 {{if you supply your own aligned allocation functions}} | ||||
// expected-error-re@-38 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is {{only|not}} available on}} | |||||
// expected-error-re@-39 {{aligned allocation function of type 'void *(std::size_t, std::align_val_t, const std::nothrow_t &) noexcept' is {{only|not}} available on}} | // expected-note@-39 {{if you supply your own aligned allocation functions}} | ||||
// expected-note@-40 {{if you supply your own aligned allocation functions}} | |||||
// expected-error-re@-41 {{aligned deallocation function of type 'void (void *, std::align_val_t, const std::nothrow_t &) noexcept' is {{only|not}} available on}} | // expected-error-re@-40 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is {{only|not}} available on}} | ||||
// expected-note@-42 {{if you supply your own aligned allocation functions}} | // expected-note@-41 {{if you supply your own aligned allocation functions}} | ||||
// expected-error-re@-42 {{aligned allocation function of type 'void *(std::size_t, std::align_val_t, const std::nothrow_t &) noexcept' is {{only|not}} available on}} | |||||
// expected-note@-43 {{if you supply your own aligned allocation functions}} | |||||
// expected-error-re@-44 {{aligned deallocation function of type 'void (void *, std::align_val_t, const std::nothrow_t &) noexcept' is {{only|not}} available on}} | |||||
// expected-note@-45 {{if you supply your own aligned allocation functions}} | |||||
#endif | #endif | ||||
void testOveralignedCheckOS() { | void testOveralignedCheckOS() { | ||||
auto *p = new OveralignedS; | auto *p = new OveralignedS; | ||||
} | } | ||||
#ifdef NO_ERRORS | #ifdef NO_ERRORS | ||||
Show All 39 Lines | |||||
// expected-note@-10 {{if you supply your own aligned allocation functions}} | // expected-note@-10 {{if you supply your own aligned allocation functions}} | ||||
#elif defined(WATCHOS) | #elif defined(WATCHOS) | ||||
// expected-error@-12 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is only available on watchOS 4 or newer}}} | // expected-error@-12 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is only available on watchOS 4 or newer}}} | ||||
// expected-note@-13 {{if you supply your own aligned allocation functions}} | // expected-note@-13 {{if you supply your own aligned allocation functions}} | ||||
#elif defined(MACOS) | #elif defined(MACOS) | ||||
// expected-error@-15 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is only available on macOS 10.14 or newer}}} | // expected-error@-15 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is only available on macOS 10.14 or newer}}} | ||||
// expected-note@-16 {{if you supply your own aligned allocation functions}} | // expected-note@-16 {{if you supply your own aligned allocation functions}} | ||||
#elif defined(ZOS) | #elif defined(ZOS) | ||||
// expected-error@-18 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is not available on z/OS}}} | // expected-error@-18 {{aligned deallocation function of type 'void (void *, std::size_t, std::align_val_t) noexcept' is not available on z/OS}}} | ||||
// expected-note@-19 {{if you supply your own aligned allocation functions}} | // expected-note@-19 {{if you supply your own aligned allocation functions}} | ||||
#endif | #endif | ||||
#endif | #endif | ||||
void testExplicitOperatorNewDelete() { | void testExplicitOperatorNewDelete() { | ||||
void *p = operator new(128); | void *p = operator new(128); | ||||
operator delete(p); | operator delete(p); | ||||
p = operator new[](128); | p = operator new[](128); | ||||
Show All 40 Lines | |||||
} | } | ||||
void operator delete(void *p, std::align_val_t) { | void operator delete(void *p, std::align_val_t) { | ||||
} | } | ||||
void testOveraligned2() { | void testOveraligned2() { | ||||
auto p = new ((std::align_val_t)8) OveralignedS; | auto p = new ((std::align_val_t)8) OveralignedS; | ||||
delete p; | delete p; | ||||
#ifdef NO_ERRORS | |||||
// expected-no-diagnostics | |||||
#elif defined(ZOS) | |||||
// expected-error@-4 {{aligned deallocation function of type 'void (void *, std::size_t, std::align_val_t) noexcept' is not available on z/OS}} | |||||
// expected-note@-5 {{if you supply your own aligned allocation functions}} | |||||
#endif | |||||
} | } |