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