bolt/deps/llvm-18.1.8/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constinit/p2.cpp
2025-02-14 19:21:04 +01:00

8 lines
488 B
C++

// RUN: %clang_cc1 -std=c++2a -verify %s
int f(); // expected-note 2{{declared here}}
constinit int a;
constinit int b = f(); // expected-error {{does not have a constant initializer}} expected-note {{required by}} expected-note {{non-constexpr function 'f'}}
extern constinit int c; // expected-note {{here}} expected-note {{required by}}
int c = f(); // expected-warning {{missing}} expected-error {{does not have a constant initializer}} expected-note {{non-constexpr function 'f'}}