Lines Matching full:attribute
40 const [[]] int between_attr_2 = 0; // expected-error {{an attribute list cannot appear here}}
44 int & [[unknown]] ref_attr_2 = after_attr; // expected-warning {{unknown attribute 'unknown' ignored}}
45 int & [[noreturn]] ref_attr_3 = after_attr; // expected-error {{'noreturn' attribute cannot be applied to types}}
49 [[test::valid(for 42 [very] **** '+' symbols went on a trip and had a "good"_time; the end.)]] int garbage_attr; // expected-warning {{unknown attribute 'valid' ignored}}
50 [[,,,static, class, namespace,, inline, constexpr, mutable,, bitand, bitor::compl(!.*_ Cx.!U^*R),,,]] int more_garbage_attr; // expected-warning {{unknown attribute 'static' ignored}} \
51 // expected-warning {{unknown attribute 'class' ignored}} \
52 // expected-warning {{unknown attribute 'namespace' ignored}} \
53 // expected-warning {{unknown attribute 'inline' ignored}} \
54 // expected-warning {{unknown attribute 'constexpr' ignored}} \
55 // expected-warning {{unknown attribute 'mutable' ignored}} \
56 // expected-warning {{unknown attribute 'bitand' ignored}} \
57 // expected-warning {{unknown attribute 'compl' ignored}}
70 attr_after_class_name_decl [[]] [[]]; // expected-error {{an attribute list cannot appear here}}
73 attr_after_class_name_definition [[]] [[]] [[]]{}; // expected-error {{an attribute list cannot appear here}}
82 alignas(float) [[]] final // expected-error {{an attribute list cannot appear here}}
83 alignas(float) [[]] [[]] alignas(float): base{}; // expected-error {{an attribute list cannot appear here}}
86 [[]] [[]] alignas(16) final // expected-error {{an attribute list cannot appear here}}
87 [[]] [[]] alignas(16) [[]]{}; // expected-error {{an attribute list cannot appear here}}
90 [[]] struct no_init_declarators; // expected-error {{an attribute list cannot appear here}}
91 template<typename> [[]] struct no_init_declarators_template; // expected-error {{an attribute list cannot appear here}}
94 [[]] struct no_init_declarators; // expected-error {{an attribute list cannot appear here}}
109 int (paren_attr) [[]]; // expected-error {{an attribute list cannot appear here}}
110 unsigned [[]] int attr_in_decl_spec; // expected-error {{an attribute list cannot appear here}}
111 unsigned [[]] int [[]] const double_decl_spec = 0; // expected-error 2{{an attribute list cannot appear here}}
115 extern "C++" [[]] { } // expected-error {{an attribute list cannot appear here}}
116 [[]] template <typename T> void before_template_attr (); // expected-error {{an attribute list cannot appear here}}
117 [[]] namespace ns { int i; } // expected-error {{an attribute list cannot appear here}} expected-note {{declared here}}
118 [[]] static_assert(true, ""); //expected-error {{an attribute list cannot appear here}}
119 [[]] asm(""); // expected-error {{an attribute list cannot appear here}}
121 [[]] using ns::i; // expected-error {{an attribute list cannot appear here}}
122 [[unknown]] using namespace ns; // expected-warning {{unknown attribute 'unknown' ignored}}
123 [[noreturn]] using namespace ns; // expected-error {{'noreturn' attribute only applies to functions and methods}}
125 [[]] using T = int; // expected-error {{an attribute list cannot appear here}}
128 using ns::i [[]]; // expected-error {{an attribute list cannot appear here}}
129 using [[]] ns::i; // expected-error {{an attribute list cannot appear here}}
130 using T [[unknown]] = int; // expected-warning {{unknown attribute 'unknown' ignored}}
131 using T [[noreturn]] = int; // expected-error {{'noreturn' attribute only applies to functions and methods}}
135 auto trailing() -> [[]] const int; // expected-error {{an attribute list cannot appear here}}
136 auto trailing() -> const [[]] int; // expected-error {{an attribute list cannot appear here}}
146 struct [[]] N::S s; // expected-error {{an attribute list cannot appear here}}
147 struct [[]] Template<int> t; // expected-error {{an attribute list cannot appear here}}
148 struct [[]] ::template Template<int> u; // expected-error {{an attribute list cannot appear here}}
149 template struct [[]] Template<char>; // expected-error {{an attribute list cannot appear here}}
157 k_123 [[]] = 123 // expected-error {{an attribute list cannot appear here}}
159 enum [[]] E1 e; // expected-error {{an attribute list cannot appear here}}
160 enum [[]] class E4 { }; // expected-error {{an attribute list cannot appear here}}
164 friend int f [[]] (); // expected-FIXME{{an attribute list cannot appear here}}
165 friend int f1 [[noreturn]] (); //expected-error{{an attribute list cannot appear here}}
167 [[]] friend int g(); // expected-error{{an attribute list cannot appear here}}
170 [[]] friend int f3(), f4(), f5(); // expected-error{{an attribute list cannot appear here}}
171 friend int f6 [[noreturn]] (), f7 [[noreturn]] (), f8 [[noreturn]] (); // expected-error3 {{an attribute list cannot appear here}}
172 friend class [[]] C; // expected-error{{an attribute list cannot appear here}}
173 [[]] friend class D; // expected-error{{an attribute list cannot appear here}}
174 [[]] friend int; // expected-error{{an attribute list cannot appear here}}
177 template void tmpl [[]] (int); // expected-FIXME {{an attribute list cannot appear here}}
178 template [[]] void tmpl(char); // expected-error {{an attribute list cannot appear here}}
183 alignas(i) int aligned_nonconst; // expected-error {{'aligned' attribute requires integer constant}} expected-note {{read of non-const variable 'i'}}
206 } [[]] catch (...) { // expected-error {{an attribute list cannot appear here}}
209 (void)s.arr[ [] { return 0; }() ]; // expected-error {{C++11 only allows consecutive left square brackets when introducing an attribute}}
210 int n = __builtin_offsetof(S, arr[ [] { return 0; }() ]); // expected-error {{C++11 only allows consecutive left square brackets when introducing an attribute}}
220 void bar [[noreturn...]] (); // expected-error {{attribute 'noreturn' cannot be used as an attribute pack}}
228 [] () [[gnu::noreturn]] { return; } (); // expected-warning {{attribute 'noreturn' ignored}} FIXME-error {{should not return}}
229 [] () [[gnu::noreturn]] { throw; } (); // expected-warning {{attribute 'noreturn' ignored}}
235 if ([[unknown]] bool b = true) { // expected-warning {{unknown attribute 'unknown' ignored}}
236 switch ([[unknown]] int n { 42 }) { // expected-warning {{unknown attribute 'unknown' ignored}}
238 for ([[unknown]] int n = 0; [[unknown]] char b = n < 5; ++b) { // expected-warning 2{{unknown attribute 'unknown' ignored}}
243 // An attribute can be applied to an expression-statement, such as the first
246 for ([[]] x = 0; ; ) {} // expected-error {{an attribute list cannot appear here}}
247 for (; [[]] x < 5; ) {} // expected-error {{an attribute list cannot appear here}}
250 while ([[]] true) { // expected-error {{an attribute list cannot appear here}}
253 } while ([[]] false); // expected-error {{an attribute list cannot appear here}}
255 for ([[unknown]] int n : { 1, 2, 3 }) { // expected-warning {{unknown attribute 'unknown' ignored}}
266 void g() [[unknown::foo(arguments of attributes from unknown namespace other than 'gnu' namespace are ignored... blah...)]]; // expected-warning {{unknown attribute 'foo' ignored}}
270 unsigned [[gnu::used]] static int [[gnu::unused]] v1; // expected-error {{'unused' attribute cannot be applied to types}} \
271 expected-error {{an attribute list cannot appear here}}
272 typedef [[gnu::used]] unsigned long [[gnu::unused]] v2; // expected-error {{'unused' attribute cannot be applied to types}} \
273 expected-error {{an attribute list cannot appear here}}
274 int [[carries_dependency]] foo(int [[carries_dependency]] x); // expected-error 2{{'carries_dependency' attribute cannot be applied to types}}
277 int *[[gnu::unused]] v3; // expected-warning {{attribute 'unused' ignored}}
278 int v4[2][[gnu::unused]]; // expected-warning {{attribute 'unused' ignored}}
279 int v5()[[gnu::unused]]; // expected-warning {{attribute 'unused' ignored}}
281 [[attribute_declaration]]; // expected-warning {{unknown attribute 'attribute_declaration' ignored}}
282 [[noreturn]]; // expected-error {{'noreturn' attribute only applies to functions and methods}}
283 [[carries_dependency]]; // expected-error {{'carries_dependency' attribute only applies to functions, methods, and parameters}}