brintos

brintos / llvm-project-archived public Read only

0
0
Text · 408 B · 0baea03 Raw
7 lines · cpp
1// RUN: %clang_cc1 -std=c++2a -verify %s2 3const char *g() { return "dynamic initialization"; } // expected-note {{declared here}}4constexpr const char *f(bool b) { return b ? "constant initialization" : g(); } // expected-note {{non-constexpr function 'g'}}5constinit const char *c = f(true);6constinit const char *d = f(false); // expected-error {{does not have a constant initializer}} expected-note 2{{}}7