1 // RUN: %clang_cc1 -frecovery-ast -verify %s 2 3 struct X { 4 int Y; 5 constexpr X() // expected-error {{constexpr constructor never produces}} 6 : Y(foo()) {} // expected-error {{use of undeclared identifier 'foo'}} 7 }; 8 // no crash on evaluating the constexpr ctor. 9 constexpr int Z = X().Y; // expected-error {{constexpr variable 'Z' must be initialized by a constant expression}} 10 11 struct X2 { 12 int Y = foo(); // expected-error {{use of undeclared identifier 'foo'}} \ 13 // expected-note {{subexpression not valid in a constant expression}} 14 constexpr X2() {} // expected-error {{constexpr constructor never produces a constant expression}} 15 }; 16 17 struct X3 { 18 int Y; 19 constexpr X3() // expected-error {{constexpr constructor never produces}} 20 : Y(({foo();})) {} // expected-error {{use of undeclared identifier 'foo'}} 21 }; 22 23 struct CycleDelegate { 24 int Y; 25 CycleDelegate(int) 26 : Y(foo()) {} // expected-error {{use of undeclared identifier 'foo'}} 27 // no bogus "delegation cycle" diagnostic 28 CycleDelegate(float) : CycleDelegate(1) {} 29 }; 30