view gcc/testsuite/g++.dg/coroutines/coro-bad-alloc-02-no-op-new-nt.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 -w" }

// check error for missing new (size, nothrow).

#define PROVIDE_NEW_SZT
#define PROVIDE_DEL_VP
#define PROVIDE_GROOAF

#include "coro1-allocators.h"

struct coro1
f () /* { dg-error {'coro1::promise_type::get_return_object_on_allocation_failure\(\)\(\)' is provided by 'std::__n4835::coroutine_traits<coro1>::promise_type' \{aka 'coro1::promise_type'\} but 'operator new' is not marked 'throw\(\)' or 'noexcept'} } */
{
  co_return;
}