[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / SemaCXX / constexpr-default-init-value-crash.cpp
blob03957cee510f2c06aa6b9bc53c6a30d27952ba0a
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
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 };
10 constexpr Foo getFoo() {
11 Foo e = 123; // expected-error {{no viable conversion from 'int' to 'Foo'}}
12 return e;