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