1//==--- DiagnosticParseKinds.td - libparse diagnostics --------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9//===----------------------------------------------------------------------===//
10// Parser Diagnostics
11//===----------------------------------------------------------------------===//
12
13let Component = "Parse" in {
14
15def err_asm_qualifier_ignored : Error<
16  "expected 'volatile', 'inline', 'goto', or '('">, CatInlineAsm;
17def err_global_asm_qualifier_ignored : Error<
18  "meaningless '%0' on asm outside function">, CatInlineAsm;
19
20let CategoryName = "Inline Assembly Issue" in {
21def err_asm_empty : Error<"__asm used with no assembly instructions">;
22def err_inline_ms_asm_parsing : Error<"%0">;
23def err_msasm_unsupported_arch : Error<
24  "unsupported architecture '%0' for MS-style inline assembly">;
25def err_msasm_unable_to_create_target : Error<
26  "MS-style inline assembly is not available: %0">;
27def err_gnu_inline_asm_disabled : Error<
28  "GNU-style inline assembly is disabled">;
29def err_asm_duplicate_qual : Error<"duplicate asm qualifier '%0'">;
30}
31
32let CategoryName = "Parse Issue" in {
33
34def ext_empty_translation_unit : Extension<
35  "ISO C requires a translation unit to contain at least one declaration">,
36  InGroup<DiagGroup<"empty-translation-unit">>;
37def warn_cxx98_compat_top_level_semi : Warning<
38  "extra ';' outside of a function is incompatible with C++98">,
39  InGroup<CXX98CompatExtraSemi>, DefaultIgnore;
40def ext_extra_semi : Extension<
41  "extra ';' %select{"
42  "outside of a function|"
43  "inside a %1|"
44  "inside instance variable list|"
45  "after member function definition}0">,
46  InGroup<ExtraSemi>;
47def ext_extra_semi_cxx11 : Extension<
48  "extra ';' outside of a function is a C++11 extension">,
49  InGroup<CXX11ExtraSemi>;
50def warn_extra_semi_after_mem_fn_def : Warning<
51  "extra ';' after member function definition">,
52  InGroup<ExtraSemi>, DefaultIgnore;
53def warn_null_statement : Warning<
54  "empty expression statement has no effect; "
55  "remove unnecessary ';' to silence this warning">,
56  InGroup<ExtraSemiStmt>, DefaultIgnore;
57
58def warn_misleading_indentation : Warning<
59  "misleading indentation; statement is not part of "
60  "the previous '%select{if|else|for|while}0'">,
61  InGroup<MisleadingIndentation>, DefaultIgnore;
62def note_previous_statement : Note<
63  "previous statement is here">;
64
65def subst_compound_token_kind : TextSubstitution<
66  "%select{%1 and |}0%2 tokens "
67  "%select{introducing statement expression|terminating statement expression|"
68  "introducing attribute|terminating attribute|"
69  "forming pointer to member type}3">;
70def warn_compound_token_split_by_macro : Warning<
71  "%sub{subst_compound_token_kind}0,1,2,3 appear in different "
72  "macro expansion contexts">, InGroup<CompoundTokenSplitByMacro>;
73def note_compound_token_split_second_token_here : Note<
74  "%select{|second }0%1 token is here">;
75def warn_compound_token_split_by_whitespace : Warning<
76  "%sub{subst_compound_token_kind}0,1,2,3 are separated by whitespace">,
77  InGroup<CompoundTokenSplitBySpace>, DefaultIgnore;
78
79def ext_thread_before : Extension<"'__thread' before '%0'">;
80def ext_keyword_as_ident : ExtWarn<
81  "keyword '%0' will be made available as an identifier "
82  "%select{here|for the remainder of the translation unit}1">,
83  InGroup<KeywordCompat>;
84
85def ext_nullability : Extension<
86  "type nullability specifier %0 is a Clang extension">,
87  InGroup<DiagGroup<"nullability-extension">>;
88
89def err_empty_enum : Error<"use of empty enum">;
90
91def ext_ident_list_in_param : Extension<
92  "type-less parameter names in function declaration">;
93def ext_c99_variable_decl_in_for_loop : Extension<
94  "variable declaration in for loop is a C99-specific feature">, InGroup<C99>;
95def ext_c99_compound_literal : Extension<
96  "compound literals are a C99-specific feature">, InGroup<C99>;
97def ext_enumerator_list_comma_c : Extension<
98  "commas at the end of enumerator lists are a C99-specific "
99  "feature">, InGroup<C99>;
100def ext_enumerator_list_comma_cxx : Extension<
101  "commas at the end of enumerator lists are a C++11 extension">,
102  InGroup<CXX11>;
103def warn_cxx98_compat_enumerator_list_comma : Warning<
104  "commas at the end of enumerator lists are incompatible with C++98">,
105  InGroup<CXX98CompatPedantic>, DefaultIgnore;
106def err_enumerator_list_missing_comma : Error<
107  "missing ',' between enumerators">;
108def err_enumerator_unnamed_no_def : Error<
109  "unnamed enumeration must be a definition">;
110def ext_cxx11_enum_fixed_underlying_type : Extension<
111  "enumeration types with a fixed underlying type are a C++11 extension">,
112  InGroup<CXX11>;
113def ext_ms_c_enum_fixed_underlying_type : Extension<
114  "enumeration types with a fixed underlying type are a Microsoft extension">,
115  InGroup<MicrosoftFixedEnum>;
116def ext_clang_c_enum_fixed_underlying_type : Extension<
117  "enumeration types with a fixed underlying type are a Clang extension">,
118  InGroup<DiagGroup<"fixed-enum-extension">>;
119def warn_cxx98_compat_enum_fixed_underlying_type : Warning<
120  "enumeration types with a fixed underlying type are incompatible with C++98">,
121  InGroup<CXX98Compat>, DefaultIgnore;
122def ext_enum_base_in_type_specifier : ExtWarn<
123  "non-defining declaration of enumeration with a fixed underlying type is "
124  "only permitted as a standalone declaration"
125  "%select{|; missing list of enumerators?}0">,
126  InGroup<DiagGroup<"elaborated-enum-base">>, DefaultError;
127def ext_elaborated_enum_class : ExtWarn<
128  "reference to enumeration must use 'enum' not 'enum %select{struct|class}0'">,
129  InGroup<DiagGroup<"elaborated-enum-class">>, DefaultError;
130def err_scoped_enum_missing_identifier : Error<
131  "scoped enumeration requires a name">;
132def ext_scoped_enum : ExtWarn<
133  "scoped enumerations are a C++11 extension">, InGroup<CXX11>;
134def warn_cxx98_compat_scoped_enum : Warning<
135  "scoped enumerations are incompatible with C++98">,
136  InGroup<CXX98Compat>, DefaultIgnore;
137def err_anonymous_enum_bitfield : Error<
138  "ISO C++ only allows ':' in member enumeration declaration to introduce "
139  "a fixed underlying type, not an anonymous bit-field">;
140
141def warn_cxx98_compat_alignof : Warning<
142  "alignof expressions are incompatible with C++98">,
143  InGroup<CXX98Compat>, DefaultIgnore;
144def ext_alignof_expr : ExtWarn<
145  "%0 applied to an expression is a GNU extension">, InGroup<GNUAlignofExpression>;
146def err_lambda_after_delete : Error<
147  "'[]' after delete interpreted as 'delete[]'; add parentheses to treat this as a lambda-expression">;
148
149def warn_microsoft_dependent_exists : Warning<
150  "dependent %select{__if_not_exists|__if_exists}0 declarations are ignored">,
151  InGroup<DiagGroup<"microsoft-exists">>;
152def warn_microsoft_qualifiers_ignored : Warning<
153  "qualifiers after comma in declarator list are ignored">,
154  InGroup<IgnoredAttributes>;
155
156def err_duplicate_default_assoc : Error<
157  "duplicate default generic association">;
158def note_previous_default_assoc : Note<
159  "previous default generic association is here">;
160
161def ext_c99_feature : Extension<
162  "'%0' is a C99 extension">, InGroup<C99>;
163def ext_c11_feature : Extension<
164  "'%0' is a C11 extension">, InGroup<C11>;
165
166def err_c11_noreturn_misplaced : Error<
167  "'_Noreturn' keyword must precede function declarator">;
168
169def ext_gnu_indirect_goto : Extension<
170  "use of GNU indirect-goto extension">, InGroup<GNULabelsAsValue>;
171def ext_gnu_address_of_label : Extension<
172  "use of GNU address-of-label extension">, InGroup<GNULabelsAsValue>;
173def err_stmtexpr_file_scope : Error<
174  "statement expression not allowed at file scope">;
175def ext_gnu_statement_expr : Extension<
176  "use of GNU statement expression extension">, InGroup<GNUStatementExpression>;
177def ext_gnu_statement_expr_macro : Extension<
178  "use of GNU statement expression extension from macro expansion">,
179  InGroup<GNUStatementExpressionFromMacroExpansion>;
180def ext_gnu_conditional_expr : Extension<
181  "use of GNU ?: conditional expression extension, omitting middle operand">, InGroup<GNUConditionalOmittedOperand>;
182def ext_gnu_empty_initializer : Extension<
183  "use of GNU empty initializer extension">, InGroup<GNUEmptyInitializer>;
184def ext_gnu_array_range : Extension<"use of GNU array range extension">,
185  InGroup<GNUDesignator>;
186def ext_gnu_missing_equal_designator : ExtWarn<
187  "use of GNU 'missing =' extension in designator">,
188  InGroup<GNUDesignator>;
189def err_expected_equal_designator : Error<"expected '=' or another designator">;
190def ext_gnu_old_style_field_designator : ExtWarn<
191  "use of GNU old-style field designator extension">,
192  InGroup<GNUDesignator>;
193def ext_gnu_case_range : Extension<"use of GNU case range extension">,
194  InGroup<GNUCaseRange>;
195
196// Generic errors.
197def err_expected_expression : Error<"expected expression">;
198def err_expected_type : Error<"expected a type">;
199def err_expected_external_declaration : Error<"expected external declaration">;
200def err_extraneous_closing_brace : Error<"extraneous closing brace ('}')">;
201def err_expected_semi_declaration : Error<
202  "expected ';' at end of declaration">;
203def err_expected_semi_decl_list : Error<
204  "expected ';' at end of declaration list">;
205def ext_expected_semi_decl_list : ExtWarn<
206  "expected ';' at end of declaration list">;
207def err_expected_member_name_or_semi : Error<
208  "expected member name or ';' after declaration specifiers">;
209def err_function_declared_typedef : Error<
210  "function definition declared 'typedef'">;
211def err_at_defs_cxx : Error<"@defs is not supported in Objective-C++">;
212def err_at_in_class : Error<"unexpected '@' in member specification">;
213def err_unexpected_semi : Error<"unexpected ';' before %0">;
214def err_postfix_after_unary_requires_parens : Error<
215  "expression cannot be followed by a postfix %0 operator; add parentheses">;
216def err_unparenthesized_non_primary_expr_in_requires_clause : Error<
217  "parentheses are required around this expression in a requires clause">;
218def note_unparenthesized_non_primary_expr_in_requires_clause : Note<
219  "parentheses are required around this expression in a requires clause">;
220
221def err_expected_fn_body : Error<
222  "expected function body after function declarator">;
223def warn_attribute_on_function_definition : Warning<
224  "GCC does not allow %0 attribute in this position on a function definition">,
225  InGroup<GccCompat>;
226def warn_gcc_attribute_location : Warning<
227  "GCC does not allow an attribute in this position on a function declaration">,
228  InGroup<GccCompat>;
229def warn_gcc_variable_decl_in_for_loop : Warning<
230  "GCC does not allow variable declarations in for loop initializers before "
231  "C99">, InGroup<GccCompat>;
232def warn_attribute_no_decl : Warning<
233  "attribute %0 ignored, because it is not attached to a declaration">,
234  InGroup<IgnoredAttributes>;
235def err_ms_attributes_not_enabled : Error<
236  "'__declspec' attributes are not enabled; use '-fdeclspec' or "
237  "'-fms-extensions' to enable support for __declspec attributes">;
238def err_expected_method_body : Error<"expected method body">;
239def err_declspec_after_virtspec : Error<
240  "'%0' qualifier may not appear after the virtual specifier '%1'">;
241def err_invalid_token_after_toplevel_declarator : Error<
242  "expected ';' after top level declarator">;
243def err_invalid_token_after_declarator_suggest_equal : Error<
244  "invalid %0 at end of declaration; did you mean '='?">;
245def err_expected_statement : Error<"expected statement">;
246def err_expected_lparen_after : Error<"expected '(' after '%0'">;
247def err_expected_rparen_after : Error<"expected ')' after '%0'">;
248def err_expected_punc : Error<"expected ')' or ',' after '%0'">;
249def err_expected_less_after : Error<"expected '<' after '%0'">;
250def err_expected_lbrace_in_compound_literal : Error<
251  "expected '{' in compound literal">;
252def err_expected_while : Error<"expected 'while' in do/while loop">;
253
254def err_expected_semi_after_stmt : Error<"expected ';' after %0 statement">;
255def err_expected_semi_after_expr : Error<"expected ';' after expression">;
256def err_extraneous_token_before_semi : Error<"extraneous '%0' before ';'">;
257
258def err_expected_semi_after_method_proto : Error<
259  "expected ';' after method prototype">;
260def err_expected_semi_after_namespace_name : Error<
261  "expected ';' after namespace name">;
262def err_unexpected_namespace_attributes_alias : Error<
263  "attributes cannot be specified on namespace alias">;
264def err_unexpected_nested_namespace_attribute : Error<
265  "attributes cannot be specified on a nested namespace definition">;
266def err_inline_namespace_alias : Error<"namespace alias cannot be inline">;
267def err_namespace_nonnamespace_scope : Error<
268  "namespaces can only be defined in global or namespace scope">;
269def ext_nested_namespace_definition : ExtWarn<
270  "nested namespace definition is a C++17 extension; "
271  "define each namespace separately">, InGroup<CXX17>;
272def warn_cxx14_compat_nested_namespace_definition : Warning<
273  "nested namespace definition is incompatible with C++ standards before C++17">,
274  InGroup<CXXPre17Compat>, DefaultIgnore;
275def ext_inline_nested_namespace_definition : ExtWarn<
276  "inline nested namespace definition is a C++20 extension">, InGroup<CXX20>;
277def warn_cxx17_compat_inline_nested_namespace_definition : Warning<
278  "inline nested namespace definition is incompatible with C++ standards before"
279  " C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
280def err_inline_nested_namespace_definition : Error<
281  "nested namespace definition cannot be 'inline'">;
282def err_expected_semi_after_attribute_list : Error<
283  "expected ';' after attribute list">;
284def err_expected_semi_after_static_assert : Error<
285  "expected ';' after '%0'">;
286def err_expected_semi_for : Error<"expected ';' in 'for' statement specifier">;
287def err_single_decl_assign_in_for_range : Error<
288  "range-based 'for' statement uses ':', not '='">;
289def warn_missing_selector_name : Warning<
290  "%0 used as the name of the previous parameter rather than as part "
291  "of the selector">,
292  InGroup<DiagGroup<"missing-selector-name">>;
293def note_missing_selector_name : Note<
294  "introduce a parameter name to make %0 part of the selector">;
295def note_force_empty_selector_name : Note<
296  "or insert whitespace before ':' to use %0 as parameter name "
297  "and have an empty entry in the selector">;
298def err_label_end_of_compound_statement : Error<
299  "label at end of compound statement: expected statement">;
300def err_address_of_label_outside_fn : Error<
301  "use of address-of-label extension outside of a function body">;
302def err_asm_operand_wide_string_literal : Error<
303  "cannot use %select{unicode|wide|an empty}0 string literal in 'asm'">;
304def err_expected_selector_for_method : Error<
305  "expected selector for Objective-C method">;
306def err_expected_property_name : Error<"expected property name">;
307
308def err_unexpected_at : Error<"unexpected '@' in program">;
309def err_atimport : Error<
310"use of '@import' when modules are disabled">;
311
312def warn_atimport_in_framework_header : Warning<
313  "use of '@import' in framework header is discouraged, "
314  "including this header requires -fmodules">,
315  InGroup<FrameworkHdrAtImport>;
316
317def err_invalid_reference_qualifier_application : Error<
318  "'%0' qualifier may not be applied to a reference">;
319def err_illegal_decl_reference_to_reference : Error<
320  "%0 declared as a reference to a reference">;
321def ext_rvalue_reference : ExtWarn<
322  "rvalue references are a C++11 extension">, InGroup<CXX11>;
323def warn_cxx98_compat_rvalue_reference : Warning<
324  "rvalue references are incompatible with C++98">,
325  InGroup<CXX98Compat>, DefaultIgnore;
326def ext_ref_qualifier : ExtWarn<
327  "reference qualifiers on functions are a C++11 extension">, InGroup<CXX11>;
328def warn_cxx98_compat_ref_qualifier : Warning<
329  "reference qualifiers on functions are incompatible with C++98">,
330  InGroup<CXX98Compat>, DefaultIgnore;
331def ext_inline_namespace : ExtWarn<
332  "inline namespaces are a C++11 feature">, InGroup<CXX11InlineNamespace>;
333def warn_cxx98_compat_inline_namespace : Warning<
334  "inline namespaces are incompatible with C++98">,
335  InGroup<CXX98Compat>, DefaultIgnore;
336def ext_generalized_initializer_lists : ExtWarn<
337  "generalized initializer lists are a C++11 extension">,
338  InGroup<CXX11>;
339def warn_cxx98_compat_generalized_initializer_lists : Warning<
340  "generalized initializer lists are incompatible with C++98">,
341  InGroup<CXX98Compat>, DefaultIgnore;
342def err_init_list_bin_op : Error<"initializer list cannot be used on the "
343  "%select{left|right}0 hand side of operator '%1'">;
344def warn_cxx98_compat_trailing_return_type : Warning<
345  "trailing return types are incompatible with C++98">,
346  InGroup<CXX98Compat>, DefaultIgnore;
347def err_requires_clause_must_appear_after_trailing_return : Error<
348  "trailing return type must appear before trailing requires clause">;
349def err_requires_clause_on_declarator_not_declaring_a_function : Error<
350  "trailing requires clause can only be used when declaring a function">;
351def err_requires_clause_inside_parens : Error<
352  "trailing requires clause should be placed outside parentheses">;
353def ext_auto_storage_class : ExtWarn<
354  "'auto' storage class specifier is not permitted in C++11, and will not "
355  "be supported in future releases">, InGroup<DiagGroup<"auto-storage-class">>;
356def ext_decltype_auto_type_specifier : ExtWarn<
357  "'decltype(auto)' type specifier is a C++14 extension">, InGroup<CXX14>;
358def warn_cxx11_compat_decltype_auto_type_specifier : Warning<
359  "'decltype(auto)' type specifier is incompatible with C++ standards before "
360  "C++14">, InGroup<CXXPre14Compat>, DefaultIgnore;
361def ext_auto_type : Extension<
362  "'__auto_type' is a GNU extension">,
363  InGroup<GNUAutoType>;
364def ext_for_range : ExtWarn<
365  "range-based for loop is a C++11 extension">, InGroup<CXX11>;
366def warn_cxx98_compat_for_range : Warning<
367  "range-based for loop is incompatible with C++98">,
368  InGroup<CXX98Compat>, DefaultIgnore;
369def err_for_range_identifier : Error<
370  "range-based for loop requires type for loop variable">;
371def err_for_range_expected_decl : Error<
372  "for range declaration must declare a variable">;
373def err_argument_required_after_attribute : Error<
374  "argument required after attribute">;
375def err_missing_param : Error<"expected parameter declarator">;
376def err_function_scope_depth_exceeded : Error<
377  "function scope depth exceeded maximum of %0">, DefaultFatal;
378def err_missing_comma_before_ellipsis : Error<
379  "C requires a comma prior to the ellipsis in a variadic function type">;
380def err_unexpected_typedef_ident : Error<
381  "unexpected type name %0: expected identifier">;
382def warn_cxx98_compat_decltype : Warning<
383  "'decltype' type specifier is incompatible with C++98">,
384  InGroup<CXX98Compat>, DefaultIgnore;
385def err_unexpected_scope_on_base_decltype : Error<
386  "unexpected namespace scope prior to decltype">;
387def err_expected_class_name : Error<"expected class name">;
388def err_expected_class_name_not_template :
389  Error<"'typename' is redundant; base classes are implicitly types">;
390def err_unspecified_vla_size_with_static : Error<
391  "'static' may not be used with an unspecified variable length array size">;
392def err_unspecified_size_with_static : Error<
393  "'static' may not be used without an array size">;
394def err_expected_parentheses_around_typename : Error<
395  "expected parentheses around type name in %0 expression">;
396
397def err_expected_case_before_expression: Error<
398  "expected 'case' keyword before expression">;
399
400def ext_warn_gnu_final : ExtWarn<
401  "__final is a GNU extension, consider using C++11 final">,
402  InGroup<GccCompat>;
403
404// Declarations.
405def err_typename_requires_specqual : Error<
406  "type name requires a specifier or qualifier">;
407def err_typename_invalid_storageclass : Error<
408  "type name does not allow storage class to be specified">;
409def err_typename_invalid_functionspec : Error<
410  "type name does not allow function specifier to be specified">;
411def err_typename_invalid_constexpr : Error<
412  "type name does not allow %sub{select_constexpr_spec_kind}0 specifier "
413  "to be specified">;
414def err_typename_identifiers_only : Error<
415  "typename is allowed for identifiers only">;
416
417def err_friend_invalid_in_context : Error<
418  "'friend' used outside of class">;
419def err_templated_using_directive_declaration : Error<
420  "cannot template a using %select{directive|declaration}0">;
421def err_unexpected_colon_in_nested_name_spec : Error<
422  "unexpected ':' in nested name specifier; did you mean '::'?">;
423def err_unexpected_token_in_nested_name_spec : Error<
424  "'%0' cannot be a part of nested name specifier; did you mean ':'?">;
425def err_bool_redeclaration : Error<
426  "redeclaration of C++ built-in type 'bool'">;
427def warn_cxx98_compat_static_assert : Warning<
428  "'static_assert' declarations are incompatible with C++98">,
429  InGroup<CXX98Compat>, DefaultIgnore;
430def ext_ms_static_assert : ExtWarn<
431  "use of 'static_assert' without inclusion of <assert.h> is a Microsoft "
432  "extension">, InGroup<MicrosoftStaticAssert>;
433def ext_cxx_static_assert_no_message : ExtWarn<
434  "'static_assert' with no message is a C++17 extension">, InGroup<CXX17>;
435def ext_c_static_assert_no_message : ExtWarn<
436  "'_Static_assert' with no message is a C2x extension">, InGroup<C2x>;
437def warn_cxx14_compat_static_assert_no_message : Warning<
438  "'static_assert' with no message is incompatible with C++ standards before "
439  "C++17">,
440  DefaultIgnore, InGroup<CXXPre17Compat>;
441def warn_c17_compat_static_assert_no_message : Warning<
442  "'_Static_assert' with no message is incompatible with C standards before "
443  "C2x">,
444  DefaultIgnore, InGroup<CPre2xCompat>;
445def err_function_definition_not_allowed : Error<
446  "function definition is not allowed here">;
447def err_expected_end_of_enumerator : Error<
448  "expected '= constant-expression' or end of enumerator definition">;
449def err_expected_coloncolon_after_super : Error<
450  "expected '::' after '__super'">;
451
452def ext_decomp_decl_empty : ExtWarn<
453  "ISO C++17 does not allow a decomposition group to be empty">,
454  InGroup<DiagGroup<"empty-decomposition">>;
455
456/// Objective-C parser diagnostics
457def err_expected_minus_or_plus : Error<
458  "method type specifier must start with '-' or '+'">;
459def err_objc_missing_end : Error<"missing '@end'">;
460def note_objc_container_start : Note<
461  "%select{class|protocol|category|class extension|implementation"
462  "|category implementation}0 started here">;
463def warn_objc_protocol_qualifier_missing_id : Warning<
464  "protocol has no object type specified; defaults to qualified 'id'">;
465def err_objc_unknown_at : Error<"expected an Objective-C directive after '@'">;
466def err_illegal_super_cast : Error<
467  "cannot cast 'super' (it isn't an expression)">;
468def err_nsnumber_nonliteral_unary : Error<
469  "@%0 must be followed by a number to form an NSNumber object">;
470def warn_cstyle_param : Warning<
471  "use of C-style parameters in Objective-C method declarations"
472  " is deprecated">, InGroup<DeprecatedDeclarations>;
473
474let CategoryName = "ARC Parse Issue" in {
475def err_arc_bridge_retain : Error<
476  "unknown cast annotation __bridge_retain; did you mean __bridge_retained?">;
477// To be default mapped to an error later.
478def warn_arc_bridge_cast_nonarc : Warning<
479  "'%0' casts have no effect when not using ARC">,
480  InGroup<DiagGroup<"arc-bridge-casts-disallowed-in-nonarc">>;
481}
482
483def err_objc_illegal_visibility_spec : Error<
484  "illegal visibility specification">;
485def err_objc_illegal_interface_qual : Error<"illegal interface qualifier">;
486def err_objc_expected_equal_for_getter : Error<
487  "expected '=' for Objective-C getter">;
488def err_objc_expected_equal_for_setter : Error<
489  "expected '=' for Objective-C setter">;
490def err_objc_expected_selector_for_getter_setter : Error<
491  "expected selector for Objective-C %select{setter|getter}0">;
492def err_objc_property_requires_field_name : Error<
493  "property requires fields to be named">;
494def err_objc_property_bitfield : Error<"property name cannot be a bit-field">;
495def err_objc_expected_property_attr : Error<"unknown property attribute %0">;
496def err_objc_unexpected_attr : Error<
497  "prefix attribute must be followed by an interface, protocol, or implementation">;
498def err_objc_postfix_attribute : Error <
499  "postfix attributes are not allowed on Objective-C directives">;
500def err_objc_postfix_attribute_hint : Error <
501  "postfix attributes are not allowed on Objective-C directives, place"
502  " them in front of '%select{@interface|@protocol}0'">;
503def err_objc_directive_only_in_protocol : Error<
504  "directive may only be specified in protocols only">;
505def err_missing_catch_finally : Error<
506  "@try statement without a @catch and @finally clause">;
507def err_objc_concat_string : Error<"unexpected token after Objective-C string">;
508def err_expected_objc_container : Error<
509  "'@end' must appear in an Objective-C context">;
510def err_unexpected_protocol_qualifier : Error<
511  "@implementation declaration cannot be protocol qualified">;
512def err_objc_unexpected_atend : Error<
513  "'@end' appears where closing brace '}' is expected">;
514def err_synthesized_property_name : Error<
515  "expected a property name in @synthesize">;
516def warn_semicolon_before_method_body : Warning<
517  "semicolon before method body is ignored">,
518  InGroup<SemiBeforeMethodBody>, DefaultIgnore;
519def note_extra_comma_message_arg : Note<
520  "comma separating Objective-C messaging arguments">;
521
522def err_expected_field_designator : Error<
523  "expected a field designator, such as '.field = 4'">;
524
525def err_declaration_does_not_declare_param : Error<
526  "declaration does not declare a parameter">;
527def err_no_matching_param : Error<"parameter named %0 is missing">;
528
529/// Objective-C++ parser diagnostics
530def err_expected_token_instead_of_objcxx_keyword : Error<
531  "expected %0; %1 is a keyword in Objective-C++">;
532def err_expected_member_name_or_semi_objcxx_keyword : Error<
533  "expected member name or ';' after declaration specifiers; "
534  "%0 is a keyword in Objective-C++">;
535
536/// C++ parser diagnostics
537def err_invalid_operator_on_type : Error<
538  "cannot use %select{dot|arrow}0 operator on a type">;
539def err_expected_unqualified_id : Error<
540  "expected %select{identifier|unqualified-id}0">;
541def err_while_loop_outside_of_a_function : Error<
542  "while loop outside of a function">;
543def err_brackets_go_after_unqualified_id : Error<
544  "brackets are not allowed here; to declare an array, "
545  "place the brackets after the %select{identifier|name}0">;
546def err_unexpected_unqualified_id : Error<"type-id cannot have a name">;
547def err_func_def_no_params : Error<
548  "function definition does not declare parameters">;
549def err_expected_lparen_after_type : Error<
550  "expected '(' for function-style cast or type construction">;
551def err_expected_init_in_condition : Error<
552  "variable declaration in condition must have an initializer">;
553def err_expected_init_in_condition_lparen : Error<
554  "variable declaration in condition cannot have a parenthesized initializer">;
555def err_extraneous_rparen_in_condition : Error<
556  "extraneous ')' after condition, expected a statement">;
557def ext_alias_in_init_statement : ExtWarn<
558  "alias declaration in this context is a C++2b extension">,
559  InGroup<CXX2b>;
560def warn_cxx20_alias_in_init_statement  : Warning<
561  "alias declaration in this context is incompatible with C++ standards before C++2b">,
562  DefaultIgnore, InGroup<CXXPre2bCompat>;
563def warn_dangling_else : Warning<
564  "add explicit braces to avoid dangling else">,
565  InGroup<DanglingElse>;
566def err_expected_member_or_base_name : Error<
567  "expected class member or base class name">;
568def err_expected_lbrace_after_base_specifiers : Error<
569  "expected '{' after base class list">;
570def err_missing_end_of_definition : Error<
571  "missing '}' at end of definition of %q0">;
572def note_missing_end_of_definition_before : Note<
573  "still within definition of %q0 here">;
574def ext_ellipsis_exception_spec : Extension<
575  "exception specification of '...' is a Microsoft extension">,
576  InGroup<MicrosoftExceptionSpec>;
577def err_dynamic_and_noexcept_specification : Error<
578  "cannot have both throw() and noexcept() clause on the same function">;
579def err_except_spec_unparsed : Error<
580  "unexpected end of exception specification">;
581def ext_dynamic_exception_spec : ExtWarn<
582  "ISO C++17 does not allow dynamic exception specifications">,
583  InGroup<DynamicExceptionSpec>, DefaultError;
584def warn_exception_spec_deprecated : Warning<
585  "dynamic exception specifications are deprecated">,
586  InGroup<DeprecatedDynamicExceptionSpec>, DefaultIgnore;
587def note_exception_spec_deprecated : Note<"use '%0' instead">;
588def warn_cxx98_compat_noexcept_decl : Warning<
589  "noexcept specifications are incompatible with C++98">,
590  InGroup<CXX98Compat>, DefaultIgnore;
591def err_expected_catch : Error<"expected catch">;
592def err_using_namespace_in_class : Error<
593  "'using namespace' is not allowed in classes">;
594def warn_cxx17_compat_using_enum_declaration : Warning<
595  "using enum declaration is incompatible with C++ standards before C++20">,
596  InGroup<CXXPre20Compat>, DefaultIgnore;
597def ext_using_enum_declaration : ExtWarn<
598  "using enum declaration is a C++20 extension">,
599  InGroup<CXX20>;
600def err_constructor_bad_name : Error<
601  "missing return type for function %0; did you mean the constructor name %1?">;
602def err_destructor_tilde_identifier : Error<
603  "expected a class name after '~' to name a destructor">;
604def err_destructor_tilde_scope : Error<
605  "'~' in destructor name should be after nested name specifier">;
606def err_destructor_template_id : Error<
607  "destructor name %0 does not refer to a template">;
608def err_default_arg_unparsed : Error<
609  "unexpected end of default argument expression">;
610def err_bracket_depth_exceeded : Error<
611  "bracket nesting level exceeded maximum of %0">, DefaultFatal;
612def note_bracket_depth : Note<
613  "use -fbracket-depth=N to increase maximum nesting level">;
614def err_misplaced_ellipsis_in_declaration : Error<
615  "'...' must %select{immediately precede declared identifier|"
616  "be innermost component of anonymous pack declaration}0">;
617def warn_misplaced_ellipsis_vararg : Warning<
618  "'...' in this location creates a C-style varargs function"
619  "%select{, not a function parameter pack|}0">,
620  InGroup<DiagGroup<"ambiguous-ellipsis">>;
621def note_misplaced_ellipsis_vararg_existing_ellipsis : Note<
622  "preceding '...' declares a function parameter pack">;
623def note_misplaced_ellipsis_vararg_add_ellipsis : Note<
624  "place '...' %select{immediately before declared identifier|here}0 "
625  "to declare a function parameter pack">;
626def note_misplaced_ellipsis_vararg_add_comma : Note<
627  "insert ',' before '...' to silence this warning">;
628def ext_abstract_pack_declarator_parens : ExtWarn<
629  "ISO C++11 requires a parenthesized pack declaration to have a name">,
630  InGroup<DiagGroup<"anonymous-pack-parens">>;
631def err_function_is_not_record : Error<
632  "unexpected %0 in function call; perhaps remove the %0?">;
633def err_super_in_using_declaration : Error<
634  "'__super' cannot be used with a using declaration">;
635def ext_constexpr_if : ExtWarn<
636  "constexpr if is a C++17 extension">, InGroup<CXX17>;
637def warn_cxx14_compat_constexpr_if : Warning<
638  "constexpr if is incompatible with C++ standards before C++17">,
639  DefaultIgnore, InGroup<CXXPre17Compat>;
640def ext_consteval_if : ExtWarn<
641  "consteval if is a C++2b extension">,
642   InGroup<CXX2b>;
643def warn_cxx20_compat_consteval_if : Warning<
644  "consteval if is incompatible with C++ standards before C++2b">,
645  InGroup<CXXPre2bCompat>, DefaultIgnore;
646
647def ext_init_statement : ExtWarn<
648  "'%select{if|switch}0' initialization statements are a C++17 extension">,
649  InGroup<CXX17>;
650def warn_cxx14_compat_init_statement : Warning<
651  "%select{if|switch}0 initialization statements are incompatible with "
652  "C++ standards before C++17">, DefaultIgnore, InGroup<CXXPre17Compat>;
653def ext_for_range_init_stmt : ExtWarn<
654  "range-based for loop initialization statements are a C++20 extension">,
655  InGroup<CXX20>;
656def warn_cxx17_compat_for_range_init_stmt : Warning<
657  "range-based for loop initialization statements are incompatible with "
658  "C++ standards before C++20">, DefaultIgnore, InGroup<CXXPre20Compat>;
659def warn_empty_init_statement : Warning<
660  "empty initialization statement of '%select{if|switch|range-based for}0' "
661  "has no effect">, InGroup<EmptyInitStatement>, DefaultIgnore;
662def err_keyword_as_parameter : Error <
663  "invalid parameter name: '%0' is a keyword">;
664
665// C++ derived classes
666def err_dup_virtual : Error<"duplicate 'virtual' in base specifier">;
667
668// C++ operator overloading
669def err_literal_operator_string_prefix : Error<
670  "string literal after 'operator' cannot have an encoding prefix">;
671def err_literal_operator_string_not_empty : Error<
672  "string literal after 'operator' must be '\"\"'">;
673def warn_cxx98_compat_literal_operator : Warning<
674  "literal operators are incompatible with C++98">,
675  InGroup<CXX98Compat>, DefaultIgnore;
676
677// Classes.
678def err_anon_type_definition : Error<
679  "declaration of anonymous %0 must be a definition">;
680def err_default_delete_in_multiple_declaration : Error<
681  "'= %select{default|delete}0' is a function definition and must occur in a "
682  "standalone declaration">;
683
684def warn_cxx98_compat_noexcept_expr : Warning<
685  "noexcept expressions are incompatible with C++98">,
686  InGroup<CXX98Compat>, DefaultIgnore;
687def warn_cxx98_compat_nullptr : Warning<
688  "'nullptr' is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
689
690def warn_wrong_clang_attr_namespace : Warning<
691  "'__clang__' is a predefined macro name, not an attribute scope specifier; "
692  "did you mean '_Clang' instead?">, InGroup<IgnoredAttributes>;
693def ext_ns_enum_attribute : Extension<
694  "attributes on %select{a namespace|an enumerator}0 declaration are "
695  "a C++17 extension">, InGroup<CXX17>;
696def warn_cxx14_compat_ns_enum_attribute : Warning<
697  "attributes on %select{a namespace|an enumerator}0 declaration are "
698  "incompatible with C++ standards before C++17">,
699  InGroup<CXXPre17CompatPedantic>, DefaultIgnore;
700def warn_cxx98_compat_alignas : Warning<"'alignas' is incompatible with C++98">,
701  InGroup<CXX98Compat>, DefaultIgnore;
702def warn_cxx98_compat_attribute : Warning<
703  "C++11 attribute syntax is incompatible with C++98">,
704  InGroup<CXX98Compat>, DefaultIgnore;
705def err_cxx11_attribute_forbids_arguments : Error<
706  "attribute %0 cannot have an argument list">;
707def err_attribute_requires_arguments : Error<
708  "parentheses must be omitted if %0 attribute's argument list is empty">;
709def err_cxx11_attribute_forbids_ellipsis : Error<
710  "attribute %0 cannot be used as an attribute pack">;
711def warn_cxx14_compat_using_attribute_ns : Warning<
712  "default scope specifier for attributes is incompatible with C++ standards "
713  "before C++17">, InGroup<CXXPre17Compat>, DefaultIgnore;
714def ext_using_attribute_ns : ExtWarn<
715  "default scope specifier for attributes is a C++17 extension">,
716  InGroup<CXX17>;
717def err_using_attribute_ns_conflict : Error<
718  "attribute with scope specifier cannot follow default scope specifier">;
719def err_attributes_not_allowed : Error<"an attribute list cannot appear here">;
720def ext_cxx11_attr_placement : ExtWarn<
721  "ISO C++ does not allow an attribute list to appear here">,
722  InGroup<DiagGroup<"cxx-attribute-extension">>;
723def err_attributes_misplaced : Error<"misplaced attributes; expected attributes here">;
724def err_l_square_l_square_not_attribute : Error<
725  "C++11 only allows consecutive left square brackets when "
726  "introducing an attribute">;
727def err_attribute_argument_parm_pack_not_supported : Error<
728  "attribute %0 does not support argument pack expansion">;
729def err_ms_declspec_type : Error<
730  "__declspec attributes must be an identifier or string literal">;
731def err_ms_property_no_getter_or_putter : Error<
732  "property does not specify a getter or a putter">;
733def err_ms_property_unknown_accessor : Error<
734  "expected 'get' or 'put' in property declaration">;
735def err_ms_property_has_set_accessor : Error<
736  "putter for property must be specified as 'put', not 'set'">;
737def err_ms_property_missing_accessor_kind : Error<
738  "missing 'get=' or 'put='">;
739def err_ms_property_expected_equal : Error<
740  "expected '=' after '%0'">;
741def err_ms_property_duplicate_accessor : Error<
742  "property declaration specifies '%0' accessor twice">;
743def err_ms_property_expected_accessor_name : Error<
744  "expected name of accessor method">;
745def err_ms_property_expected_comma_or_rparen : Error<
746  "expected ',' or ')' at end of property accessor list">;
747def err_ms_property_initializer : Error<
748  "property declaration cannot have a default member initializer">;
749
750def warn_cxx20_compat_explicit_bool : Warning<
751  "this expression will be parsed as explicit(bool) in C++20">,
752  InGroup<CXX20Compat>, DefaultIgnore;
753def warn_cxx17_compat_explicit_bool : Warning<
754  "explicit(bool) is incompatible with C++ standards before C++20">,
755  InGroup<CXXPre20Compat>, DefaultIgnore;
756def ext_explicit_bool : ExtWarn<"explicit(bool) is a C++20 extension">,
757  InGroup<CXX20>;
758
759/// C++ Templates
760def err_expected_template : Error<"expected template">;
761def err_unknown_template_name : Error<
762  "unknown template name %0">;
763def err_expected_comma_greater : Error<
764  "expected ',' or '>' in template-parameter-list">;
765def err_class_on_template_template_param
766    : Error<"template template parameter requires 'class'%select{| or "
767            "'typename'}0 after the parameter list">;
768def ext_template_template_param_typename : ExtWarn<
769  "template template parameter using 'typename' is a C++17 extension">,
770  InGroup<CXX17>;
771def warn_cxx14_compat_template_template_param_typename : Warning<
772  "template template parameter using 'typename' is "
773  "incompatible with C++ standards before C++17">,
774  InGroup<CXXPre17Compat>, DefaultIgnore;
775def err_template_spec_syntax_non_template : Error<
776  "identifier followed by '<' indicates a class template specialization but "
777  "%0 %select{does not refer to a template|refers to a function template|"
778  "<unused>|refers to a variable template|<unused>|refers to a concept}1">;
779def err_id_after_template_in_nested_name_spec : Error<
780  "expected template name after 'template' keyword in nested name specifier">;
781def err_unexpected_template_in_unqualified_id : Error<
782  "'template' keyword not permitted here">;
783def err_unexpected_template_in_destructor_name : Error<
784  "'template' keyword not permitted in destructor name">;
785def err_unexpected_template_after_using : Error<
786  "'template' keyword not permitted after 'using' keyword">;
787def err_two_right_angle_brackets_need_space : Error<
788  "a space is required between consecutive right angle brackets (use '> >')">;
789def err_right_angle_bracket_equal_needs_space : Error<
790  "a space is required between a right angle bracket and an equals sign "
791  "(use '> =')">;
792def warn_cxx11_right_shift_in_template_arg : Warning<
793  "use of right-shift operator ('>>') in template argument will require "
794  "parentheses in C++11">, InGroup<CXX11Compat>;
795def warn_cxx98_compat_two_right_angle_brackets : Warning<
796  "consecutive right angle brackets are incompatible with C++98 (use '> >')">,
797  InGroup<CXX98Compat>, DefaultIgnore;
798def err_templated_invalid_declaration : Error<
799  "a static_assert declaration cannot be a template">;
800def err_multiple_template_declarators : Error<
801  "%select{|a template declaration|an explicit template specialization|"
802  "an explicit template instantiation}0 can "
803  "only %select{|declare|declare|instantiate}0 a single entity">;
804def err_explicit_instantiation_with_definition : Error<
805  "explicit template instantiation cannot have a definition; if this "
806  "definition is meant to be an explicit specialization, add '<>' after the "
807  "'template' keyword">;
808def err_template_defn_explicit_instantiation : Error<
809  "%select{function|class|variable}0 cannot be defined in an explicit instantiation; if this "
810  "declaration is meant to be a %select{function|class|variable}0 definition, remove the 'template' keyword">;
811def err_friend_explicit_instantiation : Error<
812  "friend cannot be declared in an explicit instantiation; if this "
813  "declaration is meant to be a friend declaration, remove the 'template' keyword">;
814def err_explicit_instantiation_enum : Error<
815  "enumerations cannot be explicitly instantiated">;
816def err_expected_template_parameter : Error<"expected template parameter">;
817def err_empty_requires_expr : Error<
818  "a requires expression must contain at least one requirement">;
819def err_requires_expr_parameter_list_ellipsis : Error<
820  "varargs not allowed in requires expression">;
821def err_expected_semi_requirement : Error<
822  "expected ';' at end of requirement">;
823def err_requires_expr_missing_arrow : Error<
824  "expected '->' before expression type requirement">;
825def err_requires_expr_expected_type_constraint : Error<
826  "expected concept name with optional arguments">;
827def err_requires_expr_simple_requirement_noexcept : Error<
828  "'noexcept' can only be used in a compound requirement (with '{' '}' around "
829  "the expression)">;
830def err_requires_expr_in_simple_requirement : Error<
831  "requires expression in requirement body; did "
832  "you intend to place it in a nested requirement? (add another 'requires' "
833  "before the expression)">;
834
835def err_missing_dependent_template_keyword : Error<
836  "use 'template' keyword to treat '%0' as a dependent template name">;
837def warn_missing_dependent_template_keyword : ExtWarn<
838  "use 'template' keyword to treat '%0' as a dependent template name">;
839
840def ext_extern_template : Extension<
841  "extern templates are a C++11 extension">, InGroup<CXX11>;
842def warn_cxx98_compat_extern_template : Warning<
843  "extern templates are incompatible with C++98">,
844  InGroup<CXX98CompatPedantic>, DefaultIgnore;
845def warn_static_inline_explicit_inst_ignored : Warning<
846  "ignoring '%select{static|inline}0' keyword on explicit template "
847  "instantiation">, InGroup<DiagGroup<"static-inline-explicit-instantiation">>;
848
849// Constructor template diagnostics.
850def err_out_of_line_constructor_template_id : Error<
851  "out-of-line constructor for %0 cannot have template arguments">;
852
853def err_expected_qualified_after_typename : Error<
854  "expected a qualified name after 'typename'">;
855def warn_expected_qualified_after_typename : ExtWarn<
856  "expected a qualified name after 'typename'">;
857
858def err_typename_refers_to_non_type_template : Error<
859  "typename specifier refers to a non-type template">;
860def err_expected_type_name_after_typename : Error<
861  "expected an identifier or template-id after '::'">;
862def err_explicit_spec_non_template : Error<
863  "explicit %select{specialization|instantiation}0 of "
864  "%select{non-|undeclared }3template %1 %2">;
865
866def err_default_template_template_parameter_not_template : Error<
867  "default template argument for a template template parameter must be a class "
868  "template">;
869
870def ext_fold_expression : ExtWarn<
871  "pack fold expression is a C++17 extension">,
872  InGroup<CXX17>;
873def warn_cxx14_compat_fold_expression : Warning<
874  "pack fold expression is incompatible with C++ standards before C++17">,
875  InGroup<CXXPre17Compat>, DefaultIgnore;
876def err_expected_fold_operator : Error<
877  "expected a foldable binary operator in fold expression">;
878def err_fold_operator_mismatch : Error<
879  "operators in fold expression must be the same">;
880
881def err_ctor_init_missing_comma : Error<
882  "missing ',' between base or member initializers">;
883
884// C++ declarations
885def err_friend_decl_defines_type : Error<
886  "cannot define a type in a friend declaration">;
887def err_missing_whitespace_digraph : Error<
888  "found '<::' after a "
889  "%select{template name|addrspace_cast|const_cast|dynamic_cast|reinterpret_cast|static_cast}0"
890  " which forms the digraph '<:' (aka '[') and a ':', did you mean '< ::'?">;
891
892def ext_defaulted_deleted_function : ExtWarn<
893  "%select{defaulted|deleted}0 function definitions are a C++11 extension">,
894  InGroup<CXX11>;
895def warn_cxx98_compat_defaulted_deleted_function : Warning<
896  "%select{defaulted|deleted}0 function definitions are incompatible with C++98">,
897  InGroup<CXX98Compat>, DefaultIgnore;
898
899// C++11 default member initialization
900def ext_nonstatic_member_init : ExtWarn<
901  "default member initializer for non-static data member is a C++11 "
902  "extension">, InGroup<CXX11>;
903def warn_cxx98_compat_nonstatic_member_init : Warning<
904  "default member initializer for non-static data members is incompatible with "
905  "C++98">, InGroup<CXX98Compat>, DefaultIgnore;
906def ext_bitfield_member_init: ExtWarn<
907  "default member initializer for bit-field is a C++20 extension">,
908  InGroup<CXX20>;
909def warn_cxx17_compat_bitfield_member_init: Warning<
910  "default member initializer for bit-field is incompatible with "
911  "C++ standards before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
912def err_anon_bitfield_member_init : Error<
913  "anonymous bit-field cannot have a default member initializer">;
914def err_incomplete_array_member_init: Error<
915  "array bound cannot be deduced from a default member initializer">;
916
917// C++11 alias-declaration
918def ext_alias_declaration : ExtWarn<
919  "alias declarations are a C++11 extension">, InGroup<CXX11>;
920def warn_cxx98_compat_alias_declaration : Warning<
921  "alias declarations are incompatible with C++98">,
922  InGroup<CXX98Compat>, DefaultIgnore;
923def err_alias_declaration_not_identifier : Error<
924  "name defined in alias declaration must be an identifier">;
925def err_alias_declaration_specialization : Error<
926  "%select{partial specialization|explicit specialization|explicit instantiation}0 of alias templates is not permitted">;
927def err_alias_declaration_pack_expansion : Error<
928  "alias declaration cannot be a pack expansion">;
929
930// C++17 using-declaration pack expansions
931def ext_multi_using_declaration : ExtWarn<
932  "use of multiple declarators in a single using declaration is "
933  "a C++17 extension">, InGroup<CXX17>;
934def warn_cxx17_compat_multi_using_declaration : Warning<
935  "use of multiple declarators in a single using declaration is "
936  "incompatible with C++ standards before C++17">,
937  InGroup<CXXPre17Compat>, DefaultIgnore;
938def ext_using_declaration_pack : ExtWarn<
939  "pack expansion of using declaration is a C++17 extension">, InGroup<CXX17>;
940def warn_cxx17_compat_using_declaration_pack : Warning<
941  "pack expansion using declaration is incompatible with C++ standards "
942  "before C++17">, InGroup<CXXPre17Compat>, DefaultIgnore;
943
944// C++11 override control
945def ext_override_control_keyword : ExtWarn<
946  "'%0' keyword is a C++11 extension">, InGroup<CXX11>;
947def warn_cxx98_compat_override_control_keyword : Warning<
948  "'%0' keyword is incompatible with C++98">,
949  InGroup<CXX98Compat>, DefaultIgnore;
950def err_override_control_interface : Error<
951  "'%0' keyword not permitted with interface types">;
952def ext_ms_sealed_keyword : ExtWarn<
953  "'sealed' keyword is a Microsoft extension">,
954  InGroup<MicrosoftSealed>;
955def ext_ms_abstract_keyword : ExtWarn<
956  "'abstract' keyword is a Microsoft extension">,
957  InGroup<MicrosoftAbstract>;
958
959def err_access_specifier_interface : Error<
960  "interface types cannot specify '%select{private|protected}0' access">;
961
962def err_duplicate_class_virt_specifier : Error<
963  "class already marked '%0'">;
964
965def err_duplicate_virt_specifier : Error<
966  "class member already marked '%0'">;
967
968def err_virt_specifier_outside_class : Error<
969  "'%0' specifier is not allowed outside a class definition">;
970
971def err_expected_parameter_pack : Error<
972  "expected the name of a parameter pack">;
973def err_paren_sizeof_parameter_pack : Error<
974  "missing parentheses around the size of parameter pack %0">;
975def err_sizeof_parameter_pack : Error<
976  "expected parenthesized parameter pack name in 'sizeof...' expression">;
977
978// C++11 lambda expressions
979def err_expected_comma_or_rsquare : Error<
980  "expected ',' or ']' in lambda capture list">;
981def err_this_captured_by_reference : Error<
982  "'this' cannot be captured by reference">;
983def err_expected_capture : Error<
984  "expected variable name or 'this' in lambda capture list">;
985def err_expected_lambda_body : Error<"expected body of lambda expression">;
986def warn_cxx98_compat_lambda : Warning<
987  "lambda expressions are incompatible with C++98">,
988  InGroup<CXX98Compat>, DefaultIgnore;
989def err_lambda_decl_specifier_repeated : Error<
990  "%select{'mutable'|'constexpr'|'consteval'}0 cannot appear multiple times in a lambda declarator">;
991def err_lambda_capture_misplaced_ellipsis : Error<
992  "ellipsis in pack %select{|init-}0capture must appear %select{after|before}0 "
993  "the name of the capture">;
994def err_lambda_capture_multiple_ellipses : Error<
995  "multiple ellipses in pack capture">;
996def err_capture_default_first : Error<
997  "capture default must be first">;
998def ext_decl_attrs_on_lambda : ExtWarn<
999  "an attribute specifier sequence in this position is a C++2b extension">,
1000  InGroup<CXX2b>;
1001def ext_lambda_missing_parens : ExtWarn<
1002  "lambda without a parameter clause is a C++2b extension">,
1003  InGroup<CXX2b>;
1004def warn_cxx20_compat_decl_attrs_on_lambda : Warning<
1005  "an attribute specifier sequence in this position is incompatible with C++ "
1006  "standards before C++2b">, InGroup<CXXPre2bCompat>, DefaultIgnore;
1007
1008// C++17 lambda expressions
1009def err_expected_star_this_capture : Error<
1010  "expected 'this' following '*' in lambda capture list">;
1011
1012// C++17 constexpr lambda expressions
1013def warn_cxx14_compat_constexpr_on_lambda : Warning<
1014  "constexpr on lambda expressions is incompatible with C++ standards before C++17">,
1015  InGroup<CXXPre17Compat>, DefaultIgnore;
1016def ext_constexpr_on_lambda_cxx17 : ExtWarn<
1017  "'constexpr' on lambda expressions is a C++17 extension">, InGroup<CXX17>;
1018
1019// C++20 template lambdas
1020def ext_lambda_template_parameter_list: ExtWarn<
1021  "explicit template parameter list for lambdas is a C++20 extension">,
1022  InGroup<CXX20>;
1023def warn_cxx17_compat_lambda_template_parameter_list: Warning<
1024  "explicit template parameter list for lambdas is incompatible with "
1025  "C++ standards before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
1026def err_lambda_template_parameter_list_empty : Error<
1027  "lambda template parameter list cannot be empty">;
1028
1029// Availability attribute
1030def err_expected_version : Error<
1031  "expected a version of the form 'major[.minor[.subminor]]'">;
1032def warn_expected_consistent_version_separator : Warning<
1033  "use same version number separators '_' or '.'; as in "
1034  "'major[.minor[.subminor]]'">, InGroup<Availability>;
1035def err_zero_version : Error<
1036  "version number must have non-zero major, minor, or sub-minor version">;
1037def err_availability_expected_platform : Error<
1038  "expected a platform name, e.g., 'macos'">;
1039
1040// objc_bridge_related attribute
1041def err_objcbridge_related_expected_related_class : Error<
1042  "expected a related ObjectiveC class name, e.g., 'NSColor'">;
1043def err_objcbridge_related_selector_name : Error<
1044  "expected a class method selector with single argument, e.g., 'colorWithCGColor:'">;
1045
1046def err_availability_expected_change : Error<
1047  "expected 'introduced', 'deprecated', or 'obsoleted'">;
1048def err_availability_unknown_change : Error<
1049  "%0 is not an availability stage; use 'introduced', 'deprecated', or "
1050  "'obsoleted'">;
1051def err_availability_redundant : Error<
1052  "redundant %0 availability change; only the last specified change will "
1053  "be used">;
1054def warn_availability_and_unavailable : Warning<
1055  "'unavailable' availability overrides all other availability information">,
1056  InGroup<Availability>;
1057
1058// @available(...)
1059def err_avail_query_expected_platform_name : Error<
1060  "expected a platform name here">;
1061
1062def err_avail_query_unrecognized_platform_name : Error<
1063  "unrecognized platform name %0">;
1064def err_availability_query_wildcard_required: Error<
1065  "must handle potential future platforms with '*'">;
1066def err_availability_query_repeated_platform: Error<
1067  "version for '%0' already specified">;
1068def err_availability_query_repeated_star : Error<
1069  "'*' query has already been specified">;
1070
1071// External source symbol attribute
1072def err_external_source_symbol_expected_keyword : Error<
1073  "expected 'language', 'defined_in', or 'generated_declaration'">;
1074def err_external_source_symbol_duplicate_clause : Error<
1075  "duplicate %0 clause in an 'external_source_symbol' attribute">;
1076
1077// Type safety attributes
1078def err_type_safety_unknown_flag : Error<
1079  "invalid comparison flag %0; use 'layout_compatible' or 'must_be_null'">;
1080
1081// Type traits
1082def err_type_trait_arity : Error<
1083  "type trait requires %0%select{| or more}1 argument%select{|s}2; have "
1084  "%3 argument%s3">;
1085
1086// Language specific pragmas
1087// - Generic warnings
1088def warn_pragma_expected_lparen : Warning<
1089  "missing '(' after '#pragma %0' - ignoring">, InGroup<IgnoredPragmas>;
1090def warn_pragma_expected_rparen : Warning<
1091  "missing ')' after '#pragma %0' - ignoring">, InGroup<IgnoredPragmas>;
1092def warn_pragma_expected_identifier : Warning<
1093  "expected identifier in '#pragma %0' - ignored">, InGroup<IgnoredPragmas>;
1094def warn_pragma_expected_string : Warning<
1095  "expected string literal in '#pragma %0' - ignoring">, InGroup<IgnoredPragmas>;
1096def warn_pragma_missing_argument : Warning<
1097  "missing argument to '#pragma %0'%select{|; expected %2}1">, InGroup<IgnoredPragmas>;
1098def warn_pragma_invalid_argument : Warning<
1099  "unexpected argument '%0' to '#pragma %1'%select{|; expected %3}2">, InGroup<IgnoredPragmas>;
1100
1101def err_pragma_misplaced_in_decl : Error<"this pragma cannot appear in %0 declaration">;
1102
1103// '#pragma clang section' related errors
1104def err_pragma_expected_clang_section_name : Error<
1105  "expected one of [bss|data|rodata|text|relro] section kind in '#pragma %0'">;
1106def err_pragma_clang_section_expected_equal : Error<
1107  "expected '=' following '#pragma clang section %select{invalid|bss|data|rodata|text|relro}0'">;
1108def warn_pragma_expected_section_name : Warning<
1109  "expected a string literal for the section name in '#pragma %0' - ignored">,
1110  InGroup<IgnoredPragmas>;
1111
1112def warn_pragma_expected_section_push_pop_or_name : Warning<
1113  "expected push, pop or a string literal for the section name in '#pragma %0' - ignored">,
1114  InGroup<IgnoredPragmas>;
1115def warn_pragma_expected_section_label_or_name : Warning<
1116  "expected a stack label or a string literal for the section name in '#pragma %0' - ignored">,
1117  InGroup<IgnoredPragmas>;
1118def warn_pragma_expected_init_seg : Warning<
1119  "expected 'compiler', 'lib', 'user', or a string literal for the section name in '#pragma %0' - ignored">,
1120  InGroup<IgnoredPragmas>;
1121
1122def err_pragma_expected_integer : Error<"expected an integer argument in '#pragma %0'">;
1123def warn_pragma_expected_integer : Warning<
1124  "expected integer between %0 and %1 inclusive in '#pragma %2' - ignored">,
1125  InGroup<IgnoredPragmas>;
1126def warn_pragma_ms_struct : Warning<
1127  "incorrect use of '#pragma ms_struct on|off' - ignored">,
1128  InGroup<IgnoredPragmas>;
1129def warn_pragma_ms_fenv_access : Warning<
1130  "incorrect use of '#pragma fenv_access (on|off)' - ignored">,
1131  InGroup<IgnoredPragmas>;
1132def warn_pragma_extra_tokens_at_eol : Warning<
1133  "extra tokens at end of '#pragma %0' - ignored">,
1134  InGroup<IgnoredPragmas>;
1135def warn_pragma_expected_comma : Warning<
1136  "expected ',' in '#pragma %0'">, InGroup<IgnoredPragmas>;
1137def warn_pragma_expected_punc : Warning<
1138  "expected ')' or ',' in '#pragma %0'">, InGroup<IgnoredPragmas>;
1139def warn_pragma_expected_non_wide_string : Warning<
1140  "expected non-wide string literal in '#pragma %0'">, InGroup<IgnoredPragmas>;
1141// - Generic errors
1142def err_pragma_missing_argument : Error<
1143  "missing argument to '#pragma %0'%select{|; expected %2}1">;
1144// - #pragma options
1145def warn_pragma_options_expected_align : Warning<
1146  "expected 'align' following '#pragma options' - ignored">,
1147  InGroup<IgnoredPragmas>;
1148def warn_pragma_align_expected_equal : Warning<
1149  "expected '=' following '#pragma %select{align|options align}0' - ignored">,
1150  InGroup<IgnoredPragmas>;
1151def warn_pragma_align_invalid_option : Warning<
1152  "invalid alignment option in '#pragma %select{align|options align}0' - ignored">,
1153  InGroup<IgnoredPragmas>;
1154// - #pragma pack
1155def warn_pragma_unsupported_action : Warning<
1156  "known but unsupported action '%1' for '#pragma %0' - ignored">,
1157  InGroup<IgnoredPragmas>;
1158def warn_pragma_invalid_specific_action : Warning<
1159  "unknown action '%1' for '#pragma %0' - ignored">,
1160  InGroup<IgnoredPragmas>;
1161def warn_pragma_expected_action_or_r_paren : Warning<
1162  "expected action or ')' in '#pragma %0' - ignored">,
1163  InGroup<IgnoredPragmas>;
1164def warn_pragma_invalid_action : Warning<
1165  "unknown action for '#pragma %0' - ignored">,
1166  InGroup<IgnoredPragmas>;
1167def warn_pragma_pack_malformed : Warning<
1168  "expected integer or identifier in '#pragma pack' - ignored">,
1169  InGroup<IgnoredPragmas>;
1170// - #pragma intrinsic
1171def warn_pragma_intrinsic_builtin : Warning<
1172  "%0 is not a recognized builtin%select{|; consider including <intrin.h> to access non-builtin intrinsics}1">,
1173  InGroup<IgnoredPragmaIntrinsic>;
1174// - #pragma unused
1175def warn_pragma_unused_expected_var : Warning<
1176  "expected '#pragma unused' argument to be a variable name">,
1177  InGroup<IgnoredPragmas>;
1178// - #pragma init_seg
1179def warn_pragma_init_seg_unsupported_target : Warning<
1180  "'#pragma init_seg' is only supported when targeting a "
1181  "Microsoft environment">,
1182  InGroup<IgnoredPragmas>;
1183// - #pragma restricted to file scope or start of compound statement
1184def err_pragma_file_or_compound_scope : Error<
1185  "'#pragma %0' can only appear at file scope or at the start of a "
1186  "compound statement">;
1187// - #pragma stdc unknown
1188def ext_stdc_pragma_ignored : ExtWarn<"unknown pragma in STDC namespace">,
1189   InGroup<UnknownPragmas>;
1190// The C standard 7.6.1p2 says "The [FENV_ACCESS] pragma shall occur either
1191// outside external declarations or preceding all explicit declarations and
1192// statements inside a compound statement.
1193def warn_stdc_fenv_round_not_supported :
1194   Warning<"pragma STDC FENV_ROUND is not supported">,
1195   InGroup<UnknownPragmas>;
1196def warn_stdc_unknown_rounding_mode : Warning<
1197  "invalid or unsupported rounding mode in '#pragma STDC FENV_ROUND' - ignored">,
1198  InGroup<IgnoredPragmas>;
1199def warn_pragma_fp_ignored : Warning<
1200  "'#pragma %0' is not supported on this target - ignored">,
1201  InGroup<IgnoredPragmas>;
1202// - #pragma comment
1203def err_pragma_comment_malformed : Error<
1204  "pragma comment requires parenthesized identifier and optional string">;
1205def err_pragma_comment_unknown_kind : Error<"unknown kind of pragma comment">;
1206// PS4 recognizes only #pragma comment(lib)
1207def warn_pragma_comment_ignored : Warning<"'#pragma comment %0' ignored">,
1208  InGroup<IgnoredPragmas>;
1209// - #pragma detect_mismatch
1210def err_pragma_detect_mismatch_malformed : Error<
1211  "pragma detect_mismatch is malformed; it requires two comma-separated "
1212  "string literals">;
1213// - #pragma float_control
1214def err_pragma_float_control_malformed : Error<
1215  "pragma float_control is malformed; use 'float_control({push|pop})' or "
1216  "'float_control({precise|except}, {on|off} [,push])'">;
1217// - #pragma pointers_to_members
1218def err_pragma_pointers_to_members_unknown_kind : Error<
1219  "unexpected %0, expected to see one of %select{|'best_case', 'full_generality', }1"
1220  "'single_inheritance', 'multiple_inheritance', or 'virtual_inheritance'">;
1221// - #pragma clang optimize on/off
1222def err_pragma_optimize_invalid_argument : Error<
1223  "unexpected argument '%0' to '#pragma clang optimize'; "
1224  "expected 'on' or 'off'">;
1225def err_pragma_optimize_extra_argument : Error<
1226  "unexpected extra argument '%0' to '#pragma clang optimize'">;
1227// - #pragma clang attribute
1228def err_pragma_attribute_expected_push_pop_paren : Error<
1229  "expected 'push', 'pop', or '(' after '#pragma clang attribute'">;
1230def err_pragma_attribute_invalid_argument : Error<
1231  "unexpected argument '%0' to '#pragma clang attribute'; "
1232  "expected 'push' or 'pop'">;
1233def err_pragma_attribute_expected_attribute : Error<
1234  "expected an attribute after '('">;
1235def err_pragma_attribute_expected_attribute_name : Error<
1236  "expected identifier that represents an attribute name">;
1237def err_pragma_attribute_extra_tokens_after_attribute : Error<
1238  "extra tokens after attribute in a '#pragma clang attribute push'">;
1239def err_pragma_attribute_unsupported_attribute : Error<
1240  "attribute %0 is not supported by '#pragma clang attribute'">;
1241def err_pragma_attribute_expected_attribute_syntax : Error<
1242  "expected an attribute that is specified using the GNU, C++11 or '__declspec'"
1243  " syntax">;
1244def note_pragma_attribute_use_attribute_kw : Note<"use the GNU '__attribute__' "
1245  "syntax">;
1246def err_pragma_attribute_invalid_subject_set_specifier : Error<
1247  "expected attribute subject set specifier 'apply_to'">;
1248def err_pragma_attribute_expected_subject_identifier : Error<
1249  "expected an identifier that corresponds to an attribute subject rule">;
1250def err_pragma_attribute_unknown_subject_rule : Error<
1251  "unknown attribute subject rule '%0'">;
1252def err_pragma_attribute_expected_subject_sub_identifier : Error<
1253  "expected an identifier that corresponds to an attribute subject matcher "
1254  "sub-rule; '%0' matcher %select{does not support sub-rules|supports the "
1255  "following sub-rules: %2|}1">;
1256def err_pragma_attribute_unknown_subject_sub_rule : Error<
1257  "%select{invalid use of|unknown}2 attribute subject matcher sub-rule '%0'; "
1258  "'%1' matcher %select{does not support sub-rules|supports the following "
1259  "sub-rules: %3}2">;
1260def err_pragma_attribute_duplicate_subject : Error<
1261  "duplicate attribute subject matcher '%0'">;
1262def err_pragma_attribute_expected_period : Error<
1263  "expected '.' after pragma attribute namespace %0">;
1264def err_pragma_attribute_namespace_on_attribute : Error<
1265  "namespace can only apply to 'push' or 'pop' directives">;
1266def note_pragma_attribute_namespace_on_attribute : Note<
1267  "omit the namespace to add attributes to the most-recently"
1268  " pushed attribute group">;
1269def warn_no_support_for_eval_method_source_on_m32 : Warning<
1270  "Setting the floating point evaluation method to `source` on a target"
1271  " without SSE is not supported.">, InGroup<Pragmas>;
1272
1273// OpenCL EXTENSION pragma (OpenCL 1.1 [9.1])
1274def warn_pragma_expected_colon : Warning<
1275  "missing ':' after %0 - ignoring">, InGroup<IgnoredPragmas>;
1276def warn_pragma_expected_predicate : Warning<
1277  "expected %select{'enable', 'disable', 'begin' or 'end'|'disable'}0 - ignoring">, InGroup<IgnoredPragmas>;
1278def warn_pragma_unknown_extension : Warning<
1279  "OpenCL extension %0 unknown or does not require pragma - ignoring">, InGroup<IgnoredPragmas>;
1280def warn_pragma_unsupported_extension : Warning<
1281  "unsupported OpenCL extension %0 - ignoring">, InGroup<IgnoredPragmas>;
1282def warn_pragma_extension_is_core : Warning<
1283  "OpenCL extension %0 is core feature or supported optional core feature - ignoring">,
1284  InGroup<OpenCLCoreFeaturesDiagGroup>, DefaultIgnore;
1285
1286// OpenCL errors.
1287def err_opencl_taking_function_address_parser : Error<
1288  "taking address of function is not allowed">;
1289def err_opencl_logical_exclusive_or : Error<
1290  "^^ is a reserved operator in OpenCL">;
1291
1292// C++ for OpenCL.
1293def err_openclcxx_virtual_function : Error<
1294  "virtual functions are not supported in C++ for OpenCL">;
1295
1296// OpenMP support.
1297def warn_pragma_omp_ignored : Warning<
1298  "unexpected '#pragma omp ...' in program">, InGroup<SourceUsesOpenMP>, DefaultIgnore;
1299def warn_omp_extra_tokens_at_eol : Warning<
1300  "extra tokens at the end of '#pragma omp %0' are ignored">,
1301  InGroup<ExtraTokens>;
1302def warn_pragma_expected_colon_r_paren : Warning<
1303  "missing ':' or ')' after %0 - ignoring">, InGroup<IgnoredPragmas>;
1304def err_omp_unknown_directive : Error<
1305  "expected an OpenMP directive">;
1306def err_omp_unexpected_directive : Error<
1307  "unexpected OpenMP directive %select{|'#pragma omp %1'}0">;
1308def err_omp_expected_punc : Error<
1309  "expected ',' or ')' in '%0' %select{clause|directive}1">;
1310def err_omp_unexpected_clause : Error<
1311  "unexpected OpenMP clause '%0' in directive '#pragma omp %1'">;
1312def err_omp_immediate_directive : Error<
1313  "'#pragma omp %0' %select{|with '%2' clause }1cannot be an immediate substatement">;
1314def err_omp_expected_identifier_for_critical : Error<
1315  "expected identifier specifying the name of the 'omp critical' directive">;
1316def err_omp_expected_reduction_identifier : Error<
1317  "expected identifier or one of the following operators: '+', '-', '*', '&', '|', '^', '&&', or '||'">;
1318def err_omp_expected_equal_in_iterator : Error<
1319  "expected '=' in iterator specifier">;
1320def err_omp_expected_punc_after_iterator : Error<
1321  "expected ',' or ')' after iterator specifier">;
1322def err_omp_decl_in_declare_simd_variant : Error<
1323  "function declaration is expected after 'declare %select{simd|variant}0' directive">;
1324def err_omp_unknown_map_type : Error<
1325  "incorrect map type, expected one of 'to', 'from', 'tofrom', 'alloc', 'release', or 'delete'">;
1326def err_omp_unknown_map_type_modifier : Error<
1327  "incorrect map type modifier, expected one of: 'always', 'close', 'mapper'"
1328  "%select{|, 'present'}0%select{|, 'ompx_hold'}1">;
1329def err_omp_map_type_missing : Error<
1330  "missing map type">;
1331def err_omp_map_type_modifier_missing : Error<
1332  "missing map type modifier">;
1333def err_omp_declare_simd_inbranch_notinbranch : Error<
1334  "unexpected '%0' clause, '%1' is specified already">;
1335def err_expected_end_declare_target_or_variant : Error<
1336  "expected '#pragma omp end declare %select{target|variant}0'">;
1337def err_expected_begin_declare_variant
1338    : Error<"'#pragma omp end declare variant' with no matching '#pragma omp "
1339            "begin declare variant'">;
1340def err_expected_begin_assumes
1341    : Error<"'#pragma omp end assumes' with no matching '#pragma omp begin assumes'">;
1342def warn_omp_unknown_assumption_clause_missing_id
1343    : Warning<"valid %0 clauses start with %1; %select{token|tokens}2 will be ignored">,
1344      InGroup<OpenMPClauses>;
1345def warn_omp_unknown_assumption_clause_without_args
1346    : Warning<"%0 clause should not be followed by arguments; tokens will be ignored">,
1347      InGroup<OpenMPClauses>;
1348def note_omp_assumption_clause_continue_here
1349    : Note<"the ignored tokens spans until here">;
1350def err_omp_declare_target_unexpected_clause: Error<
1351  "unexpected '%0' clause, only %select{'device_type'|'to' or 'link'|'to', 'link' or 'device_type'|'device_type', 'indirect'|'to', 'link', 'device_type' or 'indirect'}1 clauses expected">;
1352def err_omp_begin_declare_target_unexpected_implicit_to_clause: Error<
1353  "unexpected '(', only 'to', 'link' or 'device_type' clauses expected for 'begin declare target' directive">;
1354def err_omp_declare_target_unexpected_clause_after_implicit_to: Error<
1355  "unexpected clause after an implicit 'to' clause">;
1356def err_omp_declare_target_missing_to_or_link_clause: Error<
1357  "expected at least one %select{'to' or 'link'|'to', 'link' or 'indirect'}0 clause">;
1358def err_omp_declare_target_multiple : Error<
1359  "%0 appears multiple times in clauses on the same declare target directive">;
1360def err_omp_declare_target_indirect_device_type: Error<
1361  "only 'device_type(any)' clause is allowed with indirect clause">;
1362def err_omp_expected_clause: Error<
1363  "expected at least one clause on '#pragma omp %0' directive">;
1364def err_omp_mapper_illegal_identifier : Error<
1365  "illegal OpenMP user-defined mapper identifier">;
1366def err_omp_mapper_expected_declarator : Error<
1367  "expected declarator on 'omp declare mapper' directive">;
1368def err_omp_unexpected_append_op : Error<
1369  "unexpected operation specified in 'append_args' clause, expected 'interop'">;
1370def err_omp_declare_variant_wrong_clause : Error<
1371  "expected %select{'match'|'match', 'adjust_args', or 'append_args'}0 clause "
1372  "on 'omp declare variant' directive">;
1373def err_omp_declare_variant_duplicate_nested_trait : Error<
1374  "nested OpenMP context selector contains duplicated trait '%0'"
1375  " in selector '%1' and set '%2' with different score">;
1376def err_omp_declare_variant_nested_user_condition : Error<
1377  "nested user conditions in OpenMP context selector not supported (yet)">;
1378def warn_omp_declare_variant_string_literal_or_identifier
1379    : Warning<"expected identifier or string literal describing a context "
1380              "%select{set|selector|property}0; "
1381              "%select{set|selector|property}0 skipped">,
1382      InGroup<OpenMPClauses>;
1383def warn_unknown_declare_variant_isa_trait
1384    : Warning<"isa trait '%0' is not known to the current target; verify the "
1385              "spelling or consider restricting the context selector with the "
1386              "'arch' selector further">,
1387      InGroup<SourceUsesOpenMP>;
1388def note_omp_declare_variant_ctx_options
1389    : Note<"context %select{set|selector|property}0 options are: %1">;
1390def warn_omp_declare_variant_expected
1391    : Warning<"expected '%0' after the %1; '%0' assumed">,
1392      InGroup<OpenMPClauses>;
1393def warn_omp_declare_variant_ctx_not_a_property
1394    : Warning<"'%0' is not a valid context property for the context selector "
1395              "'%1' and the context set '%2'; property ignored">,
1396      InGroup<OpenMPClauses>;
1397def note_omp_declare_variant_ctx_is_a
1398    : Note<"'%0' is a context %select{set|selector|property}1 not a context "
1399           "%select{set|selector|property}2">;
1400def note_omp_declare_variant_ctx_try : Note<"try 'match(%0={%1%2})'">;
1401def warn_omp_declare_variant_ctx_not_a_selector
1402    : Warning<"'%0' is not a valid context selector for the context set '%1'; "
1403              "selector ignored">,
1404      InGroup<OpenMPClauses>;
1405def warn_omp_declare_variant_ctx_not_a_set
1406    : Warning<"'%0' is not a valid context set in a `declare variant`; set "
1407              "ignored">,
1408      InGroup<OpenMPClauses>;
1409def warn_omp_declare_variant_ctx_mutiple_use
1410    : Warning<"the context %select{set|selector|property}0 '%1' was used "
1411              "already in the same 'omp declare variant' directive; "
1412              "%select{set|selector|property}0 ignored">,
1413      InGroup<OpenMPClauses>;
1414def note_omp_declare_variant_ctx_used_here
1415    : Note<"the previous context %select{set|selector|property}0 '%1' used "
1416           "here">;
1417def note_omp_declare_variant_ctx_continue_here
1418    : Note<"the ignored %select{set|selector|property}0 spans until here">;
1419def warn_omp_ctx_incompatible_selector_for_set
1420    : Warning<"the context selector '%0' is not valid for the context set "
1421              "'%1'; selector ignored">,
1422      InGroup<OpenMPClauses>;
1423def note_omp_ctx_compatible_set_for_selector
1424    : Note<"the context selector '%0' can be nested in the context set '%1'; "
1425           "try 'match(%1={%0%select{|(property)}2})'">;
1426def warn_omp_ctx_selector_without_properties
1427    : Warning<"the context selector '%0' in context set '%1' requires a "
1428              "context property defined in parentheses; selector ignored">,
1429      InGroup<OpenMPClauses>;
1430def warn_omp_ctx_incompatible_property_for_selector
1431    : Warning<"the context property '%0' is not valid for the context selector "
1432              "'%1' and the context set '%2'; property ignored">,
1433      InGroup<OpenMPClauses>;
1434def note_omp_ctx_compatible_set_and_selector_for_property
1435    : Note<"the context property '%0' can be nested in the context selector "
1436           "'%1' which is nested in the context set '%2'; try "
1437           "'match(%2={%1(%0)})'">;
1438def warn_omp_ctx_incompatible_score_for_property
1439    : Warning<"the context selector '%0' in the context set '%1' cannot have a "
1440              "score ('%2'); score ignored">,
1441      InGroup<OpenMPClauses>;
1442def warn_omp_more_one_device_type_clause
1443    : Warning<"more than one 'device_type' clause is specified">,
1444      InGroup<OpenMPClauses>;
1445def err_omp_variant_ctx_second_match_extension : Error<
1446  "only a single match extension allowed per OpenMP context selector">;
1447def err_omp_invalid_dsa: Error<
1448  "data-sharing attribute '%0' in '%1' clause requires OpenMP version %2 or above">;
1449def err_omp_expected_punc_after_interop_mod : Error<
1450  "expected ',' after interop modifier">;
1451def err_omp_expected_interop_type : Error<
1452  "expected interop type: 'target' and/or 'targetsync'">;
1453def warn_omp_more_one_interop_type
1454  : Warning<"interop type '%0' cannot be specified more than once">,
1455    InGroup<OpenMPClauses>;
1456def err_expected_sequence_or_directive : Error<
1457  "expected an OpenMP 'directive' or 'sequence' attribute argument">;
1458def ext_omp_attributes : ExtWarn<
1459  "specifying OpenMP directives with [[]] is an OpenMP 5.1 extension">,
1460  InGroup<OpenMP51Ext>;
1461def warn_omp51_compat_attributes : Warning<
1462  "specifying OpenMP directives with [[]] is incompatible with OpenMP "
1463  "standards before OpenMP 5.1">,
1464  InGroup<OpenMPPre51Compat>, DefaultIgnore;
1465def err_omp_expected_colon : Error<"missing ':' in %0">;
1466def err_omp_expected_context_selector
1467    : Error<"expected valid context selector in %0">;
1468def err_omp_requires_out_inout_depend_type : Error<
1469  "reserved locator 'omp_all_memory' requires 'out' or 'inout' "
1470  "dependency types">;
1471def warn_omp_more_one_omp_all_memory : Warning<
1472  "reserved locator 'omp_all_memory' cannot be specified more than once">,
1473  InGroup<OpenMPClauses>;
1474
1475// Pragma loop support.
1476def err_pragma_loop_missing_argument : Error<
1477  "missing argument; expected %select{an integer value|"
1478  "'enable'%select{|, 'full'}1%select{|, 'assume_safety'}2 or 'disable'}0">;
1479def err_pragma_loop_invalid_option : Error<
1480  "%select{invalid|missing}0 option%select{ %1|}0; expected vectorize, "
1481  "vectorize_width, interleave, interleave_count, unroll, unroll_count, "
1482  "pipeline, pipeline_initiation_interval, vectorize_predicate, or distribute">;
1483def err_pragma_loop_invalid_vectorize_option : Error<
1484  "vectorize_width loop hint malformed; use vectorize_width(X, fixed) or "
1485  "vectorize_width(X, scalable) where X is an integer, or vectorize_width('fixed' or 'scalable')">;
1486def note_pragma_loop_invalid_vectorize_option : Note<
1487  "vectorize_width loop hint malformed; use vectorize_width(X, fixed) or "
1488  "vectorize_width(X, scalable) where X is an integer, or vectorize_width('fixed' or 'scalable')">;
1489
1490def err_pragma_fp_invalid_option : Error<
1491  "%select{invalid|missing}0 option%select{ %1|}0; expected 'contract', 'reassociate' or 'exceptions'">;
1492def err_pragma_fp_invalid_argument : Error<
1493  "unexpected argument '%0' to '#pragma clang fp %1'; expected "
1494  "%select{"
1495  "'fast' or 'on' or 'off'|"
1496  "'on' or 'off'|"
1497  "'ignore', 'maytrap' or 'strict'|"
1498  "'source', 'double' or 'extended'}2">;
1499
1500def err_pragma_invalid_keyword : Error<
1501  "invalid argument; expected 'enable'%select{|, 'full'}0%select{|, 'assume_safety'}1 or 'disable'">;
1502def err_pragma_pipeline_invalid_keyword : Error<
1503    "invalid argument; expected 'disable'">;
1504
1505// Pragma unroll support.
1506def warn_pragma_unroll_cuda_value_in_parens : Warning<
1507  "argument to '#pragma unroll' should not be in parentheses in CUDA C/C++">,
1508  InGroup<CudaCompat>;
1509
1510def warn_cuda_attr_lambda_position : Warning<
1511  "nvcc does not allow '__%0__' to appear after the parameter list in lambdas">,
1512  InGroup<CudaCompat>;
1513def warn_pragma_force_cuda_host_device_bad_arg : Warning<
1514  "incorrect use of #pragma clang force_cuda_host_device begin|end">,
1515  InGroup<IgnoredPragmas>;
1516def err_pragma_cannot_end_force_cuda_host_device : Error<
1517  "force_cuda_host_device end pragma without matching "
1518  "force_cuda_host_device begin">;
1519
1520def warn_ext_int_deprecated : Warning<
1521  "'_ExtInt' is deprecated; use '_BitInt' instead">, InGroup<DeprecatedType>;
1522def ext_bit_int : Extension<
1523  "'_BitInt' in %select{C17 and earlier|C++}0 is a Clang extension">,
1524  InGroup<DiagGroup<"bit-int-extension">>;
1525def warn_c17_compat_bit_int : Warning<
1526  "'_BitInt' is incompatible with C standards before C2x">,
1527  InGroup<CPre2xCompat>, DefaultIgnore;
1528} // end of Parse Issue category.
1529
1530let CategoryName = "Modules Issue" in {
1531def err_unexpected_module_decl : Error<
1532  "module declaration can only appear at the top level">;
1533def err_module_expected_ident : Error<
1534  "expected a module name after '%select{module|import}0'">;
1535def err_attribute_not_module_attr : Error<
1536  "%0 attribute cannot be applied to a module">;
1537def err_attribute_not_import_attr : Error<
1538  "%0 attribute cannot be applied to a module import">;
1539def err_module_expected_semi : Error<
1540  "expected ';' after module name">;
1541def err_global_module_introducer_not_at_start : Error<
1542  "'module;' introducing a global module fragment can appear only "
1543  "at the start of the translation unit">;
1544def err_module_fragment_exported : Error<
1545  "%select{global|private}0 module fragment cannot be exported">;
1546def err_private_module_fragment_expected_semi : Error<
1547  "expected ';' after private module fragment declaration">;
1548def err_missing_before_module_end : Error<"expected %0 at end of module">;
1549def err_unsupported_module_partition : Error<
1550  "module partitions are only supported for C++20 onwards">;
1551def err_import_not_allowed_here : Error<
1552  "imports must immediately follow the module declaration">;
1553def err_partition_import_outside_module : Error<
1554  "module partition imports must be within a module purview">;
1555def err_import_in_wrong_fragment : Error<
1556  "module%select{| partition}0 imports cannot be in the %select{global|private}1 module fragment">;
1557
1558def err_export_empty : Error<"export declaration cannot be empty">;
1559}
1560
1561let CategoryName = "Generics Issue" in {
1562
1563def err_objc_expected_type_parameter : Error<
1564  "expected type parameter name">;
1565
1566def err_objc_parameterized_implementation : Error<
1567  "@implementation cannot have type parameters">;
1568
1569def err_objc_type_args_after_protocols : Error<
1570  "protocol qualifiers must precede type arguments">;
1571
1572def note_meant_to_use_typename : Note<
1573  "did you mean to use 'typename'?">;
1574}
1575
1576let CategoryName = "Coroutines Issue" in {
1577def err_for_co_await_not_range_for : Error<
1578  "'co_await' modifier can only be applied to range-based for loop">;
1579def warn_deprecated_for_co_await : Warning<
1580  "'for co_await' belongs to CoroutineTS instead of C++20, which is deprecated">,
1581  InGroup<DeprecatedCoroutine>;
1582}
1583
1584let CategoryName = "Concepts Issue" in {
1585def err_concept_definition_not_identifier : Error<
1586  "name defined in concept definition must be an identifier">;
1587def ext_concept_legacy_bool_keyword : ExtWarn<
1588  "ISO C++20 does not permit the 'bool' keyword after 'concept'">,
1589  InGroup<DiagGroup<"concepts-ts-compat">>;
1590def err_placeholder_expected_auto_or_decltype_auto : Error<
1591  "expected 'auto' or 'decltype(auto)' after concept name">;
1592}
1593
1594def warn_max_tokens : Warning<
1595  "the number of preprocessor source tokens (%0) exceeds this token limit (%1)">,
1596  InGroup<MaxTokens>, DefaultIgnore;
1597
1598def warn_max_tokens_total : Warning<
1599  "the total number of preprocessor source tokens (%0) exceeds the token limit (%1)">,
1600  InGroup<MaxTokens>, DefaultIgnore;
1601
1602def note_max_tokens_total_override : Note<"total token limit set here">;
1603
1604// HLSL Parser Diagnostics
1605
1606def err_expected_semantic_identifier : Error<
1607  "expected HLSL Semantic identifier">;
1608def err_unknown_hlsl_semantic : Error<"unknown HLSL semantic %0">;
1609def ext_hlsl_access_specifiers : ExtWarn<
1610  "access specifiers are a clang HLSL extension">,
1611  InGroup<HLSLExtension>;
1612
1613} // end of Parser diagnostics
1614