| 1 |
// PR sanitizer/102656 |
| 2 |
// { dg-do compile } |
| 3 |
// { dg-options "-std=c++20 -fsanitize=address" } |
| 4 |
|
| 5 |
#include <coroutine> |
| 6 |
|
| 7 |
class promise; |
| 8 |
|
| 9 |
struct future { |
| 10 |
using promise_type = promise; |
| 11 |
future() = default; |
| 12 |
int x = 0; |
| 13 |
}; |
| 14 |
|
| 15 |
struct promise { |
| 16 |
future get_return_object() noexcept { return {}; } |
| 17 |
auto initial_suspend() noexcept { return std::suspend_never{}; } |
| 18 |
auto final_suspend() noexcept { return std::suspend_never{}; } |
| 19 |
void return_void() noexcept {} |
| 20 |
void unhandled_exception() {} |
| 21 |
}; |
| 22 |
|
| 23 |
future |
| 24 |
func () |
| 25 |
{ |
| 26 |
co_return; |
| 27 |
} |