1 //==--- DiagnosticParseKinds.td - libparse diagnostics --------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 //===----------------------------------------------------------------------===//
12 //===----------------------------------------------------------------------===//
14 let Component = "Parse" in {
16 def w_asm_qualifier_ignored : Warning<"ignored %0 qualifier on asm">,
18 def warn_file_asm_volatile : Warning<
19 "meaningless 'volatile' on asm outside function">, CatInlineAsm;
21 let CategoryName = "Inline Assembly Issue" in {
22 def err_asm_empty : Error<"__asm used with no assembly instructions">;
23 def err_inline_ms_asm_parsing : Error<"%0">;
24 def err_msasm_unsupported_arch : Error<
25 "Unsupported architecture '%0' for MS-style inline assembly">;
26 def err_msasm_unable_to_create_target : Error<
27 "MS-style inline assembly is not available: %0">;
30 let CategoryName = "Parse Issue" in {
32 def ext_empty_translation_unit : Extension<
33 "ISO C requires a translation unit to contain at least one declaration">,
34 InGroup<DiagGroup<"empty-translation-unit">>;
35 def warn_cxx98_compat_top_level_semi : Warning<
36 "extra ';' outside of a function is incompatible with C++98">,
37 InGroup<CXX98CompatPedantic>, DefaultIgnore;
38 def ext_extra_semi : Extension<
40 "outside of a function|"
42 "inside instance variable list|"
43 "after member function definition}0">,
45 def ext_extra_semi_cxx11 : Extension<
46 "extra ';' outside of a function is a C++11 extension">,
47 InGroup<CXX11ExtraSemi>;
48 def warn_extra_semi_after_mem_fn_def : Warning<
49 "extra ';' after member function definition">,
50 InGroup<ExtraSemi>, DefaultIgnore;
52 def ext_duplicate_declspec : ExtWarn<"duplicate '%0' declaration specifier">,
53 InGroup<DuplicateDeclSpecifier>;
54 def warn_duplicate_declspec : Warning<"duplicate '%0' declaration specifier">,
55 InGroup<DuplicateDeclSpecifier>;
56 def ext_plain_complex : ExtWarn<
57 "plain '_Complex' requires a type specifier; assuming '_Complex double'">;
58 def ext_integer_complex : Extension<
59 "complex integer types are a GNU extension">, InGroup<GNUComplexInteger>;
60 def ext_thread_before : Extension<"'__thread' before '%0'">;
61 def ext_keyword_as_ident : ExtWarn<
62 "keyword '%0' will be treated as an identifier %select{here|for the remainder of the translation unit}1">,
63 InGroup<KeywordCompat>;
65 def error_empty_enum : Error<"use of empty enum">;
66 def err_invalid_sign_spec : Error<"'%0' cannot be signed or unsigned">;
67 def err_invalid_short_spec : Error<"'short %0' is invalid">;
68 def err_invalid_long_spec : Error<"'long %0' is invalid">;
69 def err_invalid_longlong_spec : Error<"'long long %0' is invalid">;
70 def err_invalid_complex_spec : Error<"'_Complex %0' is invalid">;
71 def err_friend_storage_spec : Error<"'%0' is invalid in friend declarations">;
73 def ext_ident_list_in_param : Extension<
74 "type-less parameter names in function declaration">;
75 def ext_c99_variable_decl_in_for_loop : Extension<
76 "variable declaration in for loop is a C99-specific feature">, InGroup<C99>;
77 def ext_c99_compound_literal : Extension<
78 "compound literals are a C99-specific feature">, InGroup<C99>;
79 def ext_enumerator_list_comma_c : Extension<
80 "commas at the end of enumerator lists are a C99-specific "
81 "feature">, InGroup<C99>;
82 def ext_enumerator_list_comma_cxx : Extension<
83 "commas at the end of enumerator lists are a C++11 extension">,
85 def warn_cxx98_compat_enumerator_list_comma : Warning<
86 "commas at the end of enumerator lists are incompatible with C++98">,
87 InGroup<CXX98CompatPedantic>, DefaultIgnore;
88 def err_enumerator_list_missing_comma : Error<
89 "missing ',' between enumerators">;
90 def err_enumerator_unnamed_no_def : Error<
91 "unnamed enumeration must be a definition">;
92 def ext_cxx11_enum_fixed_underlying_type : Extension<
93 "enumeration types with a fixed underlying type are a C++11 extension">,
95 def ext_c_enum_fixed_underlying_type : Extension<
96 "enumeration types with a fixed underlying type are a Microsoft extension">,
98 def warn_cxx98_compat_enum_fixed_underlying_type : Warning<
99 "enumeration types with a fixed underlying type are incompatible with C++98">,
100 InGroup<CXX98Compat>, DefaultIgnore;
101 def warn_cxx98_compat_alignof : Warning<
102 "alignof expressions are incompatible with C++98">,
103 InGroup<CXX98Compat>, DefaultIgnore;
104 def ext_alignof_expr : ExtWarn<
105 "%0 applied to an expression is a GNU extension">, InGroup<GNUAlignofExpression>;
107 def warn_microsoft_dependent_exists : Warning<
108 "dependent %select{__if_not_exists|__if_exists}0 declarations are ignored">,
109 InGroup<DiagGroup<"microsoft-exists">>;
111 def ext_c11_generic_selection : Extension<
112 "generic selections are a C11-specific feature">, InGroup<C11>;
113 def err_duplicate_default_assoc : Error<
114 "duplicate default generic association">;
115 def note_previous_default_assoc : Note<
116 "previous default generic association is here">;
118 def ext_c11_alignment : Extension<
119 "%0 is a C11-specific feature">, InGroup<C11>;
121 def ext_c11_noreturn : Extension<
122 "_Noreturn functions are a C11-specific feature">, InGroup<C11>;
124 def ext_gnu_indirect_goto : Extension<
125 "use of GNU indirect-goto extension">, InGroup<GNULabelsAsValue>;
126 def ext_gnu_address_of_label : Extension<
127 "use of GNU address-of-label extension">, InGroup<GNULabelsAsValue>;
128 def ext_gnu_statement_expr : Extension<
129 "use of GNU statement expression extension">, InGroup<GNUStatementExpression>;
130 def ext_gnu_conditional_expr : Extension<
131 "use of GNU ?: conditional expression extension, omitting middle operand">, InGroup<GNUConditionalOmittedOperand>;
132 def ext_gnu_empty_initializer : Extension<
133 "use of GNU empty initializer extension">, InGroup<GNUEmptyInitializer>;
134 def ext_gnu_array_range : Extension<"use of GNU array range extension">,
135 InGroup<GNUDesignator>;
136 def ext_gnu_missing_equal_designator : ExtWarn<
137 "use of GNU 'missing =' extension in designator">,
138 InGroup<GNUDesignator>;
139 def err_expected_equal_designator : Error<"expected '=' or another designator">;
140 def ext_gnu_old_style_field_designator : ExtWarn<
141 "use of GNU old-style field designator extension">,
142 InGroup<GNUDesignator>;
143 def ext_gnu_case_range : Extension<"use of GNU case range extension">,
144 InGroup<GNUCaseRange>;
147 def err_expected_expression : Error<"expected expression">;
148 def err_expected_type : Error<"expected a type">;
149 def err_expected_external_declaration : Error<"expected external declaration">;
150 def err_extraneous_closing_brace : Error<"extraneous closing brace ('}')">;
151 def err_expected_ident : Error<"expected identifier">;
152 def err_expected_ident_lparen : Error<"expected identifier or '('">;
153 def err_expected_ident_lbrace : Error<"expected identifier or '{'">;
154 def err_expected_lbrace : Error<"expected '{'">;
155 def err_expected_lparen : Error<"expected '('">;
156 def err_expected_lparen_or_lbrace : Error<"expected '(' or '{'">;
157 def err_expected_rparen : Error<"expected ')'">;
158 def err_expected_lsquare : Error<"expected '['">;
159 def err_expected_rsquare : Error<"expected ']'">;
160 def err_expected_rbrace : Error<"expected '}'">;
161 def err_expected_greater : Error<"expected '>'">;
162 def err_expected_ggg : Error<"expected '>>>'">;
163 def err_expected_semi_declaration : Error<
164 "expected ';' at end of declaration">;
165 def err_expected_semi_decl_list : Error<
166 "expected ';' at end of declaration list">;
167 def ext_expected_semi_decl_list : ExtWarn<
168 "expected ';' at end of declaration list">;
169 def err_expected_member_name_or_semi : Error<
170 "expected member name or ';' after declaration specifiers">;
171 def err_function_declared_typedef : Error<
172 "function definition declared 'typedef'">;
173 def err_at_defs_cxx : Error<"@defs is not supported in Objective-C++">;
174 def err_at_in_class : Error<"unexpected '@' in member specification">;
176 def err_expected_fn_body : Error<
177 "expected function body after function declarator">;
178 def warn_attribute_on_function_definition : Warning<
179 "GCC does not allow %0 attribute in this position on a function definition">,
181 def warn_attribute_no_decl : Warning<
182 "attribute %0 ignored, because it is not attached to a declaration">,
183 InGroup<IgnoredAttributes>;
184 def err_expected_method_body : Error<"expected method body">;
185 def err_invalid_token_after_toplevel_declarator : Error<
186 "expected ';' after top level declarator">;
187 def err_invalid_token_after_declarator_suggest_equal : Error<
188 "invalid '%0' at end of declaration; did you mean '='?">;
189 def err_expected_statement : Error<"expected statement">;
190 def err_expected_lparen_after : Error<"expected '(' after '%0'">;
191 def err_expected_lparen_after_id : Error<"expected '(' after %0">;
192 def err_expected_less_after : Error<"expected '<' after '%0'">;
193 def err_expected_equal_after : Error<"expected '=' after %0">;
194 def err_expected_comma : Error<"expected ','">;
195 def err_expected_lbrace_in_compound_literal : Error<
196 "expected '{' in compound literal">;
197 def err_expected_while : Error<"expected 'while' in do/while loop">;
199 def err_expected_semi_after : Error<"expected ';' after %0">;
200 def err_expected_semi_after_stmt : Error<"expected ';' after %0 statement">;
201 def err_expected_semi_after_expr : Error<"expected ';' after expression">;
202 def err_extraneous_token_before_semi : Error<"extraneous '%0' before ';'">;
204 def err_expected_semi_after_method_proto : Error<
205 "expected ';' after method prototype">;
206 def err_expected_semi_after_namespace_name : Error<
207 "expected ';' after namespace name">;
208 def err_unexpected_namespace_attributes_alias : Error<
209 "attributes can not be specified on namespace alias">;
210 def err_inline_namespace_alias : Error<"namespace alias cannot be inline">;
211 def err_namespace_nonnamespace_scope : Error<
212 "namespaces can only be defined in global or namespace scope">;
213 def err_nested_namespaces_with_double_colon : Error<
214 "nested namespace definition must define each namespace separately">;
215 def err_expected_semi_after_attribute_list : Error<
216 "expected ';' after attribute list">;
217 def err_expected_semi_after_static_assert : Error<
218 "expected ';' after static_assert">;
219 def err_expected_semi_for : Error<"expected ';' in 'for' statement specifier">;
220 def err_expected_colon_after : Error<"expected ':' after %0">;
221 def warn_missing_selector_name : Warning<
222 "%0 used as the name of the previous parameter rather than as part "
224 InGroup<DiagGroup<"missing-selector-name">>;
225 def note_missing_selector_name : Note<
226 "introduce a parameter name to make %0 part of the selector">;
227 def note_force_empty_selector_name : Note<
228 "or insert whitespace before ':' to use %0 as parameter name "
229 "and have an empty entry in the selector">;
230 def err_label_end_of_compound_statement : Error<
231 "label at end of compound statement: expected statement">;
232 def err_address_of_label_outside_fn : Error<
233 "use of address-of-label extension outside of a function body">;
234 def err_asm_operand_wide_string_literal : Error<
235 "cannot use %select{unicode|wide}0 string literal in 'asm'">;
236 def err_expected_selector_for_method : Error<
237 "expected selector for Objective-C method">;
238 def err_expected_property_name : Error<"expected property name">;
240 def err_unexpected_at : Error<"unexpected '@' in program">;
242 def err_invalid_reference_qualifier_application : Error<
243 "'%0' qualifier may not be applied to a reference">;
244 def err_illegal_decl_reference_to_reference : Error<
245 "%0 declared as a reference to a reference">;
246 def ext_rvalue_reference : ExtWarn<
247 "rvalue references are a C++11 extension">, InGroup<CXX11>;
248 def warn_cxx98_compat_rvalue_reference : Warning<
249 "rvalue references are incompatible with C++98">,
250 InGroup<CXX98Compat>, DefaultIgnore;
251 def ext_ref_qualifier : ExtWarn<
252 "reference qualifiers on functions are a C++11 extension">, InGroup<CXX11>;
253 def warn_cxx98_compat_ref_qualifier : Warning<
254 "reference qualifiers on functions are incompatible with C++98">,
255 InGroup<CXX98Compat>, DefaultIgnore;
256 def ext_inline_namespace : ExtWarn<
257 "inline namespaces are a C++11 feature">, InGroup<CXX11>;
258 def warn_cxx98_compat_inline_namespace : Warning<
259 "inline namespaces are incompatible with C++98">,
260 InGroup<CXX98Compat>, DefaultIgnore;
261 def ext_generalized_initializer_lists : ExtWarn<
262 "generalized initializer lists are a C++11 extension">,
264 def warn_cxx98_compat_generalized_initializer_lists : Warning<
265 "generalized initializer lists are incompatible with C++98">,
266 InGroup<CXX98Compat>, DefaultIgnore;
267 def err_init_list_bin_op : Error<"initializer list cannot be used on the "
268 "%select{left|right}0 hand side of operator '%1'">;
269 def warn_cxx98_compat_trailing_return_type : Warning<
270 "trailing return types are incompatible with C++98">,
271 InGroup<CXX98Compat>, DefaultIgnore;
272 def ext_auto_type_specifier : ExtWarn<
273 "'auto' type specifier is a C++11 extension">, InGroup<CXX11>;
274 def warn_auto_storage_class : Warning<
275 "'auto' storage class specifier is redundant and incompatible with C++11">,
276 InGroup<CXX11Compat>, DefaultIgnore;
277 def ext_auto_storage_class : ExtWarn<
278 "'auto' storage class specifier is not permitted in C++11, and will not "
279 "be supported in future releases">, InGroup<DiagGroup<"auto-storage-class">>;
280 def ext_decltype_auto_type_specifier : ExtWarn<
281 "'decltype(auto)' type specifier is a C++1y extension">, InGroup<CXX1y>;
282 def warn_cxx11_compat_decltype_auto_type_specifier : Warning<
283 "'decltype(auto)' type specifier is incompatible with C++ standards before "
284 "C++1y">, InGroup<CXXPre1yCompat>, DefaultIgnore;
285 def ext_for_range : ExtWarn<
286 "range-based for loop is a C++11 extension">, InGroup<CXX11>;
287 def warn_cxx98_compat_for_range : Warning<
288 "range-based for loop is incompatible with C++98">,
289 InGroup<CXX98Compat>, DefaultIgnore;
290 def err_for_range_expected_decl : Error<
291 "for range declaration must declare a variable">;
292 def err_argument_required_after_attribute : Error<
293 "argument required after attribute">;
294 def err_missing_param : Error<"expected parameter declarator">;
295 def err_missing_comma_before_ellipsis : Error<
296 "C requires a comma prior to the ellipsis in a variadic function type">;
297 def err_unexpected_typedef_ident : Error<
298 "unexpected type name %0: expected identifier">;
299 def warn_cxx98_compat_decltype : Warning<
300 "'decltype' type specifier is incompatible with C++98">,
301 InGroup<CXX98Compat>, DefaultIgnore;
302 def err_unexpected_scope_on_base_decltype : Error<
303 "unexpected namespace scope prior to decltype">;
304 def err_expected_class_name : Error<"expected class name">;
305 def err_expected_class_name_not_template :
306 Error<"'typename' is redundant; base classes are implicitly types">;
307 def err_unspecified_vla_size_with_static : Error<
308 "'static' may not be used with an unspecified variable length array size">;
309 def warn_deprecated_register : Warning<
310 "'register' storage class specifier is deprecated">,
311 InGroup<DeprecatedRegister>;
312 def err_expected_parentheses_around_typename : Error<
313 "expected parentheses around type name in %0 expression">;
315 def err_expected_case_before_expression: Error<
316 "expected 'case' keyword before expression">;
319 def err_typename_requires_specqual : Error<
320 "type name requires a specifier or qualifier">;
321 def err_typename_invalid_storageclass : Error<
322 "type name does not allow storage class to be specified">;
323 def err_typename_invalid_functionspec : Error<
324 "type name does not allow function specifier to be specified">;
325 def err_typename_invalid_constexpr : Error<
326 "type name does not allow constexpr specifier to be specified">;
327 def err_typename_identifiers_only : Error<
328 "typename is allowed for identifiers only">;
330 def err_invalid_decl_spec_combination : Error<
331 "cannot combine with previous '%0' declaration specifier">;
332 def err_invalid_vector_decl_spec_combination : Error<
333 "cannot combine with previous '%0' declaration specifier. "
334 "'__vector' must be first">;
335 def err_invalid_pixel_decl_spec_combination : Error<
336 "'__pixel' must be preceded by '__vector'. "
337 "'%0' declaration specifier not allowed here">;
338 def err_invalid_vector_decl_spec : Error<
339 "cannot use '%0' with '__vector'">;
340 def err_invalid_vector_bool_decl_spec : Error<
341 "cannot use '%0' with '__vector bool'">;
342 def warn_vector_long_decl_spec_combination : Warning<
343 "Use of 'long' with '__vector' is deprecated">, InGroup<Deprecated>;
344 def err_friend_invalid_in_context : Error<
345 "'friend' used outside of class">;
346 def err_unknown_typename : Error<
347 "unknown type name %0">;
348 def err_use_of_tag_name_without_tag : Error<
349 "must use '%1' tag to refer to type %0%select{| in this scope}2">;
350 def err_templated_using_directive : Error<
351 "cannot template a using directive">;
352 def err_templated_using_declaration : Error<
353 "cannot template a using declaration">;
354 def err_unexected_colon_in_nested_name_spec : Error<
355 "unexpected ':' in nested name specifier; did you mean '::'?">;
356 def err_bool_redeclaration : Error<
357 "redeclaration of C++ built-in type 'bool'">;
358 def ext_c11_static_assert : Extension<
359 "_Static_assert is a C11-specific feature">, InGroup<C11>;
360 def warn_cxx98_compat_static_assert : Warning<
361 "static_assert declarations are incompatible with C++98">,
362 InGroup<CXX98Compat>, DefaultIgnore;
363 def err_paren_after_colon_colon : Error<
364 "unexpected parenthesis after '::'">;
365 def err_function_definition_not_allowed : Error<
366 "function definition is not allowed here">;
368 /// Objective-C parser diagnostics
369 def err_expected_minus_or_plus : Error<
370 "method type specifier must start with '-' or '+'">;
371 def err_objc_no_attributes_on_category : Error<
372 "attributes may not be specified on a category">;
373 def err_objc_missing_end : Error<"missing '@end'">;
374 def note_objc_container_start : Note<
375 "%select{class|protocol|category|class extension|implementation"
376 "|category implementation}0 started here">;
377 def warn_objc_protocol_qualifier_missing_id : Warning<
378 "protocol has no object type specified; defaults to qualified 'id'">;
379 def err_objc_unknown_at : Error<"expected an Objective-C directive after '@'">;
380 def err_illegal_super_cast : Error<
381 "cannot cast 'super' (it isn't an expression)">;
382 def err_nsnumber_nonliteral_unary : Error<
383 "@%0 must be followed by a number to form an NSNumber object">;
384 def warn_cstyle_param : Warning<
385 "use of C-style parameters in Objective-C method declarations"
386 " is deprecated">, InGroup<DeprecatedDeclarations>;
388 let CategoryName = "ARC Parse Issue" in {
389 def err_arc_bridge_retain : Error<
390 "unknown cast annotation __bridge_retain; did you mean __bridge_retained?">;
391 // To be default mapped to an error later.
392 def warn_arc_bridge_cast_nonarc : Warning<
393 "'%0' casts have no effect when not using ARC">,
394 InGroup<DiagGroup<"arc-bridge-casts-disallowed-in-nonarc">>;
397 def err_objc_illegal_visibility_spec : Error<
398 "illegal visibility specification">;
399 def err_objc_illegal_interface_qual : Error<"illegal interface qualifier">;
400 def err_objc_expected_equal_for_getter : Error<
401 "expected '=' for Objective-C getter">;
402 def err_objc_expected_equal_for_setter : Error<
403 "expected '=' for Objective-C setter">;
404 def err_objc_expected_selector_for_getter_setter : Error<
405 "expected selector for Objective-C %select{setter|getter}0">;
406 def err_objc_property_requires_field_name : Error<
407 "property requires fields to be named">;
408 def err_objc_property_bitfield : Error<"property name cannot be a bitfield">;
409 def err_objc_expected_property_attr : Error<"unknown property attribute %0">;
410 def err_objc_properties_require_objc2 : Error<
411 "properties are an Objective-C 2 feature">;
412 def err_objc_unexpected_attr : Error<
413 "prefix attribute must be followed by an interface or protocol">;
414 def err_objc_postfix_attribute : Error <
415 "postfix attributes are not allowed on Objective-C directives">;
416 def err_objc_postfix_attribute_hint : Error <
417 "postfix attributes are not allowed on Objective-C directives, place"
418 " them in front of '%select{@interface|@protocol}0'">;
419 def err_objc_directive_only_in_protocol : Error<
420 "directive may only be specified in protocols only">;
421 def err_missing_catch_finally : Error<
422 "@try statement without a @catch and @finally clause">;
423 def err_objc_concat_string : Error<"unexpected token after Objective-C string">;
424 def err_expected_objc_container : Error<
425 "'@end' must appear in an Objective-C context">;
426 def err_unexpected_protocol_qualifier : Error<
427 "@implementation declaration can not be protocol qualified">;
428 def err_objc_unexpected_atend : Error<
429 "'@end' appears where closing brace '}' is expected">;
430 def error_property_ivar_decl : Error<
431 "property synthesize requires specification of an ivar">;
432 def err_synthesized_property_name : Error<
433 "expected a property name in @synthesize">;
434 def warn_semicolon_before_method_body : Warning<
435 "semicolon before method body is ignored">,
436 InGroup<DiagGroup<"semicolon-before-method-body">>, DefaultIgnore;
437 def note_extra_comma_message_arg : Note<
438 "comma separating Objective-C messaging arguments">;
440 def err_expected_field_designator : Error<
441 "expected a field designator, such as '.field = 4'">;
443 def err_declaration_does_not_declare_param : Error<
444 "declaration does not declare a parameter">;
445 def err_no_matching_param : Error<"parameter named %0 is missing">;
447 /// C++ parser diagnostics
448 def err_invalid_operator_on_type : Error<
449 "cannot use %select{dot|arrow}0 operator on a type">;
450 def err_expected_unqualified_id : Error<
451 "expected %select{identifier|unqualified-id}0">;
452 def err_unexpected_unqualified_id : Error<"type-id cannot have a name">;
453 def err_func_def_no_params : Error<
454 "function definition does not declare parameters">;
455 def err_expected_lparen_after_type : Error<
456 "expected '(' for function-style cast or type construction">;
457 def err_expected_init_in_condition : Error<
458 "variable declaration in condition must have an initializer">;
459 def err_expected_init_in_condition_lparen : Error<
460 "variable declaration in condition cannot have a parenthesized initializer">;
461 def err_extraneous_rparen_in_condition : Error<
462 "extraneous ')' after condition, expected a statement">;
463 def warn_dangling_else : Warning<
464 "add explicit braces to avoid dangling else">,
465 InGroup<DanglingElse>;
466 def err_expected_member_or_base_name : Error<
467 "expected class member or base class name">;
468 def err_expected_lbrace_after_base_specifiers : Error<
469 "expected '{' after base class list">;
470 def err_missing_end_of_definition : Error<
471 "missing '}' at end of definition of %q0">;
472 def note_missing_end_of_definition_before : Note<
473 "still within definition of %q0 here">;
474 def ext_ellipsis_exception_spec : Extension<
475 "exception specification of '...' is a Microsoft extension">,
477 def err_dynamic_and_noexcept_specification : Error<
478 "cannot have both throw() and noexcept() clause on the same function">;
479 def warn_cxx98_compat_noexcept_decl : Warning<
480 "noexcept specifications are incompatible with C++98">,
481 InGroup<CXX98Compat>, DefaultIgnore;
482 def err_expected_catch : Error<"expected catch">;
483 def err_expected_lbrace_or_comma : Error<"expected '{' or ','">;
484 def err_expected_rbrace_or_comma : Error<"expected '}' or ','">;
485 def err_expected_rsquare_or_comma : Error<"expected ']' or ','">;
486 def err_using_namespace_in_class : Error<
487 "'using namespace' is not allowed in classes">;
488 def err_constructor_bad_name : Error<
489 "missing return type for function %0; did you mean the constructor name %1?">;
490 def err_destructor_tilde_identifier : Error<
491 "expected a class name after '~' to name a destructor">;
492 def err_destructor_template_id : Error<
493 "destructor name %0 does not refer to a template">;
494 def err_default_arg_unparsed : Error<
495 "unexpected end of default argument expression">;
496 def err_bracket_depth_exceeded : Error<
497 "bracket nesting level exceeded maximum of %0">, DefaultFatal;
498 def note_bracket_depth : Note<
499 "use -fbracket-depth=N to increase maximum nesting level">;
500 def err_misplaced_ellipsis_in_declaration : Error<
501 "'...' must %select{immediately precede declared identifier|"
502 "be innermost component of anonymous pack declaration}0">;
503 def ext_abstract_pack_declarator_parens : ExtWarn<
504 "ISO C++11 requires a parenthesized pack declaration to have a name">,
505 InGroup<DiagGroup<"anonymous-pack-parens">>;
506 def err_function_is_not_record : Error<
507 "unexpected '%select{.|->}0' in function call; perhaps remove the "
508 "'%select{.|->}0'?">;
510 // C++ derived classes
511 def err_dup_virtual : Error<"duplicate 'virtual' in base specifier">;
513 // C++ operator overloading
514 def err_literal_operator_string_prefix : Error<
515 "string literal after 'operator' cannot have an encoding prefix">;
516 def err_literal_operator_string_not_empty : Error<
517 "string literal after 'operator' must be '\"\"'">;
518 def warn_cxx98_compat_literal_operator : Warning<
519 "literal operators are incompatible with C++98">,
520 InGroup<CXX98Compat>, DefaultIgnore;
523 def err_anon_type_definition : Error<
524 "declaration of anonymous %0 must be a definition">;
525 def err_default_delete_in_multiple_declaration : Error<
526 "'= %select{default|delete}0' is a function definition and must occur in a "
527 "standalone declaration">;
529 def warn_cxx98_compat_noexcept_expr : Warning<
530 "noexcept expressions are incompatible with C++98">,
531 InGroup<CXX98Compat>, DefaultIgnore;
532 def warn_cxx98_compat_nullptr : Warning<
533 "'nullptr' is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
535 def warn_cxx98_compat_alignas : Warning<"'alignas' is incompatible with C++98">,
536 InGroup<CXX98Compat>, DefaultIgnore;
537 def warn_cxx98_compat_attribute : Warning<
538 "attributes are incompatible with C++98">,
539 InGroup<CXX98Compat>, DefaultIgnore;
540 def err_cxx11_attribute_forbids_arguments : Error<
541 "attribute '%0' cannot have an argument list">;
542 def err_cxx11_attribute_forbids_ellipsis : Error<
543 "attribute '%0' cannot be used as an attribute pack">;
544 def err_cxx11_attribute_repeated : Error<
545 "attribute %0 cannot appear multiple times in an attribute specifier">;
546 def err_attributes_not_allowed : Error<"an attribute list cannot appear here">;
547 def err_l_square_l_square_not_attribute : Error<
548 "C++11 only allows consecutive left square brackets when "
549 "introducing an attribute">;
550 def err_ms_declspec_type : Error<
551 "__declspec attributes must be an identifier or string literal">;
552 def warn_ms_declspec_unknown : Warning<
553 "unknown __declspec attribute %0 ignored">, InGroup<UnknownAttributes>;
554 def err_ms_property_no_getter_or_putter : Error<
555 "property does not specify a getter or a putter">;
556 def err_ms_property_unknown_accessor : Error<
557 "expected 'get' or 'put' in property declaration">;
558 def err_ms_property_has_set_accessor : Error<
559 "putter for property must be specified as 'put', not 'set'">;
560 def err_ms_property_missing_accessor_kind : Error<
561 "missing 'get=' or 'put='">;
562 def err_ms_property_expected_equal : Error<
563 "expected '=' after '%0'">;
564 def err_ms_property_duplicate_accessor : Error<
565 "property declaration specifies '%0' accessor twice">;
566 def err_ms_property_expected_accessor_name : Error<
567 "expected name of accessor method">;
568 def err_ms_property_expected_comma_or_rparen : Error<
569 "expected ',' or ')' at end of property accessor list">;
572 def err_expected_template : Error<"expected template">;
573 def err_unknown_template_name : Error<
574 "unknown template name %0">;
575 def err_expected_comma_greater : Error<
576 "expected ',' or '>' in template-parameter-list">;
577 def err_class_on_template_template_param : Error<
578 "template template parameter requires 'class' after the parameter list">;
579 def err_template_spec_syntax_non_template : Error<
580 "identifier followed by '<' indicates a class template specialization but "
581 "%0 %select{does not refer to a template|refers to a function "
582 "template|<unused>|refers to a template template parameter}1">;
583 def err_id_after_template_in_nested_name_spec : Error<
584 "expected template name after 'template' keyword in nested name specifier">;
585 def err_two_right_angle_brackets_need_space : Error<
586 "a space is required between consecutive right angle brackets (use '> >')">;
587 def err_right_angle_bracket_equal_needs_space : Error<
588 "a space is required between a right angle bracket and an equals sign "
590 def warn_cxx11_right_shift_in_template_arg : Warning<
591 "use of right-shift operator ('>>') in template argument will require "
592 "parentheses in C++11">, InGroup<CXX11Compat>;
593 def warn_cxx98_compat_two_right_angle_brackets : Warning<
594 "consecutive right angle brackets are incompatible with C++98 (use '> >')">,
595 InGroup<CXX98Compat>, DefaultIgnore;
596 def err_multiple_template_declarators : Error<
597 "%select{|a template declaration|an explicit template specialization|"
598 "an explicit template instantiation}0 can "
599 "only %select{|declare|declare|instantiate}0 a single entity">;
600 def err_explicit_instantiation_with_definition : Error<
601 "explicit template instantiation cannot have a definition; if this "
602 "definition is meant to be an explicit specialization, add '<>' after the "
603 "'template' keyword">;
604 def err_template_defn_explicit_instantiation : Error<
605 "%select{function|class|variable}0 cannot be defined in an explicit instantiation; if this "
606 "declaration is meant to be a %select{function|class|variable}0 definition, remove the 'template' keyword">;
607 def err_friend_explicit_instantiation : Error<
608 "friend cannot be declared in an explicit instantiation; if this "
609 "declaration is meant to be a friend declaration, remove the 'template' keyword">;
610 def err_explicit_instantiation_enum : Error<
611 "enumerations cannot be explicitly instantiated">;
612 def err_expected_template_parameter : Error<"expected template parameter">;
614 def err_missing_dependent_template_keyword : Error<
615 "use 'template' keyword to treat '%0' as a dependent template name">;
616 def warn_missing_dependent_template_keyword : ExtWarn<
617 "use 'template' keyword to treat '%0' as a dependent template name">;
619 def ext_extern_template : Extension<
620 "extern templates are a C++11 extension">, InGroup<CXX11>;
621 def warn_cxx98_compat_extern_template : Warning<
622 "extern templates are incompatible with C++98">,
623 InGroup<CXX98CompatPedantic>, DefaultIgnore;
624 def warn_static_inline_explicit_inst_ignored : Warning<
625 "ignoring '%select{static|inline}0' keyword on explicit template "
626 "instantiation">, InGroup<DiagGroup<"static-inline-explicit-instantiation">>;
628 // Constructor template diagnostics.
629 def err_out_of_line_constructor_template_id : Error<
630 "out-of-line constructor for %0 cannot have template arguments">;
631 def err_out_of_line_template_id_names_constructor : Error<
632 "qualified reference to %0 is a constructor name rather than a "
633 "template name wherever a constructor can be declared">;
634 def err_out_of_line_type_names_constructor : Error<
635 "qualified reference to %0 is a constructor name rather than a "
636 "type wherever a constructor can be declared">;
638 def err_expected_qualified_after_typename : Error<
639 "expected a qualified name after 'typename'">;
640 def warn_expected_qualified_after_typename : ExtWarn<
641 "expected a qualified name after 'typename'">;
642 def err_expected_semi_after_tagdecl : Error<
643 "expected ';' after %0">;
645 def err_typename_refers_to_non_type_template : Error<
646 "typename specifier refers to a non-template">;
647 def err_expected_type_name_after_typename : Error<
648 "expected an identifier or template-id after '::'">;
649 def err_explicit_spec_non_template : Error<
650 "explicit %select{specialization|instantiation}0 of non-template "
651 "%select{class|struct|union|interface}1 %2">;
653 def err_default_template_template_parameter_not_template : Error<
654 "default template argument for a template template parameter must be a class "
657 def err_ctor_init_missing_comma : Error<
658 "missing ',' between base or member initializers">;
661 def err_friend_decl_defines_type : Error<
662 "cannot define a type in a friend declaration">;
663 def err_missing_whitespace_digraph : Error<
664 "found '<::' after a "
665 "%select{template name|const_cast|dynamic_cast|reinterpret_cast|static_cast}0"
666 " which forms the digraph '<:' (aka '[') and a ':', did you mean '< ::'?">;
668 def ext_deleted_function : ExtWarn<
669 "deleted function definitions are a C++11 extension">, InGroup<CXX11>;
670 def warn_cxx98_compat_deleted_function : Warning<
671 "deleted function definitions are incompatible with C++98">,
672 InGroup<CXX98Compat>, DefaultIgnore;
673 def ext_defaulted_function : ExtWarn<
674 "defaulted function definitions are a C++11 extension">, InGroup<CXX11>;
675 def warn_cxx98_compat_defaulted_function : Warning<
676 "defaulted function definitions are incompatible with C++98">,
677 InGroup<CXX98Compat>, DefaultIgnore;
679 // C++11 in-class member initialization
680 def ext_nonstatic_member_init : ExtWarn<
681 "in-class initialization of non-static data member is a C++11 extension">,
683 def warn_cxx98_compat_nonstatic_member_init : Warning<
684 "in-class initialization of non-static data members is incompatible with C++98">,
685 InGroup<CXX98Compat>, DefaultIgnore;
686 def err_bitfield_member_init: Error<
687 "bitfield member cannot have an in-class initializer">;
688 def err_incomplete_array_member_init: Error<
689 "array bound cannot be deduced from an in-class initializer">;
691 // C++11 alias-declaration
692 def ext_alias_declaration : ExtWarn<
693 "alias declarations are a C++11 extension">, InGroup<CXX11>;
694 def warn_cxx98_compat_alias_declaration : Warning<
695 "alias declarations are incompatible with C++98">,
696 InGroup<CXX98Compat>, DefaultIgnore;
697 def err_alias_declaration_not_identifier : Error<
698 "name defined in alias declaration must be an identifier">;
699 def err_alias_declaration_specialization : Error<
700 "%select{partial specialization|explicit specialization|explicit instantiation}0 of alias templates is not permitted">;
702 // C++11 override control
703 def ext_override_control_keyword : ExtWarn<
704 "'%0' keyword is a C++11 extension">, InGroup<CXX11>;
705 def warn_cxx98_compat_override_control_keyword : Warning<
706 "'%0' keyword is incompatible with C++98">,
707 InGroup<CXX98Compat>, DefaultIgnore;
708 def err_override_control_interface : Error<
709 "'%0' keyword not permitted with interface types">;
710 def ext_ms_sealed_keyword : ExtWarn<
711 "'sealed' keyword is a Microsoft extension">,
714 def err_access_specifier_interface : Error<
715 "interface types cannot specify '%select{private|protected}0' access">;
717 def err_duplicate_virt_specifier : Error<
718 "class member already marked '%0'">;
720 def err_scoped_enum_missing_identifier : Error<
721 "scoped enumeration requires a name">;
722 def ext_scoped_enum : ExtWarn<
723 "scoped enumerations are a C++11 extension">, InGroup<CXX11>;
724 def warn_cxx98_compat_scoped_enum : Warning<
725 "scoped enumerations are incompatible with C++98">,
726 InGroup<CXX98Compat>, DefaultIgnore;
728 def err_expected_parameter_pack : Error<
729 "expected the name of a parameter pack">;
730 def err_paren_sizeof_parameter_pack : Error<
731 "missing parentheses around the size of parameter pack %0">;
732 def err_sizeof_parameter_pack : Error<
733 "expected parenthesized parameter pack name in 'sizeof...' expression">;
735 // C++11 lambda expressions
736 def err_expected_comma_or_rsquare : Error<
737 "expected ',' or ']' in lambda capture list">;
738 def err_this_captured_by_reference : Error<
739 "'this' cannot be captured by reference">;
740 def err_expected_capture : Error<
741 "expected variable name or 'this' in lambda capture list">;
742 def err_expected_lambda_body : Error<"expected body of lambda expression">;
743 def warn_cxx98_compat_lambda : Warning<
744 "lambda expressions are incompatible with C++98">,
745 InGroup<CXX98Compat>, DefaultIgnore;
746 def err_lambda_missing_parens : Error<
747 "lambda requires '()' before %select{'mutable'|return type}0">;
749 // Availability attribute
750 def err_expected_version : Error<
751 "expected a version of the form 'major[.minor[.subminor]]'">;
752 def err_zero_version : Error<
753 "version number must have non-zero major, minor, or sub-minor version">;
754 def err_availability_expected_platform : Error<
755 "expected a platform name, e.g., 'macosx'">;
756 def err_availability_expected_change : Error<
757 "expected 'introduced', 'deprecated', or 'obsoleted'">;
758 def err_availability_unknown_change : Error<
759 "%0 is not an availability stage; use 'introduced', 'deprecated', or "
761 def err_availability_redundant : Error<
762 "redundant %0 availability change; only the last specified change will "
764 def warn_availability_and_unavailable : Warning<
765 "'unavailable' availability overrides all other availability information">,
766 InGroup<Availability>;
768 // Type safety attributes
769 def err_type_safety_unknown_flag : Error<
770 "invalid comparison flag %0; use 'layout_compatible' or 'must_be_null'">;
772 // Language specific pragmas
773 // - Generic warnings
774 def warn_pragma_expected_lparen : Warning<
775 "missing '(' after '#pragma %0' - ignoring">;
776 def warn_pragma_expected_rparen : Warning<
777 "missing ')' after '#pragma %0' - ignoring">;
778 def warn_pragma_expected_identifier : Warning<
779 "expected identifier in '#pragma %0' - ignored">;
780 def warn_pragma_ms_struct : Warning<
781 "incorrect use of '#pragma ms_struct on|off' - ignored">;
782 def warn_pragma_extra_tokens_at_eol : Warning<
783 "extra tokens at end of '#pragma %0' - ignored">;
785 def warn_pragma_options_expected_align : Warning<
786 "expected 'align' following '#pragma options' - ignored">;
787 def warn_pragma_align_expected_equal : Warning<
788 "expected '=' following '#pragma %select{align|options align}0' - ignored">;
789 def warn_pragma_align_invalid_option : Warning<
790 "invalid alignment option in '#pragma %select{align|options align}0' - ignored">;
792 def warn_pragma_pack_invalid_action : Warning<
793 "unknown action for '#pragma pack' - ignored">;
794 def warn_pragma_pack_malformed : Warning<
795 "expected integer or identifier in '#pragma pack' - ignored">;
797 def warn_pragma_unused_expected_var : Warning<
798 "expected '#pragma unused' argument to be a variable name">;
799 def warn_pragma_unused_expected_punc : Warning<
800 "expected ')' or ',' in '#pragma unused'">;
801 // - #pragma fp_contract
802 def err_pragma_fp_contract_scope : Error<
803 "'#pragma fp_contract' can only appear at file scope or at the start of a "
804 "compound statement">;
806 def err_pragma_comment_malformed : Error<
807 "pragma comment requires parenthesized identifier and optional string">;
808 def err_pragma_comment_unknown_kind : Error<"unknown kind of pragma comment">;
809 // - #pragma detect_mismatch
810 def err_pragma_detect_mismatch_malformed : Error<
811 "pragma detect_mismatch is malformed; it requires two comma-separated "
814 // OpenCL Section 6.8.g
815 def err_not_opencl_storage_class_specifier : Error<
816 "OpenCL does not support the '%0' storage class specifier">;
818 // OpenCL EXTENSION pragma (OpenCL 1.1 [9.1])
819 def warn_pragma_expected_colon : Warning<
820 "missing ':' after %0 - ignoring">;
821 def warn_pragma_expected_enable_disable : Warning<
822 "expected 'enable' or 'disable' - ignoring">;
823 def warn_pragma_unknown_extension : Warning<
824 "unknown OpenCL extension %0 - ignoring">;
826 def err_seh_expected_handler : Error<
827 "expected '__except' or '__finally' block">;
829 def err_seh___except_block : Error<
830 "%0 only allowed in __except block">;
832 def err_seh___except_filter : Error<
833 "%0 only allowed in __except filter expression">;
835 def err_seh___finally_block : Error<
836 "%0 only allowed in __finally block">;
839 def warn_pragma_omp_ignored : Warning <
840 "unexpected '#pragma omp ...' in program">, InGroup<SourceUsesOpenMP>, DefaultIgnore;
841 def warn_omp_extra_tokens_at_eol : Warning <
842 "extra tokens at the end of '#pragma omp %0' are ignored">,
843 InGroup<ExtraTokens>;
844 def err_omp_unknown_directive : Error <
845 "expected an OpenMP directive">;
846 def err_omp_unexpected_directive : Error <
847 "unexpected OpenMP directive '#pragma omp %0'">;
848 def err_omp_expected_punc : Error <
849 "expected ',' or ')' in %select{'#pragma omp %1'|'%1' clause}0">;
850 def err_omp_unexpected_clause : Error <
851 "unexpected OpenMP clause '%0' in directive '#pragma omp %1'">;
852 def err_omp_more_one_clause : Error <
853 "directive '#pragma omp %0' cannot contain more than one '%1' clause">;
854 } // end of Parse Issue category.
856 let CategoryName = "Modules Issue" in {
857 def err_module_expected_ident : Error<
858 "expected a module name after module import">;
859 def err_module_expected_semi : Error<
860 "expected ';' after module name">;
863 } // end of Parser diagnostics