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 warn_asm_qualifier_ignored : Warning<
17 "ignored %0 qualifier on asm">, CatInlineAsm, InGroup<ASMIgnoredQualifier>;
18 def warn_file_asm_volatile : Warning<
19 "meaningless 'volatile' on asm outside function">, CatInlineAsm,
20 InGroup<ASMIgnoredQualifier>;
22 let CategoryName = "Inline Assembly Issue" in {
23 def err_asm_empty : Error<"__asm used with no assembly instructions">;
24 def err_inline_ms_asm_parsing : Error<"%0">;
25 def err_msasm_unsupported_arch : Error<
26 "Unsupported architecture '%0' for MS-style inline assembly">;
27 def err_msasm_unable_to_create_target : Error<
28 "MS-style inline assembly is not available: %0">;
29 def err_gnu_inline_asm_disabled : Error<
30 "GNU-style inline assembly is disabled">;
31 def err_asm_goto_not_supported_yet : Error<
32 "'asm goto' constructs are not supported yet">;
35 let CategoryName = "Parse Issue" in {
37 def ext_empty_translation_unit : Extension<
38 "ISO C requires a translation unit to contain at least one declaration">,
39 InGroup<DiagGroup<"empty-translation-unit">>;
40 def warn_cxx98_compat_top_level_semi : Warning<
41 "extra ';' outside of a function is incompatible with C++98">,
42 InGroup<CXX98CompatExtraSemi>, DefaultIgnore;
43 def ext_extra_semi : Extension<
45 "outside of a function|"
47 "inside instance variable list|"
48 "after member function definition}0">,
50 def ext_extra_semi_cxx11 : Extension<
51 "extra ';' outside of a function is a C++11 extension">,
52 InGroup<CXX11ExtraSemi>;
53 def warn_extra_semi_after_mem_fn_def : Warning<
54 "extra ';' after member function definition">,
55 InGroup<ExtraSemi>, DefaultIgnore;
56 def warn_null_statement : Warning<
57 "empty expression statement has no effect; "
58 "remove unnecessary ';' to silence this warning">,
59 InGroup<ExtraSemiStmt>, DefaultIgnore;
61 def ext_thread_before : Extension<"'__thread' before '%0'">;
62 def ext_keyword_as_ident : ExtWarn<
63 "keyword '%0' will be made available as an identifier "
64 "%select{here|for the remainder of the translation unit}1">,
65 InGroup<KeywordCompat>;
67 def ext_nullability : Extension<
68 "type nullability specifier %0 is a Clang extension">,
69 InGroup<DiagGroup<"nullability-extension">>;
71 def err_empty_enum : Error<"use of empty enum">;
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_ms_c_enum_fixed_underlying_type : Extension<
96 "enumeration types with a fixed underlying type are a Microsoft extension">,
97 InGroup<MicrosoftFixedEnum>;
98 def ext_clang_c_enum_fixed_underlying_type : Extension<
99 "enumeration types with a fixed underlying type are a Clang extension">,
100 InGroup<DiagGroup<"fixed-enum-extension">>;
101 def warn_cxx98_compat_enum_fixed_underlying_type : Warning<
102 "enumeration types with a fixed underlying type are incompatible with C++98">,
103 InGroup<CXX98Compat>, DefaultIgnore;
104 def warn_cxx98_compat_alignof : Warning<
105 "alignof expressions are incompatible with C++98">,
106 InGroup<CXX98Compat>, DefaultIgnore;
107 def ext_alignof_expr : ExtWarn<
108 "%0 applied to an expression is a GNU extension">, InGroup<GNUAlignofExpression>;
110 def warn_microsoft_dependent_exists : Warning<
111 "dependent %select{__if_not_exists|__if_exists}0 declarations are ignored">,
112 InGroup<DiagGroup<"microsoft-exists">>;
113 def warn_microsoft_qualifiers_ignored : Warning<
114 "qualifiers after comma in declarator list are ignored">,
115 InGroup<IgnoredAttributes>;
117 def ext_c11_generic_selection : Extension<
118 "generic selections are a C11-specific feature">, InGroup<C11>;
119 def err_duplicate_default_assoc : Error<
120 "duplicate default generic association">;
121 def note_previous_default_assoc : Note<
122 "previous default generic association is here">;
124 def ext_c11_alignment : Extension<
125 "%0 is a C11-specific feature">, InGroup<C11>;
127 def ext_c11_noreturn : Extension<
128 "_Noreturn functions are a C11-specific feature">, InGroup<C11>;
129 def err_c11_noreturn_misplaced : Error<
130 "'_Noreturn' keyword must precede function declarator">;
132 def ext_gnu_indirect_goto : Extension<
133 "use of GNU indirect-goto extension">, InGroup<GNULabelsAsValue>;
134 def ext_gnu_address_of_label : Extension<
135 "use of GNU address-of-label extension">, InGroup<GNULabelsAsValue>;
136 def err_stmtexpr_file_scope : Error<
137 "statement expression not allowed at file scope">;
138 def ext_gnu_statement_expr : Extension<
139 "use of GNU statement expression extension">, InGroup<GNUStatementExpression>;
140 def ext_gnu_conditional_expr : Extension<
141 "use of GNU ?: conditional expression extension, omitting middle operand">, InGroup<GNUConditionalOmittedOperand>;
142 def ext_gnu_empty_initializer : Extension<
143 "use of GNU empty initializer extension">, InGroup<GNUEmptyInitializer>;
144 def ext_gnu_array_range : Extension<"use of GNU array range extension">,
145 InGroup<GNUDesignator>;
146 def ext_gnu_missing_equal_designator : ExtWarn<
147 "use of GNU 'missing =' extension in designator">,
148 InGroup<GNUDesignator>;
149 def err_expected_equal_designator : Error<"expected '=' or another designator">;
150 def ext_gnu_old_style_field_designator : ExtWarn<
151 "use of GNU old-style field designator extension">,
152 InGroup<GNUDesignator>;
153 def ext_gnu_case_range : Extension<"use of GNU case range extension">,
154 InGroup<GNUCaseRange>;
157 def err_expected_expression : Error<"expected expression">;
158 def err_expected_type : Error<"expected a type">;
159 def err_expected_external_declaration : Error<"expected external declaration">;
160 def err_extraneous_closing_brace : Error<"extraneous closing brace ('}')">;
161 def err_expected_semi_declaration : Error<
162 "expected ';' at end of declaration">;
163 def err_expected_semi_decl_list : Error<
164 "expected ';' at end of declaration list">;
165 def ext_expected_semi_decl_list : ExtWarn<
166 "expected ';' at end of declaration list">;
167 def err_expected_member_name_or_semi : Error<
168 "expected member name or ';' after declaration specifiers">;
169 def err_function_declared_typedef : Error<
170 "function definition declared 'typedef'">;
171 def err_at_defs_cxx : Error<"@defs is not supported in Objective-C++">;
172 def err_at_in_class : Error<"unexpected '@' in member specification">;
173 def err_unexpected_semi : Error<"unexpected ';' before %0">;
175 def err_expected_fn_body : Error<
176 "expected function body after function declarator">;
177 def warn_attribute_on_function_definition : Warning<
178 "GCC does not allow %0 attribute in this position on a function definition">,
180 def warn_gcc_attribute_location : Warning<
181 "GCC does not allow an attribute in this position on a function declaration">,
183 def warn_gcc_variable_decl_in_for_loop : Warning<
184 "GCC does not allow variable declarations in for loop initializers before "
185 "C99">, InGroup<GccCompat>;
186 def warn_attribute_no_decl : Warning<
187 "attribute %0 ignored, because it is not attached to a declaration">,
188 InGroup<IgnoredAttributes>;
189 def err_ms_attributes_not_enabled : Error<
190 "'__declspec' attributes are not enabled; use '-fdeclspec' or "
191 "'-fms-extensions' to enable support for __declspec attributes">;
192 def err_expected_method_body : Error<"expected method body">;
193 def err_declspec_after_virtspec : Error<
194 "'%0' qualifier may not appear after the virtual specifier '%1'">;
195 def err_invalid_token_after_toplevel_declarator : Error<
196 "expected ';' after top level declarator">;
197 def err_invalid_token_after_declarator_suggest_equal : Error<
198 "invalid %0 at end of declaration; did you mean '='?">;
199 def err_expected_statement : Error<"expected statement">;
200 def err_expected_lparen_after : Error<"expected '(' after '%0'">;
201 def err_expected_rparen_after : Error<"expected ')' after '%0'">;
202 def err_expected_punc : Error<"expected ')' or ',' after '%0'">;
203 def err_expected_less_after : Error<"expected '<' after '%0'">;
204 def err_expected_lbrace_in_compound_literal : Error<
205 "expected '{' in compound literal">;
206 def err_expected_while : Error<"expected 'while' in do/while loop">;
208 def err_expected_semi_after_stmt : Error<"expected ';' after %0 statement">;
209 def err_expected_semi_after_expr : Error<"expected ';' after expression">;
210 def err_extraneous_token_before_semi : Error<"extraneous '%0' before ';'">;
212 def err_expected_semi_after_method_proto : Error<
213 "expected ';' after method prototype">;
214 def err_expected_semi_after_namespace_name : Error<
215 "expected ';' after namespace name">;
216 def err_unexpected_namespace_attributes_alias : Error<
217 "attributes cannot be specified on namespace alias">;
218 def err_unexpected_nested_namespace_attribute : Error<
219 "attributes cannot be specified on a nested namespace definition">;
220 def err_inline_namespace_alias : Error<"namespace alias cannot be inline">;
221 def err_namespace_nonnamespace_scope : Error<
222 "namespaces can only be defined in global or namespace scope">;
223 def ext_nested_namespace_definition : ExtWarn<
224 "nested namespace definition is a C++17 extension; "
225 "define each namespace separately">, InGroup<CXX17>;
226 def warn_cxx14_compat_nested_namespace_definition : Warning<
227 "nested namespace definition is incompatible with C++ standards before C++17">,
228 InGroup<CXXPre17Compat>, DefaultIgnore;
229 def ext_inline_nested_namespace_definition : ExtWarn<
230 "inline nested namespace definition is a C++2a extension">, InGroup<CXX2a>;
231 def warn_cxx17_compat_inline_nested_namespace_definition : Warning<
232 "inline nested namespace definition is incompatible with C++ standards before"
233 " C++2a">, InGroup<CXXPre2aCompat>, DefaultIgnore;
234 def err_inline_nested_namespace_definition : Error<
235 "nested namespace definition cannot be 'inline'">;
236 def err_expected_semi_after_attribute_list : Error<
237 "expected ';' after attribute list">;
238 def err_expected_semi_after_static_assert : Error<
239 "expected ';' after static_assert">;
240 def err_expected_semi_for : Error<"expected ';' in 'for' statement specifier">;
241 def err_single_decl_assign_in_for_range : Error<
242 "range-based 'for' statement uses ':', not '='">;
243 def warn_missing_selector_name : Warning<
244 "%0 used as the name of the previous parameter rather than as part "
246 InGroup<DiagGroup<"missing-selector-name">>;
247 def note_missing_selector_name : Note<
248 "introduce a parameter name to make %0 part of the selector">;
249 def note_force_empty_selector_name : Note<
250 "or insert whitespace before ':' to use %0 as parameter name "
251 "and have an empty entry in the selector">;
252 def err_label_end_of_compound_statement : Error<
253 "label at end of compound statement: expected statement">;
254 def err_address_of_label_outside_fn : Error<
255 "use of address-of-label extension outside of a function body">;
256 def err_asm_operand_wide_string_literal : Error<
257 "cannot use %select{unicode|wide}0 string literal in 'asm'">;
258 def err_expected_selector_for_method : Error<
259 "expected selector for Objective-C method">;
260 def err_expected_property_name : Error<"expected property name">;
262 def err_unexpected_at : Error<"unexpected '@' in program">;
263 def err_atimport : Error<
264 "use of '@import' when modules are disabled">;
266 def warn_atimport_in_framework_header : Warning<
267 "use of '@import' in framework header is discouraged, "
268 "including this header requires -fmodules">,
269 InGroup<FrameworkHdrAtImport>;
271 def err_invalid_reference_qualifier_application : Error<
272 "'%0' qualifier may not be applied to a reference">;
273 def err_illegal_decl_reference_to_reference : Error<
274 "%0 declared as a reference to a reference">;
275 def ext_rvalue_reference : ExtWarn<
276 "rvalue references are a C++11 extension">, InGroup<CXX11>;
277 def warn_cxx98_compat_rvalue_reference : Warning<
278 "rvalue references are incompatible with C++98">,
279 InGroup<CXX98Compat>, DefaultIgnore;
280 def ext_ref_qualifier : ExtWarn<
281 "reference qualifiers on functions are a C++11 extension">, InGroup<CXX11>;
282 def warn_cxx98_compat_ref_qualifier : Warning<
283 "reference qualifiers on functions are incompatible with C++98">,
284 InGroup<CXX98Compat>, DefaultIgnore;
285 def ext_inline_namespace : ExtWarn<
286 "inline namespaces are a C++11 feature">, InGroup<CXX11InlineNamespace>;
287 def warn_cxx98_compat_inline_namespace : Warning<
288 "inline namespaces are incompatible with C++98">,
289 InGroup<CXX98Compat>, DefaultIgnore;
290 def ext_generalized_initializer_lists : ExtWarn<
291 "generalized initializer lists are a C++11 extension">,
293 def warn_cxx98_compat_generalized_initializer_lists : Warning<
294 "generalized initializer lists are incompatible with C++98">,
295 InGroup<CXX98Compat>, DefaultIgnore;
296 def err_init_list_bin_op : Error<"initializer list cannot be used on the "
297 "%select{left|right}0 hand side of operator '%1'">;
298 def warn_cxx98_compat_trailing_return_type : Warning<
299 "trailing return types are incompatible with C++98">,
300 InGroup<CXX98Compat>, DefaultIgnore;
301 def ext_auto_storage_class : ExtWarn<
302 "'auto' storage class specifier is not permitted in C++11, and will not "
303 "be supported in future releases">, InGroup<DiagGroup<"auto-storage-class">>;
304 def ext_decltype_auto_type_specifier : ExtWarn<
305 "'decltype(auto)' type specifier is a C++14 extension">, InGroup<CXX14>;
306 def warn_cxx11_compat_decltype_auto_type_specifier : Warning<
307 "'decltype(auto)' type specifier is incompatible with C++ standards before "
308 "C++14">, InGroup<CXXPre14Compat>, DefaultIgnore;
309 def ext_auto_type : Extension<
310 "'__auto_type' is a GNU extension">,
311 InGroup<GNUAutoType>;
312 def ext_for_range : ExtWarn<
313 "range-based for loop is a C++11 extension">, InGroup<CXX11>;
314 def warn_cxx98_compat_for_range : Warning<
315 "range-based for loop is incompatible with C++98">,
316 InGroup<CXX98Compat>, DefaultIgnore;
317 def err_for_range_identifier : Error<
318 "range-based for loop requires type for loop variable">;
319 def err_for_range_expected_decl : Error<
320 "for range declaration must declare a variable">;
321 def err_argument_required_after_attribute : Error<
322 "argument required after attribute">;
323 def err_missing_param : Error<"expected parameter declarator">;
324 def err_missing_comma_before_ellipsis : Error<
325 "C requires a comma prior to the ellipsis in a variadic function type">;
326 def err_unexpected_typedef_ident : Error<
327 "unexpected type name %0: expected identifier">;
328 def warn_cxx98_compat_decltype : Warning<
329 "'decltype' type specifier is incompatible with C++98">,
330 InGroup<CXX98Compat>, DefaultIgnore;
331 def err_unexpected_scope_on_base_decltype : Error<
332 "unexpected namespace scope prior to decltype">;
333 def err_expected_class_name : Error<"expected class name">;
334 def err_expected_class_name_not_template :
335 Error<"'typename' is redundant; base classes are implicitly types">;
336 def err_unspecified_vla_size_with_static : Error<
337 "'static' may not be used with an unspecified variable length array size">;
338 def err_unspecified_size_with_static : Error<
339 "'static' may not be used without an array size">;
340 def err_expected_parentheses_around_typename : Error<
341 "expected parentheses around type name in %0 expression">;
343 def err_expected_case_before_expression: Error<
344 "expected 'case' keyword before expression">;
346 def ext_warn_gnu_final : ExtWarn<
347 "__final is a GNU extension, consider using C++11 final">,
351 def err_typename_requires_specqual : Error<
352 "type name requires a specifier or qualifier">;
353 def err_typename_invalid_storageclass : Error<
354 "type name does not allow storage class to be specified">;
355 def err_typename_invalid_functionspec : Error<
356 "type name does not allow function specifier to be specified">;
357 def err_typename_invalid_constexpr : Error<
358 "type name does not allow constexpr specifier to be specified">;
359 def err_typename_identifiers_only : Error<
360 "typename is allowed for identifiers only">;
362 def err_friend_invalid_in_context : Error<
363 "'friend' used outside of class">;
364 def err_templated_using_directive_declaration : Error<
365 "cannot template a using %select{directive|declaration}0">;
366 def err_unexpected_colon_in_nested_name_spec : Error<
367 "unexpected ':' in nested name specifier; did you mean '::'?">;
368 def err_unexpected_token_in_nested_name_spec : Error<
369 "'%0' cannot be a part of nested name specifier; did you mean ':'?">;
370 def err_bool_redeclaration : Error<
371 "redeclaration of C++ built-in type 'bool'">;
372 def ext_c11_static_assert : Extension<
373 "_Static_assert is a C11-specific feature">, InGroup<C11>;
374 def warn_cxx98_compat_static_assert : Warning<
375 "static_assert declarations are incompatible with C++98">,
376 InGroup<CXX98Compat>, DefaultIgnore;
377 def ext_static_assert_no_message : ExtWarn<
378 "static_assert with no message is a C++17 extension">, InGroup<CXX17>;
379 def warn_cxx14_compat_static_assert_no_message : Warning<
380 "static_assert with no message is incompatible with C++ standards before "
382 DefaultIgnore, InGroup<CXXPre17Compat>;
383 def err_function_definition_not_allowed : Error<
384 "function definition is not allowed here">;
385 def err_expected_end_of_enumerator : Error<
386 "expected '= constant-expression' or end of enumerator definition">;
387 def err_expected_coloncolon_after_super : Error<
388 "expected '::' after '__super'">;
390 def ext_decomp_decl_empty : ExtWarn<
391 "ISO C++17 does not allow a decomposition group to be empty">,
392 InGroup<DiagGroup<"empty-decomposition">>;
394 /// Objective-C parser diagnostics
395 def err_expected_minus_or_plus : Error<
396 "method type specifier must start with '-' or '+'">;
397 def err_objc_missing_end : Error<"missing '@end'">;
398 def note_objc_container_start : Note<
399 "%select{class|protocol|category|class extension|implementation"
400 "|category implementation}0 started here">;
401 def warn_objc_protocol_qualifier_missing_id : Warning<
402 "protocol has no object type specified; defaults to qualified 'id'">;
403 def err_objc_unknown_at : Error<"expected an Objective-C directive after '@'">;
404 def err_illegal_super_cast : Error<
405 "cannot cast 'super' (it isn't an expression)">;
406 def err_nsnumber_nonliteral_unary : Error<
407 "@%0 must be followed by a number to form an NSNumber object">;
408 def warn_cstyle_param : Warning<
409 "use of C-style parameters in Objective-C method declarations"
410 " is deprecated">, InGroup<DeprecatedDeclarations>;
412 let CategoryName = "ARC Parse Issue" in {
413 def err_arc_bridge_retain : Error<
414 "unknown cast annotation __bridge_retain; did you mean __bridge_retained?">;
415 // To be default mapped to an error later.
416 def warn_arc_bridge_cast_nonarc : Warning<
417 "'%0' casts have no effect when not using ARC">,
418 InGroup<DiagGroup<"arc-bridge-casts-disallowed-in-nonarc">>;
421 def err_objc_illegal_visibility_spec : Error<
422 "illegal visibility specification">;
423 def err_objc_illegal_interface_qual : Error<"illegal interface qualifier">;
424 def err_objc_expected_equal_for_getter : Error<
425 "expected '=' for Objective-C getter">;
426 def err_objc_expected_equal_for_setter : Error<
427 "expected '=' for Objective-C setter">;
428 def err_objc_expected_selector_for_getter_setter : Error<
429 "expected selector for Objective-C %select{setter|getter}0">;
430 def err_objc_property_requires_field_name : Error<
431 "property requires fields to be named">;
432 def err_objc_property_bitfield : Error<"property name cannot be a bit-field">;
433 def err_objc_expected_property_attr : Error<"unknown property attribute %0">;
434 def err_objc_properties_require_objc2 : Error<
435 "properties are an Objective-C 2 feature">;
436 def err_objc_unexpected_attr : Error<
437 "prefix attribute must be followed by an interface or protocol">;
438 def err_objc_postfix_attribute : Error <
439 "postfix attributes are not allowed on Objective-C directives">;
440 def err_objc_postfix_attribute_hint : Error <
441 "postfix attributes are not allowed on Objective-C directives, place"
442 " them in front of '%select{@interface|@protocol}0'">;
443 def err_objc_directive_only_in_protocol : Error<
444 "directive may only be specified in protocols only">;
445 def err_missing_catch_finally : Error<
446 "@try statement without a @catch and @finally clause">;
447 def err_objc_concat_string : Error<"unexpected token after Objective-C string">;
448 def err_expected_objc_container : Error<
449 "'@end' must appear in an Objective-C context">;
450 def err_unexpected_protocol_qualifier : Error<
451 "@implementation declaration cannot be protocol qualified">;
452 def err_objc_unexpected_atend : Error<
453 "'@end' appears where closing brace '}' is expected">;
454 def err_synthesized_property_name : Error<
455 "expected a property name in @synthesize">;
456 def warn_semicolon_before_method_body : Warning<
457 "semicolon before method body is ignored">,
458 InGroup<SemiBeforeMethodBody>, DefaultIgnore;
459 def note_extra_comma_message_arg : Note<
460 "comma separating Objective-C messaging arguments">;
462 def err_expected_field_designator : Error<
463 "expected a field designator, such as '.field = 4'">;
465 def err_declaration_does_not_declare_param : Error<
466 "declaration does not declare a parameter">;
467 def err_no_matching_param : Error<"parameter named %0 is missing">;
469 /// Objective-C++ parser diagnostics
470 def err_expected_token_instead_of_objcxx_keyword : Error<
471 "expected %0; %1 is a keyword in Objective-C++">;
472 def err_expected_member_name_or_semi_objcxx_keyword : Error<
473 "expected member name or ';' after declaration specifiers; "
474 "%0 is a keyword in Objective-C++">;
476 /// C++ parser diagnostics
477 def err_invalid_operator_on_type : Error<
478 "cannot use %select{dot|arrow}0 operator on a type">;
479 def err_expected_unqualified_id : Error<
480 "expected %select{identifier|unqualified-id}0">;
481 def err_brackets_go_after_unqualified_id : Error<
482 "brackets are not allowed here; to declare an array, "
483 "place the brackets after the %select{identifier|name}0">;
484 def err_unexpected_unqualified_id : Error<"type-id cannot have a name">;
485 def err_func_def_no_params : Error<
486 "function definition does not declare parameters">;
487 def err_expected_lparen_after_type : Error<
488 "expected '(' for function-style cast or type construction">;
489 def err_expected_init_in_condition : Error<
490 "variable declaration in condition must have an initializer">;
491 def err_expected_init_in_condition_lparen : Error<
492 "variable declaration in condition cannot have a parenthesized initializer">;
493 def err_extraneous_rparen_in_condition : Error<
494 "extraneous ')' after condition, expected a statement">;
495 def warn_dangling_else : Warning<
496 "add explicit braces to avoid dangling else">,
497 InGroup<DanglingElse>;
498 def err_expected_member_or_base_name : Error<
499 "expected class member or base class name">;
500 def err_expected_lbrace_after_base_specifiers : Error<
501 "expected '{' after base class list">;
502 def err_missing_end_of_definition : Error<
503 "missing '}' at end of definition of %q0">;
504 def note_missing_end_of_definition_before : Note<
505 "still within definition of %q0 here">;
506 def ext_ellipsis_exception_spec : Extension<
507 "exception specification of '...' is a Microsoft extension">,
508 InGroup<MicrosoftExceptionSpec>;
509 def err_dynamic_and_noexcept_specification : Error<
510 "cannot have both throw() and noexcept() clause on the same function">;
511 def err_except_spec_unparsed : Error<
512 "unexpected end of exception specification">;
513 def ext_dynamic_exception_spec : ExtWarn<
514 "ISO C++17 does not allow dynamic exception specifications">,
515 InGroup<DynamicExceptionSpec>, DefaultError;
516 def warn_exception_spec_deprecated : Warning<
517 "dynamic exception specifications are deprecated">,
518 InGroup<DeprecatedDynamicExceptionSpec>, DefaultIgnore;
519 def note_exception_spec_deprecated : Note<"use '%0' instead">;
520 def warn_cxx98_compat_noexcept_decl : Warning<
521 "noexcept specifications are incompatible with C++98">,
522 InGroup<CXX98Compat>, DefaultIgnore;
523 def err_expected_catch : Error<"expected catch">;
524 def err_using_namespace_in_class : Error<
525 "'using namespace' is not allowed in classes">;
526 def err_constructor_bad_name : Error<
527 "missing return type for function %0; did you mean the constructor name %1?">;
528 def err_destructor_tilde_identifier : Error<
529 "expected a class name after '~' to name a destructor">;
530 def err_destructor_tilde_scope : Error<
531 "'~' in destructor name should be after nested name specifier">;
532 def err_destructor_template_id : Error<
533 "destructor name %0 does not refer to a template">;
534 def err_default_arg_unparsed : Error<
535 "unexpected end of default argument expression">;
536 def err_bracket_depth_exceeded : Error<
537 "bracket nesting level exceeded maximum of %0">, DefaultFatal;
538 def note_bracket_depth : Note<
539 "use -fbracket-depth=N to increase maximum nesting level">;
540 def err_misplaced_ellipsis_in_declaration : Error<
541 "'...' must %select{immediately precede declared identifier|"
542 "be innermost component of anonymous pack declaration}0">;
543 def warn_misplaced_ellipsis_vararg : Warning<
544 "'...' in this location creates a C-style varargs function"
545 "%select{, not a function parameter pack|}0">,
546 InGroup<DiagGroup<"ambiguous-ellipsis">>;
547 def note_misplaced_ellipsis_vararg_existing_ellipsis : Note<
548 "preceding '...' declares a function parameter pack">;
549 def note_misplaced_ellipsis_vararg_add_ellipsis : Note<
550 "place '...' %select{immediately before declared identifier|here}0 "
551 "to declare a function parameter pack">;
552 def note_misplaced_ellipsis_vararg_add_comma : Note<
553 "insert ',' before '...' to silence this warning">;
554 def ext_abstract_pack_declarator_parens : ExtWarn<
555 "ISO C++11 requires a parenthesized pack declaration to have a name">,
556 InGroup<DiagGroup<"anonymous-pack-parens">>;
557 def err_function_is_not_record : Error<
558 "unexpected %0 in function call; perhaps remove the %0?">;
559 def err_super_in_using_declaration : Error<
560 "'__super' cannot be used with a using declaration">;
561 def ext_constexpr_if : ExtWarn<
562 "constexpr if is a C++17 extension">, InGroup<CXX17>;
563 def warn_cxx14_compat_constexpr_if : Warning<
564 "constexpr if is incompatible with C++ standards before C++17">,
565 DefaultIgnore, InGroup<CXXPre17Compat>;
566 def ext_init_statement : ExtWarn<
567 "'%select{if|switch}0' initialization statements are a C++17 extension">,
569 def warn_cxx14_compat_init_statement : Warning<
570 "%select{if|switch}0 initialization statements are incompatible with "
571 "C++ standards before C++17">, DefaultIgnore, InGroup<CXXPre17Compat>;
572 def ext_for_range_init_stmt : ExtWarn<
573 "range-based for loop initialization statements are a C++2a extension">,
575 def warn_cxx17_compat_for_range_init_stmt : Warning<
576 "range-based for loop initialization statements are incompatible with "
577 "C++ standards before C++2a">, DefaultIgnore, InGroup<CXXPre2aCompat>;
578 def warn_empty_init_statement : Warning<
579 "empty initialization statement of '%select{if|switch|range-based for}0' "
580 "has no effect">, InGroup<EmptyInitStatement>, DefaultIgnore;
582 // C++ derived classes
583 def err_dup_virtual : Error<"duplicate 'virtual' in base specifier">;
585 // C++ operator overloading
586 def err_literal_operator_string_prefix : Error<
587 "string literal after 'operator' cannot have an encoding prefix">;
588 def err_literal_operator_string_not_empty : Error<
589 "string literal after 'operator' must be '\"\"'">;
590 def warn_cxx98_compat_literal_operator : Warning<
591 "literal operators are incompatible with C++98">,
592 InGroup<CXX98Compat>, DefaultIgnore;
595 def err_anon_type_definition : Error<
596 "declaration of anonymous %0 must be a definition">;
597 def err_default_delete_in_multiple_declaration : Error<
598 "'= %select{default|delete}0' is a function definition and must occur in a "
599 "standalone declaration">;
601 def warn_cxx98_compat_noexcept_expr : Warning<
602 "noexcept expressions are incompatible with C++98">,
603 InGroup<CXX98Compat>, DefaultIgnore;
604 def warn_cxx98_compat_nullptr : Warning<
605 "'nullptr' is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
607 def warn_wrong_clang_attr_namespace : Warning<
608 "'__clang__' is a predefined macro name, not an attribute scope specifier; "
609 "did you mean '_Clang' instead?">, InGroup<IgnoredAttributes>;
610 def ext_ns_enum_attribute : Extension<
611 "attributes on %select{a namespace|an enumerator}0 declaration are "
612 "a C++17 extension">, InGroup<CXX17>;
613 def warn_cxx14_compat_ns_enum_attribute : Warning<
614 "attributes on %select{a namespace|an enumerator}0 declaration are "
615 "incompatible with C++ standards before C++17">,
616 InGroup<CXXPre17CompatPedantic>, DefaultIgnore;
617 def warn_cxx98_compat_alignas : Warning<"'alignas' is incompatible with C++98">,
618 InGroup<CXX98Compat>, DefaultIgnore;
619 def warn_cxx98_compat_attribute : Warning<
620 "C++11 attribute syntax is incompatible with C++98">,
621 InGroup<CXX98Compat>, DefaultIgnore;
622 def err_cxx11_attribute_forbids_arguments : Error<
623 "attribute %0 cannot have an argument list">;
624 def err_attribute_requires_arguments : Error<
625 "parentheses must be omitted if %0 attribute's argument list is empty">;
626 def err_cxx11_attribute_forbids_ellipsis : Error<
627 "attribute %0 cannot be used as an attribute pack">;
628 def err_cxx11_attribute_repeated : Error<
629 "attribute %0 cannot appear multiple times in an attribute specifier">;
630 def warn_cxx14_compat_using_attribute_ns : Warning<
631 "default scope specifier for attributes is incompatible with C++ standards "
632 "before C++17">, InGroup<CXXPre17Compat>, DefaultIgnore;
633 def ext_using_attribute_ns : ExtWarn<
634 "default scope specifier for attributes is a C++17 extension">,
636 def err_using_attribute_ns_conflict : Error<
637 "attribute with scope specifier cannot follow default scope specifier">;
638 def err_attributes_not_allowed : Error<"an attribute list cannot appear here">;
639 def err_attributes_misplaced : Error<"misplaced attributes; expected attributes here">;
640 def err_l_square_l_square_not_attribute : Error<
641 "C++11 only allows consecutive left square brackets when "
642 "introducing an attribute">;
643 def err_ms_declspec_type : Error<
644 "__declspec attributes must be an identifier or string literal">;
645 def err_ms_property_no_getter_or_putter : Error<
646 "property does not specify a getter or a putter">;
647 def err_ms_property_unknown_accessor : Error<
648 "expected 'get' or 'put' in property declaration">;
649 def err_ms_property_has_set_accessor : Error<
650 "putter for property must be specified as 'put', not 'set'">;
651 def err_ms_property_missing_accessor_kind : Error<
652 "missing 'get=' or 'put='">;
653 def err_ms_property_expected_equal : Error<
654 "expected '=' after '%0'">;
655 def err_ms_property_duplicate_accessor : Error<
656 "property declaration specifies '%0' accessor twice">;
657 def err_ms_property_expected_accessor_name : Error<
658 "expected name of accessor method">;
659 def err_ms_property_expected_comma_or_rparen : Error<
660 "expected ',' or ')' at end of property accessor list">;
661 def err_ms_property_initializer : Error<
662 "property declaration cannot have an in-class initializer">;
665 def err_expected_template : Error<"expected template">;
666 def err_unknown_template_name : Error<
667 "unknown template name %0">;
668 def err_expected_comma_greater : Error<
669 "expected ',' or '>' in template-parameter-list">;
670 def err_class_on_template_template_param : Error<
671 "template template parameter requires 'class' after the parameter list">;
672 def ext_template_template_param_typename : ExtWarn<
673 "template template parameter using 'typename' is a C++17 extension">,
675 def warn_cxx14_compat_template_template_param_typename : Warning<
676 "template template parameter using 'typename' is "
677 "incompatible with C++ standards before C++17">,
678 InGroup<CXXPre17Compat>, DefaultIgnore;
679 def err_template_spec_syntax_non_template : Error<
680 "identifier followed by '<' indicates a class template specialization but "
681 "%0 %select{does not refer to a template|refers to a function template|"
682 "<unused>|refers to a variable template|<unused>}1">;
683 def err_id_after_template_in_nested_name_spec : Error<
684 "expected template name after 'template' keyword in nested name specifier">;
685 def err_unexpected_template_in_unqualified_id : Error<
686 "'template' keyword not permitted here">;
687 def err_two_right_angle_brackets_need_space : Error<
688 "a space is required between consecutive right angle brackets (use '> >')">;
689 def err_right_angle_bracket_equal_needs_space : Error<
690 "a space is required between a right angle bracket and an equals sign "
692 def warn_cxx11_right_shift_in_template_arg : Warning<
693 "use of right-shift operator ('>>') in template argument will require "
694 "parentheses in C++11">, InGroup<CXX11Compat>;
695 def warn_cxx98_compat_two_right_angle_brackets : Warning<
696 "consecutive right angle brackets are incompatible with C++98 (use '> >')">,
697 InGroup<CXX98Compat>, DefaultIgnore;
698 def err_templated_invalid_declaration : Error<
699 "a static_assert declaration cannot be a template">;
700 def err_multiple_template_declarators : Error<
701 "%select{|a template declaration|an explicit template specialization|"
702 "an explicit template instantiation}0 can "
703 "only %select{|declare|declare|instantiate}0 a single entity">;
704 def err_explicit_instantiation_with_definition : Error<
705 "explicit template instantiation cannot have a definition; if this "
706 "definition is meant to be an explicit specialization, add '<>' after the "
707 "'template' keyword">;
708 def err_template_defn_explicit_instantiation : Error<
709 "%select{function|class|variable}0 cannot be defined in an explicit instantiation; if this "
710 "declaration is meant to be a %select{function|class|variable}0 definition, remove the 'template' keyword">;
711 def err_friend_explicit_instantiation : Error<
712 "friend cannot be declared in an explicit instantiation; if this "
713 "declaration is meant to be a friend declaration, remove the 'template' keyword">;
714 def err_explicit_instantiation_enum : Error<
715 "enumerations cannot be explicitly instantiated">;
716 def err_expected_template_parameter : Error<"expected template parameter">;
718 def err_missing_dependent_template_keyword : Error<
719 "use 'template' keyword to treat '%0' as a dependent template name">;
720 def warn_missing_dependent_template_keyword : ExtWarn<
721 "use 'template' keyword to treat '%0' as a dependent template name">;
723 def ext_extern_template : Extension<
724 "extern templates are a C++11 extension">, InGroup<CXX11>;
725 def warn_cxx98_compat_extern_template : Warning<
726 "extern templates are incompatible with C++98">,
727 InGroup<CXX98CompatPedantic>, DefaultIgnore;
728 def warn_static_inline_explicit_inst_ignored : Warning<
729 "ignoring '%select{static|inline}0' keyword on explicit template "
730 "instantiation">, InGroup<DiagGroup<"static-inline-explicit-instantiation">>;
732 // Constructor template diagnostics.
733 def err_out_of_line_constructor_template_id : Error<
734 "out-of-line constructor for %0 cannot have template arguments">;
736 def err_expected_qualified_after_typename : Error<
737 "expected a qualified name after 'typename'">;
738 def warn_expected_qualified_after_typename : ExtWarn<
739 "expected a qualified name after 'typename'">;
741 def err_typename_refers_to_non_type_template : Error<
742 "typename specifier refers to a non-type template">;
743 def err_expected_type_name_after_typename : Error<
744 "expected an identifier or template-id after '::'">;
745 def err_explicit_spec_non_template : Error<
746 "explicit %select{specialization|instantiation}0 of non-template %1 %2">;
748 def err_default_template_template_parameter_not_template : Error<
749 "default template argument for a template template parameter must be a class "
752 def ext_fold_expression : ExtWarn<
753 "pack fold expression is a C++17 extension">,
755 def warn_cxx14_compat_fold_expression : Warning<
756 "pack fold expression is incompatible with C++ standards before C++17">,
757 InGroup<CXXPre17Compat>, DefaultIgnore;
758 def err_expected_fold_operator : Error<
759 "expected a foldable binary operator in fold expression">;
760 def err_fold_operator_mismatch : Error<
761 "operators in fold expression must be the same">;
763 def err_ctor_init_missing_comma : Error<
764 "missing ',' between base or member initializers">;
767 def err_friend_decl_defines_type : Error<
768 "cannot define a type in a friend declaration">;
769 def err_missing_whitespace_digraph : Error<
770 "found '<::' after a "
771 "%select{template name|const_cast|dynamic_cast|reinterpret_cast|static_cast}0"
772 " which forms the digraph '<:' (aka '[') and a ':', did you mean '< ::'?">;
774 def ext_defaulted_deleted_function : ExtWarn<
775 "%select{defaulted|deleted}0 function definitions are a C++11 extension">,
777 def warn_cxx98_compat_defaulted_deleted_function : Warning<
778 "%select{defaulted|deleted}0 function definitions are incompatible with C++98">,
779 InGroup<CXX98Compat>, DefaultIgnore;
781 // C++11 in-class member initialization
782 def ext_nonstatic_member_init : ExtWarn<
783 "in-class initialization of non-static data member is a C++11 extension">,
785 def warn_cxx98_compat_nonstatic_member_init : Warning<
786 "in-class initialization of non-static data members is incompatible with C++98">,
787 InGroup<CXX98Compat>, DefaultIgnore;
788 def ext_bitfield_member_init: ExtWarn<
789 "default member initializer for bit-field is a C++2a extension">,
791 def warn_cxx17_compat_bitfield_member_init: Warning<
792 "default member initializer for bit-field is incompatible with "
793 "C++ standards before C++2a">, InGroup<CXXPre2aCompat>, DefaultIgnore;
794 def err_incomplete_array_member_init: Error<
795 "array bound cannot be deduced from an in-class initializer">;
797 // C++11 alias-declaration
798 def ext_alias_declaration : ExtWarn<
799 "alias declarations are a C++11 extension">, InGroup<CXX11>;
800 def warn_cxx98_compat_alias_declaration : Warning<
801 "alias declarations are incompatible with C++98">,
802 InGroup<CXX98Compat>, DefaultIgnore;
803 def err_alias_declaration_not_identifier : Error<
804 "name defined in alias declaration must be an identifier">;
805 def err_alias_declaration_specialization : Error<
806 "%select{partial specialization|explicit specialization|explicit instantiation}0 of alias templates is not permitted">;
807 def err_alias_declaration_pack_expansion : Error<
808 "alias declaration cannot be a pack expansion">;
810 // C++17 using-declaration pack expansions
811 def ext_multi_using_declaration : ExtWarn<
812 "use of multiple declarators in a single using declaration is "
813 "a C++17 extension">, InGroup<CXX17>;
814 def warn_cxx17_compat_multi_using_declaration : Warning<
815 "use of multiple declarators in a single using declaration is "
816 "incompatible with C++ standards before C++17">,
817 InGroup<CXXPre17Compat>, DefaultIgnore;
818 def ext_using_declaration_pack : ExtWarn<
819 "pack expansion of using declaration is a C++17 extension">, InGroup<CXX17>;
820 def warn_cxx17_compat_using_declaration_pack : Warning<
821 "pack expansion using declaration is incompatible with C++ standards "
822 "before C++17">, InGroup<CXXPre17Compat>, DefaultIgnore;
824 // C++11 override control
825 def ext_override_control_keyword : ExtWarn<
826 "'%0' keyword is a C++11 extension">, InGroup<CXX11>;
827 def warn_cxx98_compat_override_control_keyword : Warning<
828 "'%0' keyword is incompatible with C++98">,
829 InGroup<CXX98Compat>, DefaultIgnore;
830 def err_override_control_interface : Error<
831 "'%0' keyword not permitted with interface types">;
832 def ext_ms_sealed_keyword : ExtWarn<
833 "'sealed' keyword is a Microsoft extension">,
834 InGroup<MicrosoftSealed>;
836 def err_access_specifier_interface : Error<
837 "interface types cannot specify '%select{private|protected}0' access">;
839 def err_duplicate_virt_specifier : Error<
840 "class member already marked '%0'">;
842 def err_scoped_enum_missing_identifier : Error<
843 "scoped enumeration requires a name">;
844 def ext_scoped_enum : ExtWarn<
845 "scoped enumerations are a C++11 extension">, InGroup<CXX11>;
846 def warn_cxx98_compat_scoped_enum : Warning<
847 "scoped enumerations are incompatible with C++98">,
848 InGroup<CXX98Compat>, DefaultIgnore;
850 def err_expected_parameter_pack : Error<
851 "expected the name of a parameter pack">;
852 def err_paren_sizeof_parameter_pack : Error<
853 "missing parentheses around the size of parameter pack %0">;
854 def err_sizeof_parameter_pack : Error<
855 "expected parenthesized parameter pack name in 'sizeof...' expression">;
857 // C++11 lambda expressions
858 def err_expected_comma_or_rsquare : Error<
859 "expected ',' or ']' in lambda capture list">;
860 def err_this_captured_by_reference : Error<
861 "'this' cannot be captured by reference">;
862 def err_expected_capture : Error<
863 "expected variable name or 'this' in lambda capture list">;
864 def err_expected_lambda_body : Error<"expected body of lambda expression">;
865 def warn_cxx98_compat_lambda : Warning<
866 "lambda expressions are incompatible with C++98">,
867 InGroup<CXX98Compat>, DefaultIgnore;
868 def err_lambda_missing_parens : Error<
869 "lambda requires '()' before %select{'mutable'|return type|"
870 "attribute specifier|'constexpr'}0">;
871 def err_lambda_decl_specifier_repeated : Error<
872 "%select{'mutable'|'constexpr'}0 cannot appear multiple times in a lambda declarator">;
873 // C++17 lambda expressions
874 def err_expected_star_this_capture : Error<
875 "expected 'this' following '*' in lambda capture list">;
877 // C++17 constexpr lambda expressions
878 def warn_cxx14_compat_constexpr_on_lambda : Warning<
879 "constexpr on lambda expressions is incompatible with C++ standards before C++17">,
880 InGroup<CXXPre17Compat>, DefaultIgnore;
881 def ext_constexpr_on_lambda_cxx17 : ExtWarn<
882 "'constexpr' on lambda expressions is a C++17 extension">, InGroup<CXX17>;
884 // Availability attribute
885 def err_expected_version : Error<
886 "expected a version of the form 'major[.minor[.subminor]]'">;
887 def warn_expected_consistent_version_separator : Warning<
888 "use same version number separators '_' or '.'; as in "
889 "'major[.minor[.subminor]]'">, InGroup<Availability>;
890 def err_zero_version : Error<
891 "version number must have non-zero major, minor, or sub-minor version">;
892 def err_availability_expected_platform : Error<
893 "expected a platform name, e.g., 'macos'">;
895 // objc_bridge_related attribute
896 def err_objcbridge_related_expected_related_class : Error<
897 "expected a related ObjectiveC class name, e.g., 'NSColor'">;
898 def err_objcbridge_related_selector_name : Error<
899 "expected a class method selector with single argument, e.g., 'colorWithCGColor:'">;
901 def err_availability_expected_change : Error<
902 "expected 'introduced', 'deprecated', or 'obsoleted'">;
903 def err_availability_unknown_change : Error<
904 "%0 is not an availability stage; use 'introduced', 'deprecated', or "
906 def err_availability_redundant : Error<
907 "redundant %0 availability change; only the last specified change will "
909 def warn_availability_and_unavailable : Warning<
910 "'unavailable' availability overrides all other availability information">,
911 InGroup<Availability>;
914 def err_avail_query_expected_platform_name : Error<
915 "expected a platform name here">;
917 def err_avail_query_unrecognized_platform_name : Error<
918 "unrecognized platform name %0">;
919 def err_availability_query_wildcard_required: Error<
920 "must handle potential future platforms with '*'">;
921 def err_availability_query_repeated_platform: Error<
922 "version for '%0' already specified">;
923 def err_availability_query_repeated_star : Error<
924 "'*' query has already been specified">;
926 // External source symbol attribute
927 def err_external_source_symbol_expected_keyword : Error<
928 "expected 'language', 'defined_in', or 'generated_declaration'">;
929 def err_external_source_symbol_duplicate_clause : Error<
930 "duplicate %0 clause in an 'external_source_symbol' attribute">;
932 // Type safety attributes
933 def err_type_safety_unknown_flag : Error<
934 "invalid comparison flag %0; use 'layout_compatible' or 'must_be_null'">;
937 def err_type_trait_arity : Error<
938 "type trait requires %0%select{| or more}1 argument%select{|s}2; have "
941 // Language specific pragmas
942 // - Generic warnings
943 def warn_pragma_expected_lparen : Warning<
944 "missing '(' after '#pragma %0' - ignoring">, InGroup<IgnoredPragmas>;
945 def warn_pragma_expected_rparen : Warning<
946 "missing ')' after '#pragma %0' - ignoring">, InGroup<IgnoredPragmas>;
947 def warn_pragma_expected_identifier : Warning<
948 "expected identifier in '#pragma %0' - ignored">, InGroup<IgnoredPragmas>;
949 def warn_pragma_expected_string : Warning<
950 "expected string literal in '#pragma %0' - ignoring">, InGroup<IgnoredPragmas>;
951 def warn_pragma_missing_argument : Warning<
952 "missing argument to '#pragma %0'%select{|; expected %2}1">, InGroup<IgnoredPragmas>;
953 def warn_pragma_invalid_argument : Warning<
954 "unexpected argument '%0' to '#pragma %1'%select{|; expected %3}2">, InGroup<IgnoredPragmas>;
956 // '#pragma clang section' related errors
957 def err_pragma_expected_clang_section_name : Error<
958 "expected one of [bss|data|rodata|text] section kind in '#pragma %0'">;
959 def err_pragma_clang_section_expected_equal : Error<
960 "expected '=' following '#pragma clang section %select{invalid|bss|data|rodata|text}0'">;
961 def warn_pragma_expected_section_name : Warning<
962 "expected a string literal for the section name in '#pragma %0' - ignored">,
963 InGroup<IgnoredPragmas>;
965 def warn_pragma_expected_section_push_pop_or_name : Warning<
966 "expected push, pop or a string literal for the section name in '#pragma %0' - ignored">,
967 InGroup<IgnoredPragmas>;
968 def warn_pragma_expected_section_label_or_name : Warning<
969 "expected a stack label or a string literal for the section name in '#pragma %0' - ignored">,
970 InGroup<IgnoredPragmas>;
971 def warn_pragma_expected_init_seg : Warning<
972 "expected 'compiler', 'lib', 'user', or a string literal for the section name in '#pragma %0' - ignored">,
973 InGroup<IgnoredPragmas>;
974 def warn_pragma_expected_integer : Warning<
975 "expected integer between %0 and %1 inclusive in '#pragma %2' - ignored">,
976 InGroup<IgnoredPragmas>;
977 def warn_pragma_ms_struct : Warning<
978 "incorrect use of '#pragma ms_struct on|off' - ignored">,
979 InGroup<IgnoredPragmas>;
980 def warn_pragma_extra_tokens_at_eol : Warning<
981 "extra tokens at end of '#pragma %0' - ignored">,
982 InGroup<IgnoredPragmas>;
983 def warn_pragma_expected_comma : Warning<
984 "expected ',' in '#pragma %0'">, InGroup<IgnoredPragmas>;
985 def warn_pragma_expected_punc : Warning<
986 "expected ')' or ',' in '#pragma %0'">, InGroup<IgnoredPragmas>;
987 def warn_pragma_expected_non_wide_string : Warning<
988 "expected non-wide string literal in '#pragma %0'">, InGroup<IgnoredPragmas>;
990 def err_pragma_missing_argument : Error<
991 "missing argument to '#pragma %0'%select{|; expected %2}1">;
993 def warn_pragma_options_expected_align : Warning<
994 "expected 'align' following '#pragma options' - ignored">,
995 InGroup<IgnoredPragmas>;
996 def warn_pragma_align_expected_equal : Warning<
997 "expected '=' following '#pragma %select{align|options align}0' - ignored">,
998 InGroup<IgnoredPragmas>;
999 def warn_pragma_align_invalid_option : Warning<
1000 "invalid alignment option in '#pragma %select{align|options align}0' - ignored">,
1001 InGroup<IgnoredPragmas>;
1003 def warn_pragma_unsupported_action : Warning<
1004 "known but unsupported action '%1' for '#pragma %0' - ignored">,
1005 InGroup<IgnoredPragmas>;
1006 def warn_pragma_invalid_specific_action : Warning<
1007 "unknown action '%1' for '#pragma %0' - ignored">,
1008 InGroup<IgnoredPragmas>;
1009 def warn_pragma_expected_action_or_r_paren : Warning<
1010 "expected action or ')' in '#pragma %0' - ignored">,
1011 InGroup<IgnoredPragmas>;
1012 def warn_pragma_invalid_action : Warning<
1013 "unknown action for '#pragma %0' - ignored">,
1014 InGroup<IgnoredPragmas>;
1015 def warn_pragma_pack_malformed : Warning<
1016 "expected integer or identifier in '#pragma pack' - ignored">,
1017 InGroup<IgnoredPragmas>;
1018 // - #pragma intrinsic
1019 def warn_pragma_intrinsic_builtin : Warning<
1020 "%0 is not a recognized builtin%select{|; consider including <intrin.h> to access non-builtin intrinsics}1">,
1021 InGroup<IgnoredPragmaIntrinsic>;
1022 // - #pragma optimize
1023 def warn_pragma_optimize : Warning<
1024 "'#pragma optimize' is not supported">,
1025 InGroup<IgnoredPragmaOptimize>;
1027 def warn_pragma_unused_expected_var : Warning<
1028 "expected '#pragma unused' argument to be a variable name">,
1029 InGroup<IgnoredPragmas>;
1030 // - #pragma init_seg
1031 def warn_pragma_init_seg_unsupported_target : Warning<
1032 "'#pragma init_seg' is only supported when targeting a "
1033 "Microsoft environment">,
1034 InGroup<IgnoredPragmas>;
1035 // - #pragma fp_contract
1036 def err_pragma_fp_contract_scope : Error<
1037 "'#pragma fp_contract' can only appear at file scope or at the start of a "
1038 "compound statement">;
1039 // - #pragma stdc unknown
1040 def ext_stdc_pragma_ignored : ExtWarn<"unknown pragma in STDC namespace">,
1041 InGroup<UnknownPragmas>;
1042 def warn_stdc_fenv_access_not_supported :
1043 Warning<"pragma STDC FENV_ACCESS ON is not supported, ignoring pragma">,
1044 InGroup<UnknownPragmas>;
1045 // - #pragma comment
1046 def err_pragma_comment_malformed : Error<
1047 "pragma comment requires parenthesized identifier and optional string">;
1048 def err_pragma_comment_unknown_kind : Error<"unknown kind of pragma comment">;
1049 // PS4 recognizes only #pragma comment(lib)
1050 def warn_pragma_comment_ignored : Warning<"'#pragma comment %0' ignored">,
1051 InGroup<IgnoredPragmas>;
1052 // - #pragma detect_mismatch
1053 def err_pragma_detect_mismatch_malformed : Error<
1054 "pragma detect_mismatch is malformed; it requires two comma-separated "
1056 // - #pragma pointers_to_members
1057 def err_pragma_pointers_to_members_unknown_kind : Error<
1058 "unexpected %0, expected to see one of %select{|'best_case', 'full_generality', }1"
1059 "'single_inheritance', 'multiple_inheritance', or 'virtual_inheritance'">;
1060 // - #pragma clang optimize on/off
1061 def err_pragma_optimize_invalid_argument : Error<
1062 "unexpected argument '%0' to '#pragma clang optimize'; "
1063 "expected 'on' or 'off'">;
1064 def err_pragma_optimize_extra_argument : Error<
1065 "unexpected extra argument '%0' to '#pragma clang optimize'">;
1066 // - #pragma clang attribute
1067 def err_pragma_attribute_expected_push_pop_paren : Error<
1068 "expected 'push', 'pop', or '(' after '#pragma clang attribute'">;
1069 def err_pragma_attribute_invalid_argument : Error<
1070 "unexpected argument '%0' to '#pragma clang attribute'; "
1071 "expected 'push' or 'pop'">;
1072 def err_pragma_attribute_expected_attribute : Error<
1073 "expected an attribute after '('">;
1074 def err_pragma_attribute_expected_attribute_name : Error<
1075 "expected identifier that represents an attribute name">;
1076 def err_pragma_attribute_extra_tokens_after_attribute : Error<
1077 "extra tokens after attribute in a '#pragma clang attribute push'">;
1078 def err_pragma_attribute_unsupported_attribute : Error<
1079 "attribute %0 is not supported by '#pragma clang attribute'">;
1080 def err_pragma_attribute_multiple_attributes : Error<
1081 "more than one attribute specified in '#pragma clang attribute push'">;
1082 def err_pragma_attribute_expected_attribute_syntax : Error<
1083 "expected an attribute that is specified using the GNU, C++11 or '__declspec'"
1085 def note_pragma_attribute_use_attribute_kw : Note<"use the GNU '__attribute__' "
1087 def err_pragma_attribute_invalid_subject_set_specifier : Error<
1088 "expected attribute subject set specifier 'apply_to'">;
1089 def err_pragma_attribute_expected_subject_identifier : Error<
1090 "expected an identifier that corresponds to an attribute subject rule">;
1091 def err_pragma_attribute_unknown_subject_rule : Error<
1092 "unknown attribute subject rule '%0'">;
1093 def err_pragma_attribute_expected_subject_sub_identifier : Error<
1094 "expected an identifier that corresponds to an attribute subject matcher "
1095 "sub-rule; '%0' matcher %select{does not support sub-rules|supports the "
1096 "following sub-rules: %2|}1">;
1097 def err_pragma_attribute_unknown_subject_sub_rule : Error<
1098 "%select{invalid use of|unknown}2 attribute subject matcher sub-rule '%0'; "
1099 "'%1' matcher %select{does not support sub-rules|supports the following "
1101 def err_pragma_attribute_duplicate_subject : Error<
1102 "duplicate attribute subject matcher '%0'">;
1103 def err_pragma_attribute_expected_period : Error<
1104 "expected '.' after pragma attribute namespace %0">;
1105 def err_pragma_attribute_namespace_on_attribute : Error<
1106 "namespace can only apply to 'push' or 'pop' directives">;
1107 def note_pragma_attribute_namespace_on_attribute : Note<
1108 "omit the namespace to add attributes to the most-recently"
1109 " pushed attribute group">;
1111 def err_opencl_unroll_hint_on_non_loop : Error<
1112 "OpenCL only supports 'opencl_unroll_hint' attribute on for, while, and do statements">;
1114 // OpenCL EXTENSION pragma (OpenCL 1.1 [9.1])
1115 def warn_pragma_expected_colon : Warning<
1116 "missing ':' after %0 - ignoring">, InGroup<IgnoredPragmas>;
1117 def warn_pragma_expected_predicate : Warning<
1118 "expected %select{'enable', 'disable', 'begin' or 'end'|'disable'}0 - ignoring">, InGroup<IgnoredPragmas>;
1119 def warn_pragma_begin_end_mismatch : Warning<
1120 "OpenCL extension end directive mismatches begin directive - ignoring">, InGroup<IgnoredPragmas>;
1121 def warn_pragma_unknown_extension : Warning<
1122 "unknown OpenCL extension %0 - ignoring">, InGroup<IgnoredPragmas>;
1123 def warn_pragma_unsupported_extension : Warning<
1124 "unsupported OpenCL extension %0 - ignoring">, InGroup<IgnoredPragmas>;
1125 def warn_pragma_extension_is_core : Warning<
1126 "OpenCL extension %0 is core feature or supported optional core feature - ignoring">, InGroup<DiagGroup<"pedantic-core-features">>, DefaultIgnore;
1129 def err_opencl_taking_function_address_parser : Error<
1130 "taking address of function is not allowed">;
1131 def err_opencl_logical_exclusive_or : Error<
1132 "^^ is a reserved operator in OpenCL">;
1135 def err_openclcxx_virtual_function : Error<
1136 "virtual functions are not supported in OpenCL C++">;
1137 def err_openclcxx_reserved : Error<
1138 "'%0' is a reserved keyword in OpenCL C++">;
1141 def warn_pragma_omp_ignored : Warning<
1142 "unexpected '#pragma omp ...' in program">, InGroup<SourceUsesOpenMP>, DefaultIgnore;
1143 def warn_omp_extra_tokens_at_eol : Warning<
1144 "extra tokens at the end of '#pragma omp %0' are ignored">,
1145 InGroup<ExtraTokens>;
1146 def warn_pragma_expected_colon_r_paren : Warning<
1147 "missing ':' or ')' after %0 - ignoring">, InGroup<IgnoredPragmas>;
1148 def err_omp_unknown_directive : Error<
1149 "expected an OpenMP directive">;
1150 def err_omp_unexpected_directive : Error<
1151 "unexpected OpenMP directive %select{|'#pragma omp %1'}0">;
1152 def err_omp_expected_punc : Error<
1153 "expected ',' or ')' in '%0' %select{clause|directive}1">;
1154 def err_omp_unexpected_clause : Error<
1155 "unexpected OpenMP clause '%0' in directive '#pragma omp %1'">;
1156 def err_omp_immediate_directive : Error<
1157 "'#pragma omp %0' %select{|with '%2' clause }1cannot be an immediate substatement">;
1158 def err_omp_expected_identifier_for_critical : Error<
1159 "expected identifier specifying the name of the 'omp critical' directive">;
1160 def err_omp_expected_reduction_identifier : Error<
1161 "expected identifier or one of the following operators: '+', '-', '*', '&', '|', '^', '&&', or '||'">;
1162 def err_omp_decl_in_declare_simd : Error<
1163 "function declaration is expected after 'declare simd' directive">;
1164 def err_omp_unknown_map_type : Error<
1165 "incorrect map type, expected one of 'to', 'from', 'tofrom', 'alloc', 'release', or 'delete'">;
1166 def err_omp_unknown_map_type_modifier : Error<
1167 "incorrect map type modifier, expected 'always' or 'close'">;
1168 def err_omp_map_type_missing : Error<
1169 "missing map type">;
1170 def err_omp_map_type_modifier_missing : Error<
1171 "missing map type modifier">;
1172 def err_omp_declare_simd_inbranch_notinbranch : Error<
1173 "unexpected '%0' clause, '%1' is specified already">;
1174 def err_expected_end_declare_target : Error<
1175 "expected '#pragma omp end declare target'">;
1176 def err_omp_declare_target_unexpected_clause: Error<
1177 "unexpected '%0' clause, only 'to' or 'link' clauses expected">;
1178 def err_omp_expected_clause: Error<
1179 "expected at least one clause on '#pragma omp %0' directive">;
1181 // Pragma loop support.
1182 def err_pragma_loop_missing_argument : Error<
1183 "missing argument; expected %select{an integer value|"
1184 "'enable'%select{|, 'full'}1%select{|, 'assume_safety'}2 or 'disable'}0">;
1185 def err_pragma_loop_invalid_option : Error<
1186 "%select{invalid|missing}0 option%select{ %1|}0; expected vectorize, "
1187 "vectorize_width, interleave, interleave_count, unroll, unroll_count, "
1188 "pipeline, pipeline_initiation_interval, or distribute">;
1190 def err_pragma_fp_invalid_option : Error<
1191 "%select{invalid|missing}0 option%select{ %1|}0; expected contract">;
1192 def err_pragma_fp_invalid_argument : Error<
1193 "unexpected argument '%0' to '#pragma clang fp %1'; "
1194 "expected 'on', 'fast' or 'off'">;
1195 def err_pragma_fp_scope : Error<
1196 "'#pragma clang fp' can only appear at file scope or at the start of a "
1197 "compound statement">;
1199 def err_pragma_invalid_keyword : Error<
1200 "invalid argument; expected 'enable'%select{|, 'full'}0%select{|, 'assume_safety'}1 or 'disable'">;
1201 def err_pragma_pipeline_invalid_keyword : Error<
1202 "invalid argument; expected 'disable'">;
1204 // Pragma unroll support.
1205 def warn_pragma_unroll_cuda_value_in_parens : Warning<
1206 "argument to '#pragma unroll' should not be in parentheses in CUDA C/C++">,
1207 InGroup<CudaCompat>;
1209 def warn_cuda_attr_lambda_position : Warning<
1210 "nvcc does not allow '__%0__' to appear after '()' in lambdas">,
1211 InGroup<CudaCompat>;
1212 def warn_pragma_force_cuda_host_device_bad_arg : Warning<
1213 "incorrect use of #pragma clang force_cuda_host_device begin|end">,
1214 InGroup<IgnoredPragmas>;
1215 def err_pragma_cannot_end_force_cuda_host_device : Error<
1216 "force_cuda_host_device end pragma without matching "
1217 "force_cuda_host_device begin">;
1218 } // end of Parse Issue category.
1220 let CategoryName = "Modules Issue" in {
1221 def err_unexpected_module_decl : Error<
1222 "module declaration can only appear at the top level">;
1223 def err_module_expected_ident : Error<
1224 "expected a module name after '%select{module|import}0'">;
1225 def err_module_implementation_partition : Error<
1226 "module partition must be declared 'export'">;
1227 def err_attribute_not_module_attr : Error<
1228 "%0 attribute cannot be applied to a module">;
1229 def err_attribute_not_import_attr : Error<
1230 "%0 attribute cannot be applied to a module import">;
1231 def err_module_expected_semi : Error<
1232 "expected ';' after module name">;
1233 def err_missing_before_module_end : Error<"expected %0 at end of module">;
1235 def err_export_empty : Error<"export declaration cannot be empty">;
1238 let CategoryName = "Generics Issue" in {
1240 def err_objc_expected_type_parameter : Error<
1241 "expected type parameter name">;
1243 def err_objc_parameterized_implementation : Error<
1244 "@implementation cannot have type parameters">;
1246 def err_objc_type_args_after_protocols : Error<
1247 "protocol qualifiers must precede type arguments">;
1249 def note_meant_to_use_typename : Note<
1250 "did you mean to use 'typename'?">;
1253 let CategoryName = "Coroutines Issue" in {
1254 def err_for_co_await_not_range_for : Error<
1255 "'co_await' modifier can only be applied to range-based for loop">;
1258 } // end of Parser diagnostics