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