1 // RUN: %clang_cc1 %s -std=c++20 -fsyntax-only -verify
2 // RUN: %clang_cc1 %s -std=c++20 -fsyntax-only -verify -fno-recovery-ast
3
4 namespace NoCrash {
5 struct ForwardDecl; // expected-note {{forward declaration of}}
6 struct Foo { // expected-note 2{{candidate constructor}}
7 ForwardDecl f; // expected-error {{field has incomplete type}}
8 };
9
getFoo()10 constexpr Foo getFoo() {
11 Foo e = 123; // expected-error {{no viable conversion from 'int' to 'NoCrash::Foo'}}
12 return e;
13 }
14 }
15