Clang Project

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