]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/clang/include/clang/Basic/DiagnosticParseKinds.td
Merge the following revisions from ^/projects/release-vmimage:
[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 w_asm_qualifier_ignored : Warning<"ignored %0 qualifier on asm">,
17                               CatInlineAsm;
18 def warn_file_asm_volatile : Warning<
19   "meaningless 'volatile' on asm outside function">, CatInlineAsm;
20
21 let CategoryName = "Inline Assembly Issue" in {
22 def err_asm_empty : Error<"__asm used with no assembly instructions">;
23 def err_inline_ms_asm_parsing : Error<"%0">;
24 def err_msasm_unsupported_arch : Error<
25   "Unsupported architecture '%0' for MS-style inline assembly">;
26 def err_msasm_unable_to_create_target : Error<
27   "MS-style inline assembly is not available: %0">;
28 }
29
30 let CategoryName = "Parse Issue" in {
31
32 def ext_empty_translation_unit : Extension<
33   "ISO C requires a translation unit to contain at least one declaration">,
34   InGroup<DiagGroup<"empty-translation-unit">>;
35 def warn_cxx98_compat_top_level_semi : Warning<
36   "extra ';' outside of a function is incompatible with C++98">,
37   InGroup<CXX98CompatPedantic>, DefaultIgnore;
38 def ext_extra_semi : Extension<
39   "extra ';' %select{"
40   "outside of a function|"
41   "inside a %1|"
42   "inside instance variable list|"
43   "after member function definition}0">,
44   InGroup<ExtraSemi>;
45 def ext_extra_semi_cxx11 : Extension<
46   "extra ';' outside of a function is a C++11 extension">,
47   InGroup<CXX11ExtraSemi>;
48 def warn_extra_semi_after_mem_fn_def : Warning<
49   "extra ';' after member function definition">,
50   InGroup<ExtraSemi>, DefaultIgnore;
51
52 def ext_duplicate_declspec : ExtWarn<"duplicate '%0' declaration specifier">,
53   InGroup<DuplicateDeclSpecifier>;
54 def warn_duplicate_declspec : Warning<"duplicate '%0' declaration specifier">,
55   InGroup<DuplicateDeclSpecifier>;
56 def ext_plain_complex : ExtWarn<
57   "plain '_Complex' requires a type specifier; assuming '_Complex double'">;
58 def ext_integer_complex : Extension<
59   "complex integer types are a GNU extension">, InGroup<GNUComplexInteger>;
60 def ext_thread_before : Extension<"'__thread' before '%0'">;
61 def 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
66 def error_empty_enum : Error<"use of empty enum">;
67 def err_invalid_sign_spec : Error<"'%0' cannot be signed or unsigned">;
68 def err_invalid_short_spec : Error<"'short %0' is invalid">;
69 def err_invalid_long_spec : Error<"'long %0' is invalid">;
70 def err_invalid_longlong_spec : Error<"'long long %0' is invalid">;
71 def err_invalid_complex_spec : Error<"'_Complex %0' is invalid">;
72 def err_friend_decl_spec : Error<"'%0' is invalid in friend declarations">;
73
74 def ext_ident_list_in_param : Extension<
75   "type-less parameter names in function declaration">;
76 def ext_c99_variable_decl_in_for_loop : Extension<
77   "variable declaration in for loop is a C99-specific feature">, InGroup<C99>;
78 def ext_c99_compound_literal : Extension<
79   "compound literals are a C99-specific feature">, InGroup<C99>;
80 def ext_enumerator_list_comma_c : Extension<
81   "commas at the end of enumerator lists are a C99-specific "
82   "feature">, InGroup<C99>;
83 def ext_enumerator_list_comma_cxx : Extension<
84   "commas at the end of enumerator lists are a C++11 extension">,
85   InGroup<CXX11>;
86 def warn_cxx98_compat_enumerator_list_comma : Warning<
87   "commas at the end of enumerator lists are incompatible with C++98">,
88   InGroup<CXX98CompatPedantic>, DefaultIgnore;
89 def err_enumerator_list_missing_comma : Error<
90   "missing ',' between enumerators">;
91 def err_enumerator_unnamed_no_def : Error<
92   "unnamed enumeration must be a definition">;
93 def ext_cxx11_enum_fixed_underlying_type : Extension<
94   "enumeration types with a fixed underlying type are a C++11 extension">, 
95   InGroup<CXX11>;
96 def ext_c_enum_fixed_underlying_type : Extension<
97   "enumeration types with a fixed underlying type are a Microsoft extension">,
98   InGroup<Microsoft>;
99 def warn_cxx98_compat_enum_fixed_underlying_type : Warning<
100   "enumeration types with a fixed underlying type are incompatible with C++98">,
101   InGroup<CXX98Compat>, DefaultIgnore;
102 def warn_cxx98_compat_alignof : Warning<
103   "alignof expressions are incompatible with C++98">,
104   InGroup<CXX98Compat>, DefaultIgnore;
105 def ext_alignof_expr : ExtWarn<
106   "%0 applied to an expression is a GNU extension">, InGroup<GNUAlignofExpression>;
107
108 def warn_microsoft_dependent_exists : Warning<
109   "dependent %select{__if_not_exists|__if_exists}0 declarations are ignored">, 
110   InGroup<DiagGroup<"microsoft-exists">>;
111
112 def ext_c11_generic_selection : Extension<
113   "generic selections are a C11-specific feature">, InGroup<C11>;
114 def err_duplicate_default_assoc : Error<
115   "duplicate default generic association">;
116 def note_previous_default_assoc : Note<
117   "previous default generic association is here">;
118
119 def ext_c11_alignment : Extension<
120   "%0 is a C11-specific feature">, InGroup<C11>;
121
122 def ext_c11_noreturn : Extension<
123   "_Noreturn functions are a C11-specific feature">, InGroup<C11>;
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 ext_gnu_statement_expr : Extension<
130   "use of GNU statement expression extension">, InGroup<GNUStatementExpression>;
131 def ext_gnu_conditional_expr : Extension<
132   "use of GNU ?: conditional expression extension, omitting middle operand">, InGroup<GNUConditionalOmittedOperand>;
133 def ext_gnu_empty_initializer : Extension<
134   "use of GNU empty initializer extension">, InGroup<GNUEmptyInitializer>;
135 def ext_gnu_array_range : Extension<"use of GNU array range extension">, 
136   InGroup<GNUDesignator>;
137 def ext_gnu_missing_equal_designator : ExtWarn<
138   "use of GNU 'missing =' extension in designator">, 
139   InGroup<GNUDesignator>;
140 def err_expected_equal_designator : Error<"expected '=' or another designator">;
141 def ext_gnu_old_style_field_designator : ExtWarn<
142   "use of GNU old-style field designator extension">, 
143   InGroup<GNUDesignator>;
144 def ext_gnu_case_range : Extension<"use of GNU case range extension">,
145   InGroup<GNUCaseRange>;
146
147 // Generic errors.
148 def err_expected_expression : Error<"expected expression">;
149 def err_expected_type : Error<"expected a type">;
150 def err_expected_external_declaration : Error<"expected external declaration">;
151 def err_extraneous_closing_brace : Error<"extraneous closing brace ('}')">;
152 def err_expected_semi_declaration : Error<
153   "expected ';' at end of declaration">;
154 def err_expected_semi_decl_list : Error<
155   "expected ';' at end of declaration list">;
156 def ext_expected_semi_decl_list : ExtWarn<
157   "expected ';' at end of declaration list">;
158 def err_expected_member_name_or_semi : Error<
159   "expected member name or ';' after declaration specifiers">;
160 def err_function_declared_typedef : Error<
161   "function definition declared 'typedef'">;
162 def err_at_defs_cxx : Error<"@defs is not supported in Objective-C++">;
163 def err_at_in_class : Error<"unexpected '@' in member specification">;
164
165 def err_expected_fn_body : Error<
166   "expected function body after function declarator">;
167 def warn_attribute_on_function_definition : Warning<
168   "GCC does not allow %0 attribute in this position on a function definition">, 
169   InGroup<GccCompat>;
170 def warn_attribute_no_decl : Warning<
171   "attribute %0 ignored, because it is not attached to a declaration">, 
172   InGroup<IgnoredAttributes>;
173 def err_expected_method_body : Error<"expected method body">;
174 def err_invalid_token_after_toplevel_declarator : Error<
175   "expected ';' after top level declarator">;
176 def err_invalid_token_after_declarator_suggest_equal : Error<
177   "invalid %0 at end of declaration; did you mean '='?">;
178 def err_expected_statement : Error<"expected statement">;
179 def err_expected_lparen_after : Error<"expected '(' after '%0'">;
180 def err_expected_rparen_after : Error<"expected ')' after '%0'">;
181 def err_expected_punc : Error<"expected ')' or ',' after '%0'">;
182 def err_expected_less_after : Error<"expected '<' after '%0'">;
183 def err_expected_lbrace_in_compound_literal : Error<
184   "expected '{' in compound literal">;
185 def err_expected_while : Error<"expected 'while' in do/while loop">;
186
187 def err_expected_semi_after_stmt : Error<"expected ';' after %0 statement">;
188 def err_expected_semi_after_expr : Error<"expected ';' after expression">;
189 def err_extraneous_token_before_semi : Error<"extraneous '%0' before ';'">;
190
191 def err_expected_semi_after_method_proto : Error<
192   "expected ';' after method prototype">;
193 def err_expected_semi_after_namespace_name : Error<
194   "expected ';' after namespace name">;
195 def err_unexpected_namespace_attributes_alias : Error<
196   "attributes cannot be specified on namespace alias">;
197 def err_inline_namespace_alias : Error<"namespace alias cannot be inline">;
198 def err_namespace_nonnamespace_scope : Error<
199   "namespaces can only be defined in global or namespace scope">;
200 def err_nested_namespaces_with_double_colon : Error<
201   "nested namespace definition must define each namespace separately">;
202 def err_expected_semi_after_attribute_list : Error<
203   "expected ';' after attribute list">;
204 def err_expected_semi_after_static_assert : Error<
205   "expected ';' after static_assert">;
206 def err_expected_semi_for : Error<"expected ';' in 'for' statement specifier">;
207 def err_single_decl_assign_in_for_range : Error<
208   "range-based 'for' statement uses ':', not '='">;
209 def warn_missing_selector_name : Warning<
210   "%0 used as the name of the previous parameter rather than as part "
211   "of the selector">,
212   InGroup<DiagGroup<"missing-selector-name">>;
213 def note_missing_selector_name : Note<
214   "introduce a parameter name to make %0 part of the selector">;
215 def note_force_empty_selector_name : Note<
216   "or insert whitespace before ':' to use %0 as parameter name "
217   "and have an empty entry in the selector">;
218 def err_label_end_of_compound_statement : Error<
219   "label at end of compound statement: expected statement">;
220 def err_address_of_label_outside_fn : Error<
221   "use of address-of-label extension outside of a function body">;
222 def err_asm_operand_wide_string_literal : Error<
223   "cannot use %select{unicode|wide}0 string literal in 'asm'">;
224 def err_expected_selector_for_method : Error<
225   "expected selector for Objective-C method">;
226 def err_expected_property_name : Error<"expected property name">;
227
228 def err_unexpected_at : Error<"unexpected '@' in program">;
229 def err_atimport : Error<
230 "use of '@import' when modules are disabled">;
231
232 def err_invalid_reference_qualifier_application : Error<
233   "'%0' qualifier may not be applied to a reference">;
234 def err_illegal_decl_reference_to_reference : Error<
235   "%0 declared as a reference to a reference">;
236 def ext_rvalue_reference : ExtWarn<
237   "rvalue references are a C++11 extension">, InGroup<CXX11>;
238 def warn_cxx98_compat_rvalue_reference : Warning<
239   "rvalue references are incompatible with C++98">,
240   InGroup<CXX98Compat>, DefaultIgnore;
241 def ext_ref_qualifier : ExtWarn<
242   "reference qualifiers on functions are a C++11 extension">, InGroup<CXX11>;
243 def warn_cxx98_compat_ref_qualifier : Warning<
244   "reference qualifiers on functions are incompatible with C++98">,
245   InGroup<CXX98Compat>, DefaultIgnore;
246 def ext_inline_namespace : ExtWarn<
247   "inline namespaces are a C++11 feature">, InGroup<CXX11>;
248 def warn_cxx98_compat_inline_namespace : Warning<
249   "inline namespaces are incompatible with C++98">,
250   InGroup<CXX98Compat>, DefaultIgnore;
251 def ext_generalized_initializer_lists : ExtWarn<
252   "generalized initializer lists are a C++11 extension">,
253   InGroup<CXX11>;
254 def warn_cxx98_compat_generalized_initializer_lists : Warning<
255   "generalized initializer lists are incompatible with C++98">,
256   InGroup<CXX98Compat>, DefaultIgnore;
257 def err_init_list_bin_op : Error<"initializer list cannot be used on the "
258   "%select{left|right}0 hand side of operator '%1'">;
259 def warn_cxx98_compat_trailing_return_type : Warning<
260   "trailing return types are incompatible with C++98">,
261   InGroup<CXX98Compat>, DefaultIgnore;
262 def ext_auto_type_specifier : ExtWarn<
263   "'auto' type specifier is a C++11 extension">, InGroup<CXX11>;
264 def warn_auto_storage_class : Warning<
265   "'auto' storage class specifier is redundant and incompatible with C++11">,
266   InGroup<CXX11Compat>, DefaultIgnore;
267 def ext_auto_storage_class : ExtWarn<
268   "'auto' storage class specifier is not permitted in C++11, and will not "
269   "be supported in future releases">, InGroup<DiagGroup<"auto-storage-class">>;
270 def ext_decltype_auto_type_specifier : ExtWarn<
271   "'decltype(auto)' type specifier is a C++1y extension">, InGroup<CXX1y>;
272 def warn_cxx11_compat_decltype_auto_type_specifier : Warning<
273   "'decltype(auto)' type specifier is incompatible with C++ standards before "
274   "C++1y">, InGroup<CXXPre1yCompat>, DefaultIgnore;
275 def ext_for_range : ExtWarn<
276   "range-based for loop is a C++11 extension">, InGroup<CXX11>;
277 def warn_cxx98_compat_for_range : Warning<
278   "range-based for loop is incompatible with C++98">,
279   InGroup<CXX98Compat>, DefaultIgnore;
280 def ext_for_range_identifier : ExtWarn<
281   "range-based for loop with implicit deduced type is a C++1z extension">,
282   InGroup<CXX1z>;
283 def warn_cxx1y_compat_for_range_identifier : Warning<
284   "range-based for loop with implicit deduced type is incompatible with "
285   "C++ standards before C++1z">,
286   InGroup<CXXPre1zCompat>, DefaultIgnore;
287 def err_for_range_expected_decl : Error<
288   "for range declaration must declare a variable">;
289 def err_argument_required_after_attribute : Error<
290   "argument required after attribute">;
291 def err_missing_param : Error<"expected parameter declarator">;
292 def err_missing_comma_before_ellipsis : Error<
293   "C requires a comma prior to the ellipsis in a variadic function type">;
294 def err_unexpected_typedef_ident : Error<
295   "unexpected type name %0: expected identifier">;
296 def warn_cxx98_compat_decltype : Warning<
297   "'decltype' type specifier is incompatible with C++98">,
298   InGroup<CXX98Compat>, DefaultIgnore;
299 def err_unexpected_scope_on_base_decltype : Error<
300   "unexpected namespace scope prior to decltype">;
301 def err_expected_class_name : Error<"expected class name">;
302 def err_expected_class_name_not_template : 
303   Error<"'typename' is redundant; base classes are implicitly types">;
304 def err_unspecified_vla_size_with_static : Error<
305   "'static' may not be used with an unspecified variable length array size">;
306 def warn_deprecated_register : Warning<
307   "'register' storage class specifier is deprecated">,
308   InGroup<DeprecatedRegister>;
309 def err_expected_parentheses_around_typename : Error<
310   "expected parentheses around type name in %0 expression">;
311
312 def err_expected_case_before_expression: Error<
313   "expected 'case' keyword before expression">;
314
315 // Declarations.
316 def err_typename_requires_specqual : Error<
317   "type name requires a specifier or qualifier">;
318 def err_typename_invalid_storageclass : Error<
319   "type name does not allow storage class to be specified">;
320 def err_typename_invalid_functionspec : Error<
321   "type name does not allow function specifier to be specified">;
322 def err_typename_invalid_constexpr : Error<
323   "type name does not allow constexpr specifier to be specified">;
324 def err_typename_identifiers_only : Error<
325   "typename is allowed for identifiers only">;
326
327 def err_invalid_decl_spec_combination : Error<
328   "cannot combine with previous '%0' declaration specifier">;
329 def err_invalid_vector_decl_spec_combination : Error<
330   "cannot combine with previous '%0' declaration specifier. "
331   "'__vector' must be first">;
332 def err_invalid_pixel_decl_spec_combination : Error<
333   "'__pixel' must be preceded by '__vector'.  "
334   "'%0' declaration specifier not allowed here">;
335 def err_invalid_vector_decl_spec : Error<
336   "cannot use '%0' with '__vector'">;
337 def err_invalid_vector_bool_decl_spec : Error<
338   "cannot use '%0' with '__vector bool'">;
339 def warn_vector_long_decl_spec_combination : Warning<
340   "Use of 'long' with '__vector' is deprecated">, InGroup<Deprecated>;
341 def err_friend_invalid_in_context : Error<
342   "'friend' used outside of class">;
343 def err_use_of_tag_name_without_tag : Error<
344   "must use '%1' tag to refer to type %0%select{| in this scope}2">;
345 def err_templated_using_directive : Error<
346   "cannot template a using directive">;
347 def err_templated_using_declaration : Error<
348   "cannot template a using declaration">;
349 def err_unexpected_colon_in_nested_name_spec : Error<
350   "unexpected ':' in nested name specifier; did you mean '::'?">;
351 def err_unexpected_token_in_nested_name_spec : Error<
352   "'%0' cannot be a part of nested name specifier; did you mean ':'?">;
353 def err_bool_redeclaration : Error<
354   "redeclaration of C++ built-in type 'bool'">;
355 def ext_c11_static_assert : Extension<
356   "_Static_assert is a C11-specific feature">, InGroup<C11>;
357 def warn_cxx98_compat_static_assert : Warning<
358   "static_assert declarations are incompatible with C++98">,
359   InGroup<CXX98Compat>, DefaultIgnore;
360 def err_paren_after_colon_colon : Error<
361   "unexpected parenthesis after '::'">;
362 def err_function_definition_not_allowed : Error<
363   "function definition is not allowed here">;
364 def err_expected_end_of_enumerator : Error<
365   "expected '= constant-expression' or end of enumerator definition">;
366
367 /// Objective-C parser diagnostics
368 def err_expected_minus_or_plus : Error<
369   "method type specifier must start with '-' or '+'">;
370 def err_objc_no_attributes_on_category : Error<
371   "attributes may not be specified on a category">;
372 def err_objc_missing_end : Error<"missing '@end'">;
373 def note_objc_container_start : Note<
374   "%select{class|protocol|category|class extension|implementation"
375   "|category implementation}0 started here">;
376 def warn_objc_protocol_qualifier_missing_id : Warning<
377   "protocol has no object type specified; defaults to qualified 'id'">;
378 def err_objc_unknown_at : Error<"expected an Objective-C directive after '@'">;
379 def err_illegal_super_cast : Error<
380   "cannot cast 'super' (it isn't an expression)">;
381 def err_nsnumber_nonliteral_unary : Error<
382   "@%0 must be followed by a number to form an NSNumber object">;
383 def warn_cstyle_param : Warning<
384   "use of C-style parameters in Objective-C method declarations"
385   " is deprecated">, InGroup<DeprecatedDeclarations>;
386
387 let CategoryName = "ARC Parse Issue" in {
388 def err_arc_bridge_retain : Error<
389   "unknown cast annotation __bridge_retain; did you mean __bridge_retained?">;
390 // To be default mapped to an error later.
391 def warn_arc_bridge_cast_nonarc : Warning<
392   "'%0' casts have no effect when not using ARC">,
393   InGroup<DiagGroup<"arc-bridge-casts-disallowed-in-nonarc">>;
394 }
395   
396 def err_objc_illegal_visibility_spec : Error<
397   "illegal visibility specification">;
398 def err_objc_illegal_interface_qual : Error<"illegal interface qualifier">;
399 def err_objc_expected_equal_for_getter : Error<
400   "expected '=' for Objective-C getter">;
401 def err_objc_expected_equal_for_setter : Error<
402   "expected '=' for Objective-C setter">;
403 def err_objc_expected_selector_for_getter_setter : Error<
404   "expected selector for Objective-C %select{setter|getter}0">;
405 def err_objc_property_requires_field_name : Error<
406   "property requires fields to be named">;
407 def err_objc_property_bitfield : Error<"property name cannot be a bitfield">;
408 def err_objc_expected_property_attr : Error<"unknown property attribute %0">;
409 def err_objc_properties_require_objc2 : Error<
410   "properties are an Objective-C 2 feature">;
411 def err_objc_unexpected_attr : Error<
412   "prefix attribute must be followed by an interface or protocol">;
413 def err_objc_postfix_attribute : Error <
414   "postfix attributes are not allowed on Objective-C directives">;
415 def err_objc_postfix_attribute_hint : Error <
416   "postfix attributes are not allowed on Objective-C directives, place"
417   " them in front of '%select{@interface|@protocol}0'">;
418 def err_objc_directive_only_in_protocol : Error<
419   "directive may only be specified in protocols only">;
420 def err_missing_catch_finally : Error<
421   "@try statement without a @catch and @finally clause">;
422 def err_objc_concat_string : Error<"unexpected token after Objective-C string">;
423 def err_expected_objc_container : Error<
424   "'@end' must appear in an Objective-C context">;
425 def err_unexpected_protocol_qualifier : Error<
426   "@implementation declaration cannot be protocol qualified">;
427 def err_objc_unexpected_atend : Error<
428   "'@end' appears where closing brace '}' is expected">;
429 def error_property_ivar_decl : Error<
430   "property synthesize requires specification of an ivar">;
431 def err_synthesized_property_name : Error<
432   "expected a property name in @synthesize">;
433 def warn_semicolon_before_method_body : Warning<
434   "semicolon before method body is ignored">,
435   InGroup<DiagGroup<"semicolon-before-method-body">>, DefaultIgnore;
436 def note_extra_comma_message_arg : Note<
437   "comma separating Objective-C messaging arguments">;
438
439 def err_expected_field_designator : Error<
440   "expected a field designator, such as '.field = 4'">;
441
442 def err_declaration_does_not_declare_param : Error<
443   "declaration does not declare a parameter">;
444 def err_no_matching_param : Error<"parameter named %0 is missing">;
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 go after the %select{identifier|unqualified-id}0">;
453 def err_unexpected_unqualified_id : Error<"type-id cannot have a name">;
454 def err_func_def_no_params : Error<
455   "function definition does not declare parameters">;
456 def err_expected_lparen_after_type : Error<
457   "expected '(' for function-style cast or type construction">;
458 def err_expected_init_in_condition : Error<
459   "variable declaration in condition must have an initializer">;
460 def err_expected_init_in_condition_lparen : Error<
461   "variable declaration in condition cannot have a parenthesized initializer">;
462 def err_extraneous_rparen_in_condition : Error<
463   "extraneous ')' after condition, expected a statement">;
464 def warn_dangling_else : Warning<
465   "add explicit braces to avoid dangling else">,
466   InGroup<DanglingElse>;
467 def err_expected_member_or_base_name : Error<
468   "expected class member or base class name">;
469 def err_expected_lbrace_after_base_specifiers : Error<
470   "expected '{' after base class list">;
471 def err_missing_end_of_definition : Error<
472   "missing '}' at end of definition of %q0">;
473 def note_missing_end_of_definition_before : Note<
474   "still within definition of %q0 here">;
475 def ext_ellipsis_exception_spec : Extension<
476   "exception specification of '...' is a Microsoft extension">,
477   InGroup<Microsoft>;
478 def err_dynamic_and_noexcept_specification : Error<
479   "cannot have both throw() and noexcept() clause on the same function">;
480 def warn_cxx98_compat_noexcept_decl : Warning<
481   "noexcept specifications are incompatible with C++98">,
482   InGroup<CXX98Compat>, DefaultIgnore;
483 def err_expected_catch : Error<"expected catch">;
484 def err_using_namespace_in_class : Error<
485   "'using namespace' is not allowed in classes">;
486 def err_constructor_bad_name : Error<
487   "missing return type for function %0; did you mean the constructor name %1?">;
488 def err_destructor_tilde_identifier : Error<
489   "expected a class name after '~' to name a destructor">;
490 def err_destructor_template_id : Error<
491   "destructor name %0 does not refer to a template">;
492 def err_default_arg_unparsed : Error<
493   "unexpected end of default argument expression">;
494 def err_bracket_depth_exceeded : Error<
495   "bracket nesting level exceeded maximum of %0">, DefaultFatal;
496 def note_bracket_depth : Note<
497   "use -fbracket-depth=N to increase maximum nesting level">;
498 def err_misplaced_ellipsis_in_declaration : Error<
499   "'...' must %select{immediately precede declared identifier|"
500   "be innermost component of anonymous pack declaration}0">;
501 def ext_abstract_pack_declarator_parens : ExtWarn<
502   "ISO C++11 requires a parenthesized pack declaration to have a name">,
503   InGroup<DiagGroup<"anonymous-pack-parens">>;
504 def err_function_is_not_record : Error<
505   "unexpected %0 in function call; perhaps remove the %0?">;
506
507 // C++ derived classes
508 def err_dup_virtual : Error<"duplicate 'virtual' in base specifier">;
509
510 // C++ operator overloading
511 def err_literal_operator_string_prefix : Error<
512   "string literal after 'operator' cannot have an encoding prefix">;
513 def err_literal_operator_string_not_empty : Error<
514   "string literal after 'operator' must be '\"\"'">;
515 def warn_cxx98_compat_literal_operator : Warning<
516   "literal operators are incompatible with C++98">,
517   InGroup<CXX98Compat>, DefaultIgnore;
518
519 // Classes.
520 def err_anon_type_definition : Error<
521   "declaration of anonymous %0 must be a definition">;
522 def err_default_delete_in_multiple_declaration : Error<
523   "'= %select{default|delete}0' is a function definition and must occur in a "
524   "standalone declaration">;
525
526 def warn_cxx98_compat_noexcept_expr : Warning<
527   "noexcept expressions are incompatible with C++98">,
528   InGroup<CXX98Compat>, DefaultIgnore;
529 def warn_cxx98_compat_nullptr : Warning<
530   "'nullptr' is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
531
532 def warn_cxx98_compat_alignas : Warning<"'alignas' is incompatible with C++98">,
533   InGroup<CXX98Compat>, DefaultIgnore;
534 def warn_cxx98_compat_attribute : Warning<
535   "C++11 attribute syntax is incompatible with C++98">,
536   InGroup<CXX98Compat>, DefaultIgnore;
537 def err_cxx11_attribute_forbids_arguments : Error<
538   "attribute %0 cannot have an argument list">;
539 def err_attribute_requires_arguments : Error<
540   "parentheses must be omitted if %0 attribute's argument list is empty">;
541 def err_cxx11_attribute_forbids_ellipsis : Error<
542   "attribute '%0' cannot be used as an attribute pack">;
543 def err_cxx11_attribute_repeated : Error<
544   "attribute %0 cannot appear multiple times in an attribute specifier">;
545 def err_attributes_not_allowed : Error<"an attribute list cannot appear here">;
546 def err_l_square_l_square_not_attribute : Error<
547   "C++11 only allows consecutive left square brackets when "
548   "introducing an attribute">;
549 def err_ms_declspec_type : Error<
550   "__declspec attributes must be an identifier or string literal">;
551 def err_ms_property_no_getter_or_putter : Error<
552   "property does not specify a getter or a putter">;
553 def err_ms_property_unknown_accessor : Error<
554   "expected 'get' or 'put' in property declaration">;
555 def err_ms_property_has_set_accessor : Error<
556   "putter for property must be specified as 'put', not 'set'">;
557 def err_ms_property_missing_accessor_kind : Error<
558   "missing 'get=' or 'put='">;
559 def err_ms_property_expected_equal : Error<
560   "expected '=' after '%0'">;
561 def err_ms_property_duplicate_accessor : Error<
562   "property declaration specifies '%0' accessor twice">;
563 def err_ms_property_expected_accessor_name : Error<
564   "expected name of accessor method">;
565 def err_ms_property_expected_comma_or_rparen : Error<
566   "expected ',' or ')' at end of property accessor list">;
567
568 /// C++ Templates
569 def err_expected_template : Error<"expected template">;
570 def err_unknown_template_name : Error<
571   "unknown template name %0">;
572 def err_expected_comma_greater : Error<
573   "expected ',' or '>' in template-parameter-list">;
574 def err_class_on_template_template_param : Error<
575   "template template parameter requires 'class' after the parameter list">;
576 def ext_template_template_param_typename : ExtWarn<
577   "template template parameter using 'typename' is a C++1z extension">,
578   InGroup<CXX1z>;
579 def warn_cxx1y_compat_template_template_param_typename : Warning<
580   "template template parameter using 'typename' is "
581   "incompatible with C++ standards before C++1z">,
582   InGroup<CXXPre1zCompat>, DefaultIgnore;
583 def err_template_spec_syntax_non_template : Error<
584   "identifier followed by '<' indicates a class template specialization but "
585   "%0 %select{does not refer to a template|refers to a function template|"
586   "<unused>|refers to a variable template|<unused>}1">;
587 def err_id_after_template_in_nested_name_spec : Error<
588   "expected template name after 'template' keyword in nested name specifier">;
589 def err_two_right_angle_brackets_need_space : Error<
590   "a space is required between consecutive right angle brackets (use '> >')">;
591 def err_right_angle_bracket_equal_needs_space : Error<
592   "a space is required between a right angle bracket and an equals sign "
593   "(use '> =')">;
594 def warn_cxx11_right_shift_in_template_arg : Warning<
595   "use of right-shift operator ('>>') in template argument will require "
596   "parentheses in C++11">, InGroup<CXX11Compat>;
597 def warn_cxx98_compat_two_right_angle_brackets : Warning<
598   "consecutive right angle brackets are incompatible with C++98 (use '> >')">,
599   InGroup<CXX98Compat>, DefaultIgnore;
600 def err_multiple_template_declarators : Error<
601     "%select{|a template declaration|an explicit template specialization|"
602     "an explicit template instantiation}0 can "
603     "only %select{|declare|declare|instantiate}0 a single entity">;
604 def err_explicit_instantiation_with_definition : Error<
605     "explicit template instantiation cannot have a definition; if this "
606     "definition is meant to be an explicit specialization, add '<>' after the "
607     "'template' keyword">;
608 def err_template_defn_explicit_instantiation : Error<
609   "%select{function|class|variable}0 cannot be defined in an explicit instantiation; if this "
610   "declaration is meant to be a %select{function|class|variable}0 definition, remove the 'template' keyword">;
611 def err_friend_explicit_instantiation : Error<
612   "friend cannot be declared in an explicit instantiation; if this "
613   "declaration is meant to be a friend declaration, remove the 'template' keyword">;
614 def err_explicit_instantiation_enum : Error<
615     "enumerations cannot be explicitly instantiated">;
616 def err_expected_template_parameter : Error<"expected template parameter">;
617
618 def err_missing_dependent_template_keyword : Error<
619   "use 'template' keyword to treat '%0' as a dependent template name">;
620 def warn_missing_dependent_template_keyword : ExtWarn<
621   "use 'template' keyword to treat '%0' as a dependent template name">;
622
623 def ext_extern_template : Extension<
624   "extern templates are a C++11 extension">, InGroup<CXX11>;
625 def warn_cxx98_compat_extern_template : Warning<
626   "extern templates are incompatible with C++98">,
627   InGroup<CXX98CompatPedantic>, DefaultIgnore;
628 def warn_static_inline_explicit_inst_ignored : Warning<
629   "ignoring '%select{static|inline}0' keyword on explicit template "
630   "instantiation">, InGroup<DiagGroup<"static-inline-explicit-instantiation">>;
631   
632 // Constructor template diagnostics.
633 def err_out_of_line_constructor_template_id : Error<
634   "out-of-line constructor for %0 cannot have template arguments">;
635 def err_out_of_line_template_id_names_constructor : Error<
636   "qualified reference to %0 is a constructor name rather than a "
637   "template name wherever a constructor can be declared">;
638 def err_out_of_line_type_names_constructor : Error<
639   "qualified reference to %0 is a constructor name rather than a "
640   "type wherever a constructor can be declared">;
641
642 def err_expected_qualified_after_typename : Error<
643   "expected a qualified name after 'typename'">;
644 def warn_expected_qualified_after_typename : ExtWarn<
645   "expected a qualified name after 'typename'">;
646
647 def err_typename_refers_to_non_type_template : Error<
648   "typename specifier refers to a non-type template">;
649 def err_expected_type_name_after_typename : Error<
650   "expected an identifier or template-id after '::'">;
651 def err_explicit_spec_non_template : Error<
652   "explicit %select{specialization|instantiation}0 of non-template %1 %2">;
653   
654 def err_default_template_template_parameter_not_template : Error<
655   "default template argument for a template template parameter must be a class "
656   "template">;
657   
658 def err_ctor_init_missing_comma : Error<
659   "missing ',' between base or member initializers">;
660
661 // C++ declarations
662 def err_friend_decl_defines_type : Error<
663   "cannot define a type in a friend declaration">;
664 def err_missing_whitespace_digraph : Error<
665   "found '<::' after a "
666   "%select{template name|const_cast|dynamic_cast|reinterpret_cast|static_cast}0"
667   " which forms the digraph '<:' (aka '[') and a ':', did you mean '< ::'?">;
668
669 def ext_deleted_function : ExtWarn<
670   "deleted function definitions are a C++11 extension">, InGroup<CXX11>;
671 def warn_cxx98_compat_deleted_function : Warning<
672   "deleted function definitions are incompatible with C++98">,
673   InGroup<CXX98Compat>, DefaultIgnore;
674 def ext_defaulted_function : ExtWarn<
675   "defaulted function definitions are a C++11 extension">, InGroup<CXX11>;
676 def warn_cxx98_compat_defaulted_function : Warning<
677   "defaulted function definitions are incompatible with C++98">,
678   InGroup<CXX98Compat>, DefaultIgnore;
679
680 // C++11 in-class member initialization
681 def ext_nonstatic_member_init : ExtWarn<
682   "in-class initialization of non-static data member is a C++11 extension">,
683   InGroup<CXX11>;
684 def warn_cxx98_compat_nonstatic_member_init : Warning<
685   "in-class initialization of non-static data members is incompatible with C++98">,
686   InGroup<CXX98Compat>, DefaultIgnore;
687 def err_bitfield_member_init: Error<
688   "bitfield member cannot have an in-class initializer">;
689 def err_incomplete_array_member_init: Error<
690   "array bound cannot be deduced from an in-class initializer">;
691
692 // C++11 alias-declaration
693 def ext_alias_declaration : ExtWarn<
694   "alias declarations are a C++11 extension">, InGroup<CXX11>;
695 def warn_cxx98_compat_alias_declaration : Warning<
696   "alias declarations are incompatible with C++98">,
697   InGroup<CXX98Compat>, DefaultIgnore;
698 def err_alias_declaration_not_identifier : Error<
699   "name defined in alias declaration must be an identifier">;
700 def err_alias_declaration_specialization : Error<
701   "%select{partial specialization|explicit specialization|explicit instantiation}0 of alias templates is not permitted">;
702     
703 // C++11 override control
704 def ext_override_control_keyword : ExtWarn<
705   "'%0' keyword is a C++11 extension">, InGroup<CXX11>;
706 def warn_cxx98_compat_override_control_keyword : Warning<
707   "'%0' keyword is incompatible with C++98">,
708   InGroup<CXX98Compat>, DefaultIgnore;
709 def err_override_control_interface : Error<
710   "'%0' keyword not permitted with interface types">;
711 def ext_ms_sealed_keyword : ExtWarn<
712   "'sealed' keyword is a Microsoft extension">,
713   InGroup<Microsoft>;
714
715 def err_access_specifier_interface : Error<
716   "interface types cannot specify '%select{private|protected}0' access">;
717
718 def err_duplicate_virt_specifier : Error<
719   "class member already marked '%0'">;
720
721 def err_scoped_enum_missing_identifier : Error<
722   "scoped enumeration requires a name">;
723 def ext_scoped_enum : ExtWarn<
724   "scoped enumerations are a C++11 extension">, InGroup<CXX11>;
725 def warn_cxx98_compat_scoped_enum : Warning<
726   "scoped enumerations are incompatible with C++98">,
727   InGroup<CXX98Compat>, DefaultIgnore;
728
729 def err_expected_parameter_pack : Error<
730   "expected the name of a parameter pack">;
731 def err_paren_sizeof_parameter_pack : Error<
732   "missing parentheses around the size of parameter pack %0">;
733 def err_sizeof_parameter_pack : Error<
734   "expected parenthesized parameter pack name in 'sizeof...' expression">;
735
736 // C++11 lambda expressions
737 def err_expected_comma_or_rsquare : Error<
738   "expected ',' or ']' in lambda capture list">;
739 def err_this_captured_by_reference : Error<
740   "'this' cannot be captured by reference">;
741 def err_expected_capture : Error<
742   "expected variable name or 'this' in lambda capture list">;
743 def err_expected_lambda_body : Error<"expected body of lambda expression">;
744 def warn_cxx98_compat_lambda : Warning<
745   "lambda expressions are incompatible with C++98">,
746   InGroup<CXX98Compat>, DefaultIgnore;
747 def err_lambda_missing_parens : Error<
748   "lambda requires '()' before %select{'mutable'|return type|"
749   "attribute specifier}0">;
750
751 // Availability attribute
752 def err_expected_version : Error<
753   "expected a version of the form 'major[.minor[.subminor]]'">;
754 def err_zero_version : Error<
755   "version number must have non-zero major, minor, or sub-minor version">;
756 def err_availability_expected_platform : Error<
757   "expected a platform name, e.g., 'macosx'">;
758   
759 // objc_bridge_related attribute
760 def err_objcbridge_related_expected_related_class : Error<
761   "expected a related ObjectiveC class name, e.g., 'NSColor'">;
762 def err_objcbridge_related_selector_name : Error<
763   "expected a class method selector with single argument, e.g., 'colorWithCGColor:'">;
764
765 def err_availability_expected_change : Error<
766   "expected 'introduced', 'deprecated', or 'obsoleted'">;
767 def err_availability_unknown_change : Error<
768   "%0 is not an availability stage; use 'introduced', 'deprecated', or "
769   "'obsoleted'">;
770 def err_availability_redundant : Error<
771   "redundant %0 availability change; only the last specified change will "
772   "be used">;
773 def warn_availability_and_unavailable : Warning<
774   "'unavailable' availability overrides all other availability information">,
775   InGroup<Availability>;
776
777 // Type safety attributes
778 def err_type_safety_unknown_flag : Error<
779   "invalid comparison flag %0; use 'layout_compatible' or 'must_be_null'">;
780
781 // Type traits
782 def err_type_trait_arity : Error<
783   "type trait requires %0%select{| or more}1 argument%select{|s}2; have "
784   "%3 argument%s3">;
785
786 // Language specific pragmas
787 // - Generic warnings
788 def warn_pragma_expected_lparen : Warning<
789   "missing '(' after '#pragma %0' - ignoring">, InGroup<IgnoredPragmas>;
790 def warn_pragma_expected_rparen : Warning<
791   "missing ')' after '#pragma %0' - ignoring">, InGroup<IgnoredPragmas>;
792 def warn_pragma_expected_identifier : Warning<
793   "expected identifier in '#pragma %0' - ignored">, InGroup<IgnoredPragmas>;
794 def warn_pragma_expected_section_name : Warning<
795   "expected a string literal for the section name in '#pragma %0' - ignored">,
796   InGroup<IgnoredPragmas>;
797 def warn_pragma_expected_section_push_pop_or_name : Warning<
798   "expected push, pop or a string literal for the section name in '#pragma %0' - ignored">,
799   InGroup<IgnoredPragmas>;
800 def warn_pragma_expected_section_label_or_name : Warning<
801   "expected a stack label or a string literal for the section name in '#pragma %0' - ignored">,
802   InGroup<IgnoredPragmas>;
803 def warn_pragma_expected_init_seg : Warning<
804   "expected 'compiler', 'lib', 'user', or a string literal for the section name in '#pragma %0' - ignored">,
805   InGroup<IgnoredPragmas>;
806 def warn_pragma_expected_integer : Warning<
807   "expected integer between %0 and %1 inclusive in '#pragma %2' - ignored">,
808   InGroup<IgnoredPragmas>;
809 def warn_pragma_ms_struct : Warning<
810   "incorrect use of '#pragma ms_struct on|off' - ignored">,
811   InGroup<IgnoredPragmas>;
812 def warn_pragma_extra_tokens_at_eol : Warning<
813   "extra tokens at end of '#pragma %0' - ignored">,
814   InGroup<IgnoredPragmas>;
815 def warn_pragma_expected_punc : Warning<
816   "expected ')' or ',' in '#pragma %0'">, InGroup<IgnoredPragmas>;
817 def warn_pragma_expected_non_wide_string : Warning<
818   "expected non-wide string literal in '#pragma %0'">, InGroup<IgnoredPragmas>;
819 // - Generic errors
820 def err_pragma_missing_argument : Error<
821   "missing argument to '#pragma %0'; expected %1">;
822 // - #pragma options
823 def warn_pragma_options_expected_align : Warning<
824   "expected 'align' following '#pragma options' - ignored">,
825   InGroup<IgnoredPragmas>;
826 def warn_pragma_align_expected_equal : Warning<
827   "expected '=' following '#pragma %select{align|options align}0' - ignored">,
828   InGroup<IgnoredPragmas>;
829 def warn_pragma_align_invalid_option : Warning<
830   "invalid alignment option in '#pragma %select{align|options align}0' - ignored">,
831   InGroup<IgnoredPragmas>;
832 // - #pragma pack
833 def warn_pragma_unsupported_action : Warning<
834   "known but unsupported action '%1' for '#pragma %0' - ignored">,
835   InGroup<IgnoredPragmas>;
836 def warn_pragma_invalid_specific_action : Warning<
837   "unknown action '%1' for '#pragma %0' - ignored">,
838   InGroup<IgnoredPragmas>;
839 def warn_pragma_expected_action_or_r_paren : Warning<
840   "expected action or ')' in '#pragma %0' - ignored">,
841   InGroup<IgnoredPragmas>;
842 def warn_pragma_invalid_action : Warning<
843   "unknown action for '#pragma %0' - ignored">,
844   InGroup<IgnoredPragmas>;
845 def warn_pragma_pack_malformed : Warning<
846   "expected integer or identifier in '#pragma pack' - ignored">,
847   InGroup<IgnoredPragmas>;
848 // - #pragma unused
849 def warn_pragma_unused_expected_var : Warning<
850   "expected '#pragma unused' argument to be a variable name">,
851   InGroup<IgnoredPragmas>;
852 // - #pragma init_seg
853 def warn_pragma_init_seg_unsupported_target : Warning<
854   "'#pragma init_seg' is only supported when targeting a "
855   "Microsoft environment">,
856   InGroup<IgnoredPragmas>;
857 // - #pragma fp_contract
858 def err_pragma_fp_contract_scope : Error<
859   "'#pragma fp_contract' can only appear at file scope or at the start of a "
860   "compound statement">; 
861 // - #pragma comment
862 def err_pragma_comment_malformed : Error<
863   "pragma comment requires parenthesized identifier and optional string">;
864 def err_pragma_comment_unknown_kind : Error<"unknown kind of pragma comment">;
865 // - #pragma detect_mismatch
866 def err_pragma_detect_mismatch_malformed : Error<
867   "pragma detect_mismatch is malformed; it requires two comma-separated "
868   "string literals">;
869 // - #pragma pointers_to_members
870 def err_pragma_pointers_to_members_unknown_kind : Error<
871   "unexpected %0, expected to see one of %select{|'best_case', 'full_generality', }1"
872   "'single_inheritance', 'multiple_inheritance', or 'virtual_inheritance'">;
873 // - #pragma clang optimize on/off
874 def err_pragma_optimize_invalid_argument : Error<
875   "unexpected argument '%0' to '#pragma clang optimize'; "
876   "expected 'on' or 'off'">;
877 def err_pragma_optimize_extra_argument : Error<
878   "unexpected extra argument '%0' to '#pragma clang optimize'">;
879
880 // OpenCL Section 6.8.g
881 def err_not_opencl_storage_class_specifier : Error<
882   "OpenCL does not support the '%0' storage class specifier">;
883
884 // OpenCL EXTENSION pragma (OpenCL 1.1 [9.1])
885 def warn_pragma_expected_colon : Warning<
886   "missing ':' after %0 - ignoring">, InGroup<IgnoredPragmas>;
887 def warn_pragma_expected_enable_disable : Warning<
888   "expected 'enable' or 'disable' - ignoring">, InGroup<IgnoredPragmas>;
889 def warn_pragma_unknown_extension : Warning<
890   "unknown OpenCL extension %0 - ignoring">, InGroup<IgnoredPragmas>;
891
892 def err_seh_expected_handler : Error<
893   "expected '__except' or '__finally' block">;
894
895 def err_seh___except_block : Error<
896   "%0 only allowed in __except block">;
897
898 def err_seh___except_filter : Error<
899   "%0 only allowed in __except filter expression">;
900
901 def err_seh___finally_block : Error<
902   "%0 only allowed in __finally block">;
903
904 // OpenMP support.
905 def warn_pragma_omp_ignored : Warning<
906   "unexpected '#pragma omp ...' in program">, InGroup<SourceUsesOpenMP>, DefaultIgnore;
907 def warn_omp_extra_tokens_at_eol : Warning<
908   "extra tokens at the end of '#pragma omp %0' are ignored">,
909   InGroup<ExtraTokens>;
910 def err_omp_unknown_directive : Error<
911   "expected an OpenMP directive">;
912 def err_omp_unexpected_directive : Error<
913   "unexpected OpenMP directive '#pragma omp %0'">;
914 def err_omp_expected_punc : Error<
915   "expected ',' or ')' in '%0' %select{clause|directive}1">;
916 def err_omp_unexpected_clause : Error<
917   "unexpected OpenMP clause '%0' in directive '#pragma omp %1'">;
918 def err_omp_more_one_clause : Error<
919   "directive '#pragma omp %0' cannot contain more than one '%1' clause">;
920 def err_omp_immediate_directive : Error<
921   "'#pragma omp %0' cannot be an immediate substatement">;
922 def err_omp_expected_identifier_for_critical : Error<
923   "expected identifier specifying the name of the 'omp critical' directive">;
924
925 // Pragma loop support.
926 def err_pragma_loop_invalid_option : Error<
927   "%select{invalid|missing}0 option%select{ %1|}0; expected vectorize, "
928   "vectorize_width, interleave, interleave_count, unroll, or unroll_count">;
929
930 // Pragma unroll support.
931 def warn_pragma_unroll_cuda_value_in_parens : Warning<
932   "argument to '#pragma unroll' should not be in parentheses in CUDA C/C++">,
933   InGroup<CudaCompat>;
934 } // end of Parse Issue category.
935
936 let CategoryName = "Modules Issue" in {
937 def err_module_expected_ident : Error<
938   "expected a module name after module import">;
939 def err_module_expected_semi : Error<
940   "expected ';' after module name">;
941 }
942
943 } // end of Parser diagnostics