Debian Codegraph @

gcc/testsuite/g++.dg/coroutines/co-yield-syntax-04-ctor-dtor.C

raw
1 // { dg-additional-options "-fsyntax-only -w" }
2
3 #include "coro.h"
4
5 struct Foo {
6 Foo () { co_yield 4; } // { dg-error "cannot be used in a constructor" }
7 ~Foo () { co_yield 4; } // { dg-error "cannot be used in a destructor" }
8 };