9 lines · cpp
1// RUN: %clang_cc1 -std=c++2a -verify %s2 3int f(); // expected-note 2{{declared here}}4 5constinit int a;6constinit int b = f(); // expected-error {{does not have a constant initializer}} expected-note {{required by}} expected-note {{non-constexpr function 'f'}}7extern constinit int c; // expected-note {{here}} expected-note {{required by}}8int c = f(); // expected-warning {{missing}} expected-error {{does not have a constant initializer}} expected-note {{non-constexpr function 'f'}}9