Lines Matching refs:ATTR
8 #define ATTR __attribute__((require_constant_initialization)) // expected-note 0+ {{expanded from m… macro
59 void test_func_local(ATTR int param) { // expected-error {{only applies to global variables}} in test_func_local()
60 ATTR int x = 42; // expected-error {{only applies to}} in test_func_local()
61 ATTR extern int y; in test_func_local()
63 struct ATTR class_mem { // expected-error {{only applies to}}
64 ATTR int x; // expected-error {{only applies to}}
77 ATTR const int &glvalue_ref ATTR = glvalue_int; variable
78 ATTR const int &glvalue_ref2 ATTR = glvalue_int2; variable
79 ATTR __thread const int &glvalue_ref_tl = glvalue_int;
83 …ATTR static const int &local_init = non_global; // expected-error {{variable does not have a const… in test_basic_start_static_2_1()
91 ATTR static const int &global_init = glvalue_int; in test_basic_start_static_2_1()
92 ATTR static const int &temp_init = 42; in test_basic_start_static_2_1()
95 ATTR const int &temp_ref = 42;
96 ATTR const int &temp_ref2 = ReturnInt(); // expected-error {{variable does not have a constant init…
103 ATTR const NonLit &nl_temp_ref = 42; // expected-error {{variable does not have a constant initiali…
112 ATTR const LitType &lit_temp_ref = 42;
113 ATTR const int &subobj_ref = LitType{}.value;
116 ATTR const int &nl_subobj_ref = NonLit().value; // expected-error {{variable does not have a consta…
125 ATTR static const int &no_init;
126 ATTR static const int &glvalue_init;
127 ATTR static const int &temp_init;
128 ATTR static const int &subobj_init;
130 ATTR static thread_local const int &tl_glvalue_init;
131 …ATTR static thread_local const int &tl_temp_init; // expected-note {{required by 'require_constant…
151 ATTR static PODType pod; in test_basic_start_static_2_2()
153 ATTR static PODType pod; // expected-error {{variable does not have a constant initializer}} in test_basic_start_static_2_2()
157 …ATTR static PODType pot2 = {ReturnInt()}; // expected-error {{variable does not have a constant in… in test_basic_start_static_2_2()
167 ATTR static LitType static_lit = l; in test_basic_start_static_2_2()
168 …ATTR static LitType static_lit2 = (void *)0; // expected-error {{variable does not have a constant… in test_basic_start_static_2_2()
171 …ATTR static LitType static_lit3 = ReturnInt(); // expected-error {{variable does not have a consta… in test_basic_start_static_2_2()
174 ATTR thread_local LitType tls = 42; in test_basic_start_static_2_2()
179 ATTR static PODType pod_noinit;
183 …ATTR static PODType pod_copy_init; // expected-note {{required by 'require_constant_initialization…
185 ATTR static constexpr LitType lit = {};
186 ATTR static const NonLit non_lit;
187 ATTR static const NonLit non_lit_list_init;
188 ATTR static const NonLit non_lit_copy_init;
212 ATTR LitType lit_ctor;
213 ATTR LitType lit_ctor2{};
214 ATTR LitType lit_ctor3 = {};
215 ATTR __thread LitType lit_ctor_tl = {};
218 ATTR NonLit nl_ctor;
219 ATTR NonLit nl_ctor2{};
220 ATTR NonLit nl_ctor3 = {};
221 ATTR thread_local NonLit nl_ctor_tl = {};
222 ATTR StoresNonLit snl;
224 ATTR NonLit nl_ctor; // expected-error {{variable does not have a constant initializer}}
227 ATTR NonLit nl_ctor2{}; // expected-error {{variable does not have a constant initializer}}
230 ATTR NonLit nl_ctor3 = {}; // expected-error {{variable does not have a constant initializer}}
233 ATTR thread_local NonLit nl_ctor_tl = {}; // expected-error {{variable does not have a constant ini…
236 ATTR StoresNonLit snl; // expected-error {{variable does not have a constant initializer}}
242 ATTR int nl_in_init = NonLit{42}.value; // expected-error {{variable does not have a constant initi…
245 ATTR int lit_in_init = LitType{42}.value;
253 ATTR static int static_local = 42; in test_basic_start_static_2_3()
254 ATTR static int static_local2; // zero-initialization takes place in test_basic_start_static_2_3()
256 ATTR thread_local int tl_local = 42; in test_basic_start_static_2_3()
260 ATTR int no_init; // zero initialization takes place
261 ATTR int arg_init = 42;
262 ATTR PODType pod_init = {};
263 ATTR PODType pod_missing_init = {42 /* should have second arg */};
264 ATTR PODType pod_full_init = {1, 2};
265 ATTR PODType pod_non_constexpr_init = {1, ReturnInt()}; // expected-error {{variable does not have …
274 ATTR int val_init{};
275 ATTR int brace_init = {};
278 ATTR __thread int tl_init = 0;
295 ATTR TestCtor<NotC> t(42); // expected-error {{variable does not have a constant initializer}}
301 ATTR const char *foo[] = {"abc", "def"};
302 ATTR PODType bar[] = {{}, {123, 456}};
309 ATTR const int A::n; // expected-warning {{added after initialization}}
312 extern ATTR int m; // expected-warning {{added after initialization}}
326 ATTR LitType non_const_lit(nullptr); // expected-error {{variable does not have a constant initiali…
329 ATTR NonLit non_const(nullptr); // expected-error {{variable does not have a constant initializer}}
337 ATTR constexpr TestCtor<NotC> inval_constexpr2(42); // expected-error {{must be initialized by a co…
345 ATTR int x = 0; // expected-warning {{attribute ignored}}