[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / SemaCXX / coroutine-no-valid-dealloc.cpp
bloba5727d6f003bf8d518998f9d90ed72bf379a765f
1 // Test that if the compiler will emit error message if the promise_type contain
2 // operator delete but none of them are available. This is required by the standard.
3 // RUN: %clang_cc1 %s -std=c++20 %s -fsyntax-only -verify
5 #include "Inputs/std-coroutine.h"
7 namespace std {
8 typedef __SIZE_TYPE__ size_t;
9 enum class align_val_t : size_t {};
12 struct task {
13 struct promise_type {
14 auto initial_suspend() { return std::suspend_always{}; }
15 auto final_suspend() noexcept { return std::suspend_always{}; }
16 auto get_return_object() { return task{}; }
17 void unhandled_exception() {}
18 void return_value(int) {}
20 void operator delete(void *ptr, void *meaningless_placeholder); // expected-note {{member 'operator delete' declared here}}
24 task f() { // expected-error 1+{{no suitable member 'operator delete' in 'promise_type'}}
25 co_return 43;