view gcc/testsuite/g++.dg/coroutines/coro-missing-ueh.h @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents
children
line wrap: on
line source

#ifndef __MissingUEH_H
#define __MissingUEH_H

/* Common code for testing missing unhandled_exception.  */
struct MissingUEH {
  coro::coroutine_handle<> handle;
  MissingUEH () : handle (nullptr) {}
  MissingUEH (coro::coroutine_handle<> handle) : handle (handle) {}
  struct missing_ueh {
    coro::suspend_never initial_suspend() { return {}; }
    coro::suspend_never final_suspend() { return {}; }
    MissingUEH get_return_object() {
      return MissingUEH (coro::coroutine_handle<missing_ueh>::from_promise (*this));
    }
    void return_void () {}
  };
};

template<> struct coro::coroutine_traits<MissingUEH> {
    using promise_type = MissingUEH::missing_ueh;
};

#endif