view gcc/testsuite/g++.dg/coroutines/pr93458-4-bad-coro-handle.C @ 145:1830386684a0

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

//  { dg-additional-options "-fsyntax-only -fexceptions -w" }

// Diagose missing coroutine handle class template.

namespace std {
  //  coroutine traits
  template<typename _R, typename...> struct coroutine_traits {
    using promise_type = typename _R::promise_type;
  };

  // name is present, but not a template.
  struct coroutine_handle {
  };
}

int
bad_coroutine (void)
{
  co_yield 5; // { dg-error {coroutines require a handle class template; cannot find 'std::coroutine_handle'} }
  co_return;
}