1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
|
//==--- DiagnosticParseKinds.def - libparse diagnostics ---------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//===----------------------------------------------------------------------===//
// Parser Diagnostics
//===----------------------------------------------------------------------===//
#ifdef PARSESTART
__PARSESTART = DIAG_START_PARSE,
#undef PARSESTART
#endif
DIAG(w_asm_qualifier_ignored, WARNING,
"ignored %0 qualifier on asm")
DIAG(ext_empty_source_file, EXTENSION,
"ISO C forbids an empty source file")
DIAG(ext_top_level_semi, EXTENSION,
"ISO C does not allow an extra ';' outside of a function")
DIAG(ext_extra_struct_semi, EXTENSION,
"ISO C does not allow an extra ';' inside a struct or union")
DIAG(ext_duplicate_declspec, EXTENSION,
"duplicate '%0' declaration specifier")
DIAG(ext_plain_complex, EXTENSION,
"ISO C does not support plain '_Complex' meaning '_Complex double'")
DIAG(ext_integer_complex, EXTENSION,
"ISO C does not support complex integer types")
DIAG(ext_thread_before, EXTENSION,
"'__thread' before 'static'")
DIAG(ext_empty_struct_union_enum, EXTENSION,
"use of empty %0 extension")
DIAG(err_invalid_sign_spec, ERROR,
"'%0' cannot be signed or unsigned")
DIAG(err_invalid_short_spec, ERROR,
"'short %0' is invalid")
DIAG(err_invalid_long_spec, ERROR,
"'long %0' is invalid")
DIAG(err_invalid_longlong_spec, ERROR,
"'long long %0' is invalid")
DIAG(err_invalid_complex_spec, ERROR,
"'_Complex %0' is invalid")
DIAG(err_invalid_thread_spec, ERROR,
"'__thread %0' is invalid")
DIAG(ext_ident_list_in_param, EXTENSION,
"type-less parameter names in function declaration")
DIAG(ext_c99_variable_decl_in_for_loop, EXTENSION,
"variable declaration in for loop is a C99-specific feature")
DIAG(ext_c99_compound_literal, EXTENSION,
"compound literals are a C99-specific feature")
DIAG(ext_c99_enumerator_list_comma, EXTENSION,
"commas at the end of enumerator lists are a C99-specific feature")
DIAG(ext_gnu_indirect_goto, EXTENSION,
"use of GNU indirect-goto extension")
DIAG(ext_gnu_address_of_label, EXTENSION,
"use of GNU address-of-label extension")
DIAG(ext_gnu_statement_expr, EXTENSION,
"use of GNU statement expression extension")
DIAG(ext_gnu_conditional_expr, EXTENSION,
"use of GNU ?: expression extension, eliding middle term")
DIAG(ext_gnu_empty_initializer, EXTENSION,
"use of GNU empty initializer extension")
DIAG(ext_gnu_array_range, EXTENSION,
"use of GNU array range extension")
DIAG(ext_gnu_missing_equal_designator, EXTENSION,
"use of GNU 'missing =' extension in designator")
DIAG(err_expected_equal_designator, ERROR,
"expected '=' or another designator")
DIAG(ext_gnu_old_style_field_designator, EXTENSION,
"use of GNU old-style field designator extension")
DIAG(ext_gnu_case_range, EXTENSION,
"use of GNU case range extension")
// Generic errors.
DIAG(err_parse_error, ERROR,
"parse error")
DIAG(err_expected_expression, ERROR,
"expected expression")
DIAG(err_expected_type, ERROR,
"expected a type")
DIAG(err_expected_external_declaration, ERROR,
"expected external declaration")
DIAG(err_expected_ident, ERROR,
"expected identifier")
DIAG(err_expected_ident_lparen, ERROR,
"expected identifier or '('")
DIAG(err_expected_ident_lbrace, ERROR,
"expected identifier or '{'")
DIAG(err_expected_lbrace, ERROR,
"expected '{'")
DIAG(err_expected_lparen, ERROR,
"expected '('")
DIAG(err_expected_rparen, ERROR,
"expected ')'")
DIAG(err_expected_rsquare, ERROR,
"expected ']'")
DIAG(err_expected_rbrace, ERROR,
"expected '}'")
DIAG(err_expected_greater, ERROR,
"expected '>'")
DIAG(err_expected_semi_decl_list, ERROR,
"expected ';' at end of declaration list")
DIAG(ext_expected_semi_decl_list, EXTENSION,
"expected ';' at end of declaration list")
DIAG(err_function_declared_typedef, ERROR,
"function definition declared 'typedef'")
DIAG(err_expected_fn_body, ERROR,
"expected function body after function declarator")
DIAG(err_expected_method_body, ERROR,
"expected method body")
DIAG(err_expected_after_declarator, ERROR,
"expected '=', ',', ';', 'asm', or '__attribute__' after declarator")
DIAG(err_expected_statement, ERROR,
"expected statement")
DIAG(err_expected_lparen_after, ERROR,
"expected '(' after '%0'")
DIAG(err_expected_lparen_after_id, ERROR,
"expected '(' after %0")
DIAG(err_expected_less_after, ERROR,
"expected '<' after '%0'")
DIAG(err_expected_comma, ERROR,
"expected ','")
DIAG(err_expected_lbrace_in_compound_literal, ERROR,
"expected '{' in compound literal")
DIAG(err_expected_while, ERROR,
"expected 'while' in do/while loop")
DIAG(err_expected_semi_after, ERROR,
"expected ';' after %0")
DIAG(err_expected_semi_after_expr, ERROR,
"expected ';' after expression")
DIAG(err_expected_semi_after_method_proto, ERROR,
"expected ';' after method prototype")
DIAG(err_expected_semi_for, ERROR,
"expected ';' in 'for' statement specifier")
DIAG(err_expected_colon_after, ERROR,
"expected ':' after %0")
DIAG(err_label_end_of_compound_statement, ERROR,
"label at end of compound statement: expected statement")
DIAG(err_expected_string_literal, ERROR,
"expected string literal")
DIAG(err_expected_asm_operand, ERROR,
"expected string literal or '[' for asm operand")
DIAG(err_expected_selector_for_method, ERROR,
"expected selector for Objective-C method")
DIAG(err_unexpected_at, ERROR,
"unexpected '@' in program")
DIAG(err_invalid_reference_qualifier_application, ERROR,
"'%0' qualifier may not be applied to a reference")
DIAG(err_illegal_decl_reference_to_reference, ERROR,
"%0 declared as a reference to a reference")
DIAG(err_argument_required_after_attribute, ERROR,
"argument required after attribute")
DIAG(err_missing_param, ERROR,
"expected parameter declarator")
DIAG(err_unexpected_typedef_ident, ERROR,
"unexpected type name %0: expected identifier")
DIAG(err_expected_class_name, ERROR,
"expected class name")
DIAG(err_unspecified_vla_size_with_static, ERROR,
"'static' may not be used with an unspecified variable length array size")
// Declarations.
DIAG(err_typename_requires_specqual, ERROR,
"type name requires a specifier or qualifier")
DIAG(err_typename_invalid_storageclass, ERROR,
"type name does not allow storage class to be specified")
DIAG(err_typename_invalid_functionspec, ERROR,
"type name does not allow function specifier to be specified")
DIAG(err_invalid_decl_spec_combination, ERROR,
"cannot combine with previous '%0' declaration specifier")
/// Objective-C parser diagnostics
DIAG(err_objc_no_attributes_on_category, ERROR,
"attributes may not be specified on a category")
DIAG(err_objc_missing_end, ERROR,
"missing @end")
DIAG(warn_objc_protocol_qualifier_missing_id, WARNING,
"protocol qualifiers without 'id' is archaic")
DIAG(err_objc_illegal_visibility_spec, ERROR,
"illegal visibility specification")
DIAG(err_objc_illegal_interface_qual, ERROR,
"illegal interface qualifier")
DIAG(err_objc_expected_equal, ERROR,
"setter/getter expects '=' followed by name")
DIAG(err_objc_property_requires_field_name, ERROR,
"property requires fields to be named")
DIAG(err_objc_property_bitfield, ERROR,
"property name cannot be a bitfield")
DIAG(err_objc_expected_property_attr, ERROR,
"unknown property attribute %0")
DIAG(err_objc_propertoes_require_objc2, ERROR,
"properties are an Objective-C 2 feature")
DIAG(err_objc_unexpected_attr, ERROR,
"prefix attribute must be followed by an interface or protocol")
DIAG(err_objc_directive_only_in_protocol, ERROR,
"directive may only be specified in protocols only")
DIAG(err_missing_catch_finally, ERROR,
"@try statement without a @catch and @finally clause")
DIAG(err_objc_concat_string, ERROR,
"unexpected token after Objective-C string")
DIAG(err_missing_sel_definition, ERROR,
"cannot find definition of 'SEL'")
DIAG(err_missing_id_definition, ERROR,
"cannot find definition of 'id'")
DIAG(err_missing_proto_definition, ERROR,
"cannot find definition of 'Protocol'")
DIAG(err_missing_class_definition, ERROR,
"cannot find definition of 'Class'")
DIAG(warn_expected_implementation, WARNING,
"@end must appear in an @implementation context")
DIAG(error_property_ivar_decl, ERROR,
"property synthesize requires specification of an ivar")
DIAG(err_expected_field_designator, ERROR,
"expected a field designator, such as '.field = 4'")
DIAG(err_declaration_does_not_declare_param, ERROR,
"declaration does not declare a parameter")
DIAG(err_no_matching_param, ERROR,
"parameter named %0 is missing")
/// C++ parser diagnostics
DIAG(err_expected_unqualified_id, ERROR,
"expected unqualified-id")
DIAG(err_func_def_no_params, ERROR,
"function definition does not declare parameters")
DIAG(err_expected_lparen_after_type, ERROR,
"expected '(' for function-style cast or type construction")
DIAG(err_expected_equal_after_declarator, ERROR,
"expected '=' after declarator")
DIAG(warn_parens_disambiguated_as_function_decl, WARNING,
"parentheses were disambiguated as a function declarator")
DIAG(err_expected_member_or_base_name, ERROR,
"expected class member or base class name")
DIAG(ext_ellipsis_exception_spec, EXTENSION,
"exception specification of '...' is a Microsoft extension")
DIAG(err_expected_catch, ERROR,
"expected catch")
// C++ derived classes
DIAG(err_dup_virtual, ERROR,
"duplicate 'virtual' in base specifier")
// C++ operator overloading
DIAG(err_operator_missing_type_specifier, ERROR,
"missing type specifier after 'operator'")
// Classes.
DIAG(err_anon_type_definition, ERROR,
"declaration of anonymous %0 must be a definition")
/// C++ Templates
DIAG(err_expected_template, ERROR,
"expected template")
DIAG(err_expected_comma_greater, ERROR,
"expected ',' or '>' in template-parameter-list")
DIAG(err_expected_type_id_after, ERROR,
"expected type-id after '%0'")
DIAG(err_expected_class_before, ERROR,
"expected 'class' before '%0'")
DIAG(err_template_spec_syntax_non_template, ERROR,
"identifier followed by '<' indicates a class template specialization but %0 %select{does not refer to a template|refers to a function template|<unused>|refers to a template template parameter}1")
DIAG(err_id_after_template_in_nested_name_spec, ERROR,
"expected template name after 'template' keyword in nested name specifier")
DIAG(err_less_after_template_name_in_nested_name_spec, ERROR,
"expected '<' after 'template %0' in nested name specifier")
// Language specific pragmas
// #pragma pack
DIAG(warn_pragma_pack_expected_lparen, WARNING,
"missing '(' after '#pragma pack' - ignoring")
DIAG(warn_pragma_pack_expected_rparen, WARNING,
"missing ')' after '#pragma pack' - ignoring")
DIAG(warn_pragma_pack_invalid_action, WARNING,
"unknown action for '#pragma pack' - ignored")
DIAG(warn_pragma_pack_invalid_constant, WARNING,
"invalid constant for '#pragma pack', expected %0 - ignored")
DIAG(warn_pragma_pack_malformed, WARNING,
"expected integer or identifier in '#pragma pack' - ignored")
|