]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - contrib/llvm/tools/clang/include/clang/Basic/DiagnosticParseKinds.td
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.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 }
27
28 let CategoryName = "Parse Issue" in {
29
30 def ext_empty_translation_unit : Extension<
31   "ISO C requires a translation unit to contain at least one declaration">,
32   InGroup<DiagGroup<"empty-translation-unit">>;
33 def warn_cxx98_compat_top_level_semi : Warning<
34   "extra ';' outside of a function is incompatible with C++98">,
35   InGroup<CXX98CompatPedantic>, DefaultIgnore;
36 def ext_extra_semi : Extension<
37   "extra ';' %select{"
38   "outside of a function|"
39   "inside a %1|"
40   "inside instance variable list|"
41   "after member function definition}0">,
42   InGroup<ExtraSemi>;
43 def ext_extra_semi_cxx11 : Extension<
44   "extra ';' outside of a function is a C++11 extension">,
45   InGroup<CXX11ExtraSemi>;
46 def warn_extra_semi_after_mem_fn_def : Warning<
47   "extra ';' after member function definition">,
48   InGroup<ExtraSemi>, DefaultIgnore;
49
50 def ext_duplicate_declspec : ExtWarn<"duplicate '%0' declaration specifier">,
51   InGroup<DuplicateDeclSpecifier>;
52 def warn_duplicate_declspec : Warning<"duplicate '%0' declaration specifier">,
53   InGroup<DuplicateDeclSpecifier>;
54 def ext_plain_complex : ExtWarn<
55   "plain '_Complex' requires a type specifier; assuming '_Complex double'">;
56 def ext_integer_complex : Extension<
57   "complex integer types are a GNU extension">, InGroup<GNU>;
58 def ext_thread_before : Extension<"'__thread' before '%0'">;
59
60 def ext_empty_struct_union : Extension<
61   "empty %select{struct|union}0 is a GNU extension">, InGroup<GNU>;
62 def warn_empty_struct_union_compat : Warning<"empty %select{struct|union}0 "
63   "has size 0 in C, size 1 in C++">, InGroup<CXXCompat>, DefaultIgnore;
64 def error_empty_enum : Error<"use of empty enum">;
65 def err_invalid_sign_spec : Error<"'%0' cannot be signed or unsigned">;
66 def err_invalid_short_spec : Error<"'short %0' is invalid">;
67 def err_invalid_long_spec : Error<"'long %0' is invalid">;
68 def err_invalid_longlong_spec : Error<"'long long %0' is invalid">;
69 def err_invalid_complex_spec : Error<"'_Complex %0' is invalid">;
70 def err_friend_storage_spec : Error<"'%0' is invalid in friend declarations">;
71
72 def ext_ident_list_in_param : Extension<
73   "type-less parameter names in function declaration">;
74 def ext_c99_variable_decl_in_for_loop : Extension<
75   "variable declaration in for loop is a C99-specific feature">, InGroup<C99>;
76 def ext_c99_compound_literal : Extension<
77   "compound literals are a C99-specific feature">, InGroup<C99>;
78 def ext_c99_flexible_array_member : Extension<
79   "Flexible array members 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<GNU>;
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<GNU>;
127 def ext_gnu_address_of_label : Extension<
128   "use of GNU address-of-label extension">, InGroup<GNU>;
129 def ext_gnu_local_label : Extension<
130   "use of GNU locally declared label extension">, InGroup<GNU>;
131 def ext_gnu_statement_expr : Extension<
132   "use of GNU statement expression extension">, InGroup<GNU>;
133 def ext_gnu_conditional_expr : Extension<
134   "use of GNU ?: expression extension, eliding middle term">, InGroup<GNU>;
135 def ext_gnu_empty_initializer : Extension<
136   "use of GNU empty initializer extension">, InGroup<GNU>;
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<GNU>;
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_ident : Error<"expected identifier">;
155 def err_expected_ident_lparen : Error<"expected identifier or '('">;
156 def err_expected_ident_lbrace : Error<"expected identifier or '{'">;
157 def err_expected_lbrace : Error<"expected '{'">;
158 def err_expected_lparen : Error<"expected '('">;
159 def err_expected_lparen_or_lbrace : Error<"expected '('or '{'">;
160 def err_expected_rparen : Error<"expected ')'">;
161 def err_expected_lsquare : Error<"expected '['">;
162 def err_expected_rsquare : Error<"expected ']'">;
163 def err_expected_rbrace : Error<"expected '}'">;
164 def err_expected_greater : Error<"expected '>'">;
165 def err_expected_ggg : Error<"expected '>>>'">;
166 def err_expected_semi_declaration : Error<
167   "expected ';' at end of declaration">;
168 def err_expected_semi_decl_list : Error<
169   "expected ';' at end of declaration list">;
170 def ext_expected_semi_decl_list : ExtWarn<
171   "expected ';' at end of declaration list">;
172 def err_expected_member_name_or_semi : Error<
173   "expected member name or ';' after declaration specifiers">;
174 def err_function_declared_typedef : Error<
175   "function definition declared 'typedef'">;
176 def err_iboutletcollection_builtintype : Error<
177   "type argument of iboutletcollection attribute cannot be a builtin type">;
178 def err_iboutletcollection_with_protocol : Error<
179   "invalid argument of iboutletcollection attribute">;
180 def err_at_defs_cxx : Error<"@defs is not supported in Objective-C++">;
181 def err_at_in_class : Error<"unexpected '@' in member specification">;
182
183 def err_expected_fn_body : Error<
184   "expected function body after function declarator">;
185 def warn_attribute_on_function_definition : Warning<
186   "GCC does not allow %0 attribute in this position on a function definition">, 
187   InGroup<GccCompat>;
188 def warn_attribute_no_decl : Warning<
189   "attribute %0 ignored, because it is not attached to a declaration">, 
190   InGroup<IgnoredAttributes>;
191 def err_expected_method_body : Error<"expected method body">;
192 def err_invalid_token_after_toplevel_declarator : Error<
193   "expected ';' after top level declarator">;
194 def err_invalid_token_after_declarator_suggest_equal : Error<
195   "invalid '%0' at end of declaration; did you mean '='?">;
196 def err_expected_statement : Error<"expected statement">;
197 def err_expected_lparen_after : Error<"expected '(' after '%0'">;
198 def err_expected_lparen_after_id : Error<"expected '(' after %0">;
199 def err_expected_less_after : Error<"expected '<' after '%0'">;
200 def err_expected_equal_after : Error<"expected '=' after %0">;
201 def err_expected_comma : Error<"expected ','">;
202 def err_expected_lbrace_in_compound_literal : Error<
203   "expected '{' in compound literal">;
204 def err_expected_while : Error<"expected 'while' in do/while loop">;
205
206 def err_expected_semi_after : Error<"expected ';' after %0">;
207 def err_expected_semi_after_stmt : Error<"expected ';' after %0 statement">;
208 def err_expected_semi_after_expr : Error<"expected ';' after expression">;
209 def err_extraneous_token_before_semi : Error<"extraneous '%0' before ';'">;
210
211 def err_expected_semi_after_method_proto : Error<
212   "expected ';' after method prototype">;
213 def err_expected_semi_after_namespace_name : Error<
214   "expected ';' after namespace name">;
215 def err_unexpected_namespace_attributes_alias : Error<
216   "attributes can not be specified on namespace alias">;
217 def err_inline_namespace_alias : Error<"namespace alias cannot be inline">;
218 def err_namespace_nonnamespace_scope : Error<
219   "namespaces can only be defined in global or namespace scope">;
220 def err_nested_namespaces_with_double_colon : Error<
221   "nested namespace definition must define each namespace separately">;
222 def err_expected_semi_after_attribute_list : Error<
223   "expected ';' after attribute list">;
224 def err_expected_semi_after_static_assert : Error<
225   "expected ';' after static_assert">;
226 def err_expected_semi_for : Error<"expected ';' in 'for' statement specifier">;
227 def err_expected_colon_after : Error<"expected ':' after %0">;
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
249 def err_invalid_reference_qualifier_application : Error<
250   "'%0' qualifier may not be applied to a reference">;
251 def err_illegal_decl_reference_to_reference : Error<
252   "%0 declared as a reference to a reference">;
253 def ext_rvalue_reference : ExtWarn<
254   "rvalue references are a C++11 extension">, InGroup<CXX11>;
255 def warn_cxx98_compat_rvalue_reference : Warning<
256   "rvalue references are incompatible with C++98">,
257   InGroup<CXX98Compat>, DefaultIgnore;
258 def ext_ref_qualifier : ExtWarn<
259   "reference qualifiers on functions are a C++11 extension">, InGroup<CXX11>;
260 def warn_cxx98_compat_ref_qualifier : Warning<
261   "reference qualifiers on functions are incompatible with C++98">,
262   InGroup<CXX98Compat>, DefaultIgnore;
263 def ext_inline_namespace : ExtWarn<
264   "inline namespaces are a C++11 feature">, InGroup<CXX11>;
265 def warn_cxx98_compat_inline_namespace : Warning<
266   "inline namespaces are incompatible with C++98">,
267   InGroup<CXX98Compat>, DefaultIgnore;
268 def ext_generalized_initializer_lists : ExtWarn<
269   "generalized initializer lists are a C++11 extension">,
270   InGroup<CXX11>;
271 def warn_cxx98_compat_generalized_initializer_lists : Warning<
272   "generalized initializer lists are incompatible with C++98">,
273   InGroup<CXX98Compat>, DefaultIgnore;
274 def err_init_list_bin_op : Error<"initializer list cannot be used on the "
275   "%select{left|right}0 hand side of operator '%1'">;
276 def warn_cxx98_compat_trailing_return_type : Warning<
277   "trailing return types are incompatible with C++98">,
278   InGroup<CXX98Compat>, DefaultIgnore;
279 def ext_auto_type_specifier : ExtWarn<
280   "'auto' type specifier is a C++11 extension">, InGroup<CXX11>;
281 def warn_auto_storage_class : Warning<
282   "'auto' storage class specifier is redundant and incompatible with C++11">,
283   InGroup<CXX11Compat>, DefaultIgnore;
284 def ext_auto_storage_class : ExtWarn<
285   "'auto' storage class specifier is not permitted in C++11, and will not "
286   "be supported in future releases">, InGroup<DiagGroup<"auto-storage-class">>;
287 def ext_decltype_auto_type_specifier : ExtWarn<
288   "'decltype(auto)' type specifier is a C++1y extension">, InGroup<CXX1y>;
289 def warn_cxx11_compat_decltype_auto_type_specifier : Warning<
290   "'decltype(auto)' type specifier is incompatible with C++ standards before "
291   "C++1y">, InGroup<CXXPre1yCompat>, DefaultIgnore;
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_expected_decl : Error<
298   "for range declaration must declare a variable">;
299 def err_argument_required_after_attribute : Error<
300   "argument required after attribute">;
301 def err_missing_param : Error<"expected parameter declarator">;
302 def err_missing_comma_before_ellipsis : Error<
303   "C requires a comma prior to the ellipsis in a variadic function type">;
304 def err_unexpected_typedef_ident : Error<
305   "unexpected type name %0: expected identifier">;
306 def warn_cxx98_compat_decltype : Warning<
307   "'decltype' type specifier is incompatible with C++98">,
308   InGroup<CXX98Compat>, DefaultIgnore;
309 def err_unexpected_scope_on_base_decltype : Error<
310   "unexpected namespace scope prior to decltype">;
311 def err_expected_class_name : Error<"expected class name">;
312 def err_expected_class_name_not_template : 
313   Error<"'typename' is redundant; base classes are implicitly types">;
314 def err_unspecified_vla_size_with_static : Error<
315   "'static' may not be used with an unspecified variable length array size">;
316
317 def err_expected_case_before_expression: Error<
318   "expected 'case' keyword before expression">;
319
320 // Declarations.
321 def err_typename_requires_specqual : Error<
322   "type name requires a specifier or qualifier">;
323 def err_typename_invalid_storageclass : Error<
324   "type name does not allow storage class to be specified">;
325 def err_typename_invalid_functionspec : Error<
326   "type name does not allow function specifier to be specified">;
327 def err_typename_invalid_constexpr : Error<
328   "type name does not allow constexpr specifier to be specified">;
329 def err_typename_identifiers_only : Error<
330   "typename is allowed for identifiers only">;
331
332 def err_invalid_decl_spec_combination : Error<
333   "cannot combine with previous '%0' declaration specifier">;
334 def err_invalid_vector_decl_spec_combination : Error<
335   "cannot combine with previous '%0' declaration specifier. "
336   "'__vector' must be first">;
337 def err_invalid_pixel_decl_spec_combination : Error<
338   "'__pixel' must be preceded by '__vector'.  "
339   "'%0' declaration specifier not allowed here">;
340 def err_invalid_vector_decl_spec : Error<
341   "cannot use '%0' with '__vector'">;
342 def err_invalid_vector_bool_decl_spec : Error<
343   "cannot use '%0' with '__vector bool'">;
344 def warn_vector_long_decl_spec_combination : Warning<
345   "Use of 'long' with '__vector' is deprecated">, InGroup<Deprecated>;
346 def err_friend_invalid_in_context : Error<
347   "'friend' used outside of class">;
348 def err_unknown_typename : Error<
349   "unknown type name %0">;
350 def err_use_of_tag_name_without_tag : Error<
351   "must use '%1' tag to refer to type %0%select{| in this scope}2">;
352 def err_templated_using_directive : Error<
353   "cannot template a using directive">;
354 def err_templated_using_declaration : Error<
355   "cannot template a using declaration">;
356 def err_unexected_colon_in_nested_name_spec : Error<
357   "unexpected ':' in nested name specifier; did you mean '::'?">;
358 def err_bool_redeclaration : Error<
359   "redeclaration of C++ built-in type 'bool'">;
360 def ext_c11_static_assert : Extension<
361   "_Static_assert is a C11-specific feature">, InGroup<C11>;
362 def warn_cxx98_compat_static_assert : Warning<
363   "static_assert declarations are incompatible with C++98">,
364   InGroup<CXX98Compat>, DefaultIgnore;
365 def err_paren_after_colon_colon : Error<
366   "unexpected parenthesis after '::'">;
367 def err_function_definition_not_allowed : Error<
368   "function definition is not allowed here">;
369
370 /// Objective-C parser diagnostics
371 def err_expected_minus_or_plus : Error<
372   "method type specifier must start with '-' or '+'">;
373 def err_objc_no_attributes_on_category : Error<
374   "attributes may not be specified on a category">;
375 def err_objc_missing_end : Error<"missing '@end'">;
376 def note_objc_container_start : Note<
377   "%select{class|protocol|category|class extension|implementation"
378   "|category implementation}0 started here">;
379 def warn_objc_protocol_qualifier_missing_id : Warning<
380   "protocol has no object type specified; defaults to qualified 'id'">;
381 def err_objc_unknown_at : Error<"expected an Objective-C directive after '@'">;
382 def err_illegal_super_cast : Error<
383   "cannot cast 'super' (it isn't an expression)">;
384 def err_nsnumber_nonliteral_unary : Error<
385   "@%0 must be followed by a number to form an NSNumber object">;
386 def warn_cstyle_param : Warning<
387   "use of C-style parameters in Objective-C method declarations"
388   " is deprecated">, InGroup<DeprecatedDeclarations>;
389
390 let CategoryName = "ARC Parse Issue" in {
391 def err_arc_bridge_retain : Error<
392   "unknown cast annotation __bridge_retain; did you mean __bridge_retained?">;
393 // To be default mapped to an error later.
394 def warn_arc_bridge_cast_nonarc : Warning<
395   "'%0' casts have no effect when not using ARC">,
396   InGroup<DiagGroup<"arc-bridge-casts-disallowed-in-nonarc">>;
397 }
398   
399 def err_objc_illegal_visibility_spec : Error<
400   "illegal visibility specification">;
401 def err_objc_illegal_interface_qual : Error<"illegal interface qualifier">;
402 def err_objc_expected_equal_for_getter : Error<
403   "expected '=' for Objective-C getter">;
404 def err_objc_expected_equal_for_setter : Error<
405   "expected '=' for Objective-C setter">;
406 def err_objc_expected_selector_for_getter_setter : Error<
407   "expected selector for Objective-C %select{setter|getter}0">;
408 def err_objc_property_requires_field_name : Error<
409   "property requires fields to be named">;
410 def err_objc_property_bitfield : Error<"property name cannot be a bitfield">;
411 def err_objc_expected_property_attr : Error<"unknown property attribute %0">;
412 def err_objc_properties_require_objc2 : Error<
413   "properties are an Objective-C 2 feature">;
414 def err_objc_unexpected_attr : Error<
415   "prefix attribute must be followed by an interface or protocol">;
416 def err_objc_postfix_attribute : Error <
417   "postfix attributes are not allowed on Objective-C directives">;
418 def err_objc_postfix_attribute_hint : Error <
419   "postfix attributes are not allowed on Objective-C directives, place"
420   " them in front of '%select{@interface|@protocol}0'">;
421 def err_objc_directive_only_in_protocol : Error<
422   "directive may only be specified in protocols only">;
423 def err_missing_catch_finally : Error<
424   "@try statement without a @catch and @finally clause">;
425 def err_objc_concat_string : Error<"unexpected token after Objective-C string">;
426 def err_expected_objc_container : Error<
427   "'@end' must appear in an Objective-C context">;
428 def err_unexpected_protocol_qualifier : Error<
429   "@implementation declaration can not be protocol qualified">;
430 def err_objc_unexpected_atend : Error<
431   "'@end' appears where closing brace '}' is expected">;
432 def error_property_ivar_decl : Error<
433   "property synthesize requires specification of an ivar">;
434 def err_synthesized_property_name : Error<
435   "expected a property name in @synthesize">;
436 def warn_semicolon_before_method_body : Warning<
437   "semicolon before method body is ignored">,
438   InGroup<DiagGroup<"semicolon-before-method-body">>, DefaultIgnore;
439 def note_extra_comma_message_arg : Note<
440   "comma separating Objective-C messaging arguments">;
441
442 def err_expected_field_designator : Error<
443   "expected a field designator, such as '.field = 4'">;
444
445 def err_declaration_does_not_declare_param : Error<
446   "declaration does not declare a parameter">;
447 def err_no_matching_param : Error<"parameter named %0 is missing">;
448
449 /// C++ parser diagnostics
450 def err_invalid_operator_on_type : Error<
451   "cannot use %select{dot|arrow}0 operator on a type">;
452 def err_expected_unqualified_id : Error<
453   "expected %select{identifier|unqualified-id}0">;
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 ext_ellipsis_exception_spec : Extension<
472   "exception specification of '...' is a Microsoft extension">,
473   InGroup<Microsoft>;
474 def err_dynamic_and_noexcept_specification : Error<
475   "cannot have both throw() and noexcept() clause on the same function">;
476 def warn_cxx98_compat_noexcept_decl : Warning<
477   "noexcept specifications are incompatible with C++98">,
478   InGroup<CXX98Compat>, DefaultIgnore;
479 def err_expected_catch : Error<"expected catch">;
480 def err_expected_lbrace_or_comma : Error<"expected '{' or ','">;
481 def err_expected_rbrace_or_comma : Error<"expected '}' or ','">;
482 def err_expected_rsquare_or_comma : Error<"expected ']' or ','">;
483 def err_using_namespace_in_class : Error<
484   "'using namespace' is not allowed in classes">;
485 def err_destructor_tilde_identifier : Error<
486   "expected a class name after '~' to name a destructor">;
487 def err_destructor_template_id : Error<
488   "destructor name %0 does not refer to a template">;
489 def err_default_arg_unparsed : Error<
490   "unexpected end of default argument expression">;
491 def err_bracket_depth_exceeded : Error<
492   "bracket nesting level exceeded maximum of %0">, DefaultFatal;
493 def note_bracket_depth : Note<
494   "use -fbracket-depth=N to increase maximum nesting level">;
495 def err_misplaced_ellipsis_in_declaration : Error<
496   "'...' must %select{immediately precede declared identifier|"
497   "be innermost component of anonymous pack declaration}0">;
498 def ext_abstract_pack_declarator_parens : ExtWarn<
499   "ISO C++11 requires a parenthesized pack declaration to have a name">,
500   InGroup<DiagGroup<"anonymous-pack-parens">>;
501
502 // C++ derived classes
503 def err_dup_virtual : Error<"duplicate 'virtual' in base specifier">;
504
505 // C++ operator overloading
506 def err_literal_operator_string_prefix : Error<
507   "string literal after 'operator' cannot have an encoding prefix">;
508 def err_literal_operator_string_not_empty : Error<
509   "string literal after 'operator' must be '\"\"'">;
510 def warn_cxx98_compat_literal_operator : Warning<
511   "literal operators are incompatible with C++98">,
512   InGroup<CXX98Compat>, DefaultIgnore;
513
514 // Classes.
515 def err_anon_type_definition : Error<
516   "declaration of anonymous %0 must be a definition">;
517 def err_default_delete_in_multiple_declaration : Error<
518   "'= %select{default|delete}0' is a function definition and must occur in a "
519   "standalone declaration">;
520
521 def warn_cxx98_compat_noexcept_expr : Warning<
522   "noexcept expressions are incompatible with C++98">,
523   InGroup<CXX98Compat>, DefaultIgnore;
524 def warn_cxx98_compat_nullptr : Warning<
525   "'nullptr' is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
526
527 def warn_cxx98_compat_alignas : Warning<"'alignas' is incompatible with C++98">,
528   InGroup<CXX98Compat>, DefaultIgnore;
529 def warn_cxx98_compat_attribute : Warning<
530   "attributes are incompatible with C++98">,
531   InGroup<CXX98Compat>, DefaultIgnore;
532 def err_cxx11_attribute_forbids_arguments : Error<
533   "attribute '%0' cannot have an argument list">;
534 def err_cxx11_attribute_forbids_ellipsis : Error<
535   "attribute '%0' cannot be used as an attribute pack">;
536 def err_cxx11_attribute_repeated : Error<
537   "attribute %0 cannot appear multiple times in an attribute specifier">;
538 def err_attributes_not_allowed : Error<"an attribute list cannot appear here">;
539 def err_l_square_l_square_not_attribute : Error<
540   "C++11 only allows consecutive left square brackets when "
541   "introducing an attribute">;
542 def err_ms_declspec_type : Error<
543   "__declspec attributes must be an identifier or string literal">;
544 def warn_ms_declspec_unknown : Warning<
545   "unknown __declspec attribute %0 ignored">, InGroup<UnknownAttributes>;
546 def err_ms_property_no_getter_or_putter : Error<
547   "property does not specify a getter or a putter">;
548 def err_ms_property_unknown_accessor : Error<
549   "expected 'get' or 'put' in property declaration">;
550 def err_ms_property_has_set_accessor : Error<
551   "putter for property must be specified as 'put', not 'set'">;
552 def err_ms_property_missing_accessor_kind : Error<
553   "missing 'get=' or 'put='">;
554 def err_ms_property_expected_equal : Error<
555   "expected '=' after '%0'">;
556 def err_ms_property_duplicate_accessor : Error<
557   "property declaration specifies '%0' accessor twice">;
558 def err_ms_property_expected_accessor_name : Error<
559   "expected name of accessor method">;
560 def err_ms_property_expected_comma_or_rparen : Error<
561   "expected ',' or ')' at end of property accessor list">;
562
563 /// C++ Templates
564 def err_expected_template : Error<"expected template">;
565 def err_unknown_template_name : Error<
566   "unknown template name %0">;
567 def err_expected_comma_greater : Error<
568   "expected ',' or '>' in template-parameter-list">;
569 def err_class_on_template_template_param : Error<
570   "template template parameter requires 'class' after the parameter list">;
571 def err_template_spec_syntax_non_template : Error<
572   "identifier followed by '<' indicates a class template specialization but "
573   "%0 %select{does not refer to a template|refers to a function "
574   "template|<unused>|refers to a template template parameter}1">;
575 def err_id_after_template_in_nested_name_spec : Error<
576   "expected template name after 'template' keyword in nested name specifier">;
577 def err_two_right_angle_brackets_need_space : Error<
578   "a space is required between consecutive right angle brackets (use '> >')">;
579 def err_right_angle_bracket_equal_needs_space : Error<
580   "a space is required between a right angle bracket and an equals sign "
581   "(use '> =')">;
582 def warn_cxx0x_right_shift_in_template_arg : Warning<
583   "use of right-shift operator ('>>') in template argument will require "
584   "parentheses in C++11">, InGroup<CXX11Compat>;
585 def warn_cxx98_compat_two_right_angle_brackets : Warning<
586   "consecutive right angle brackets are incompatible with C++98 (use '> >')">,
587   InGroup<CXX98Compat>, DefaultIgnore;
588 def err_multiple_template_declarators : Error<
589     "%select{|a template declaration|an explicit template specialization|"
590     "an explicit template instantiation}0 can "
591     "only %select{|declare|declare|instantiate}0 a single entity">;
592 def err_explicit_instantiation_with_definition : Error<
593     "explicit template instantiation cannot have a definition; if this "
594     "definition is meant to be an explicit specialization, add '<>' after the "
595     "'template' keyword">;
596 def err_explicit_instantiation_enum : Error<
597     "enumerations cannot be explicitly instantiated">;
598 def err_expected_template_parameter : Error<"expected template parameter">;
599
600 def err_missing_dependent_template_keyword : Error<
601   "use 'template' keyword to treat '%0' as a dependent template name">;
602 def warn_missing_dependent_template_keyword : ExtWarn<
603   "use 'template' keyword to treat '%0' as a dependent template name">;
604
605 def ext_extern_template : Extension<
606   "extern templates are a C++11 extension">, InGroup<CXX11>;
607 def warn_cxx98_compat_extern_template : Warning<
608   "extern templates are incompatible with C++98">,
609   InGroup<CXX98CompatPedantic>, DefaultIgnore;
610 def warn_static_inline_explicit_inst_ignored : Warning<
611   "ignoring '%select{static|inline}0' keyword on explicit template "
612   "instantiation">;
613   
614 // Constructor template diagnostics.
615 def err_out_of_line_constructor_template_id : Error<
616   "out-of-line constructor for %0 cannot have template arguments">;
617 def err_out_of_line_template_id_names_constructor : Error<
618   "qualified reference to %0 is a constructor name rather than a "
619   "template name wherever a constructor can be declared">;
620 def err_out_of_line_type_names_constructor : Error<
621   "qualified reference to %0 is a constructor name rather than a "
622   "type wherever a constructor can be declared">;
623
624 def err_expected_qualified_after_typename : Error<
625   "expected a qualified name after 'typename'">;
626 def warn_expected_qualified_after_typename : ExtWarn<
627   "expected a qualified name after 'typename'">;
628 def err_expected_semi_after_tagdecl : Error<
629   "expected ';' after %0">;
630
631 def err_typename_refers_to_non_type_template : Error<
632   "typename specifier refers to a non-template">;
633 def err_expected_type_name_after_typename : Error<
634   "expected an identifier or template-id after '::'">;
635 def err_explicit_spec_non_template : Error<
636   "explicit %select{specialization|instantiation}0 of non-template "
637   "%select{class|struct|union|interface}1 %2">;
638   
639 def err_default_template_template_parameter_not_template : Error<
640   "default template argument for a template template parameter must be a class "
641   "template">;
642   
643 def err_ctor_init_missing_comma : Error<
644   "missing ',' between base or member initializers">;
645
646 // C++ declarations
647 def err_friend_decl_defines_type : Error<
648   "cannot define a type in a friend declaration">;
649 def err_missing_whitespace_digraph : Error<
650   "found '<::' after a "
651   "%select{template name|const_cast|dynamic_cast|reinterpret_cast|static_cast}0"
652   " which forms the digraph '<:' (aka '[') and a ':', did you mean '< ::'?">;
653
654 def ext_deleted_function : ExtWarn<
655   "deleted function definitions are a C++11 extension">, InGroup<CXX11>;
656 def warn_cxx98_compat_deleted_function : Warning<
657   "deleted function definitions are incompatible with C++98">,
658   InGroup<CXX98Compat>, DefaultIgnore;
659 def ext_defaulted_function : ExtWarn<
660   "defaulted function definitions are a C++11 extension">, InGroup<CXX11>;
661 def warn_cxx98_compat_defaulted_function : Warning<
662   "defaulted function definitions are incompatible with C++98">,
663   InGroup<CXX98Compat>, DefaultIgnore;
664
665 // C++11 in-class member initialization
666 def ext_nonstatic_member_init : ExtWarn<
667   "in-class initialization of non-static data member is a C++11 extension">,
668   InGroup<CXX11>;
669 def warn_cxx98_compat_nonstatic_member_init : Warning<
670   "in-class initialization of non-static data members is incompatible with C++98">,
671   InGroup<CXX98Compat>, DefaultIgnore;
672 def err_bitfield_member_init: Error<
673   "bitfield member cannot have an in-class initializer">;
674 def err_incomplete_array_member_init: Error<
675   "array bound cannot be deduced from an in-class initializer">;
676
677 // C++11 alias-declaration
678 def ext_alias_declaration : ExtWarn<
679   "alias declarations are a C++11 extension">, InGroup<CXX11>;
680 def warn_cxx98_compat_alias_declaration : Warning<
681   "alias declarations are incompatible with C++98">,
682   InGroup<CXX98Compat>, DefaultIgnore;
683 def err_alias_declaration_not_identifier : Error<
684   "name defined in alias declaration must be an identifier">;
685 def err_alias_declaration_specialization : Error<
686   "%select{partial specialization|explicit specialization|explicit instantiation}0 of alias templates is not permitted">;
687     
688 // C++11 override control
689 def ext_override_control_keyword : ExtWarn<
690   "'%0' keyword is a C++11 extension">, InGroup<CXX11>;
691 def warn_cxx98_compat_override_control_keyword : Warning<
692   "'%0' keyword is incompatible with C++98">,
693   InGroup<CXX98Compat>, DefaultIgnore;
694 def err_override_control_interface : Error<
695   "'%0' keyword not permitted with interface types">;
696
697 def err_access_specifier_interface : Error<
698   "interface types cannot specify '%select{private|protected}0' access">;
699
700 def err_duplicate_virt_specifier : Error<
701   "class member already marked '%0'">;
702
703 def err_scoped_enum_missing_identifier : Error<
704   "scoped enumeration requires a name">;
705 def ext_scoped_enum : ExtWarn<
706   "scoped enumerations are a C++11 extension">, InGroup<CXX11>;
707 def warn_cxx98_compat_scoped_enum : Warning<
708   "scoped enumerations are incompatible with C++98">,
709   InGroup<CXX98Compat>, DefaultIgnore;
710
711 def err_expected_parameter_pack : Error<
712   "expected the name of a parameter pack">;
713 def err_paren_sizeof_parameter_pack : Error<
714   "missing parentheses around the size of parameter pack %0">;
715 def err_sizeof_parameter_pack : Error<
716   "expected parenthesized parameter pack name in 'sizeof...' expression">;
717
718 // C++11 lambda expressions
719 def err_expected_comma_or_rsquare : Error<
720   "expected ',' or ']' in lambda capture list">;
721 def err_this_captured_by_reference : Error<
722   "'this' cannot be captured by reference">;
723 def err_expected_capture : Error<
724   "expected variable name or 'this' in lambda capture list">;
725 def err_expected_lambda_body : Error<"expected body of lambda expression">;
726 def warn_cxx98_compat_lambda : Warning<
727   "lambda expressions are incompatible with C++98">,
728   InGroup<CXX98Compat>, DefaultIgnore;
729 def err_lambda_missing_parens : Error<
730   "lambda requires '()' before %select{'mutable'|return type}0">;
731
732 // Availability attribute
733 def err_expected_version : Error<
734   "expected a version of the form 'major[.minor[.subminor]]'">;
735 def err_zero_version : Error<
736   "version number must have non-zero major, minor, or sub-minor version">;
737 def err_availability_expected_platform : Error<
738   "expected a platform name, e.g., 'macosx'">;
739 def err_availability_expected_change : Error<
740   "expected 'introduced', 'deprecated', or 'obsoleted'">;
741 def err_availability_unknown_change : Error<
742   "%0 is not an availability stage; use 'introduced', 'deprecated', or "
743   "'obsoleted'">;
744 def err_availability_redundant : Error<
745   "redundant %0 availability change; only the last specified change will "
746   "be used">;
747 def warn_availability_and_unavailable : Warning<
748   "'unavailable' availability overrides all other availability information">,
749   InGroup<Availability>;
750
751 // Type safety attributes
752 def err_type_safety_unknown_flag : Error<
753   "invalid comparison flag %0; use 'layout_compatible' or 'must_be_null'">;
754
755 // Language specific pragmas
756 // - Generic warnings
757 def warn_pragma_expected_lparen : Warning<
758   "missing '(' after '#pragma %0' - ignoring">;
759 def warn_pragma_expected_rparen : Warning<
760   "missing ')' after '#pragma %0' - ignoring">;
761 def warn_pragma_expected_identifier : Warning<
762   "expected identifier in '#pragma %0' - ignored">;  
763 def warn_pragma_ms_struct : Warning<
764   "incorrect use of '#pragma ms_struct on|off' - ignored">;  
765 def warn_pragma_extra_tokens_at_eol : Warning<
766   "extra tokens at end of '#pragma %0' - ignored">; 
767 // - #pragma options
768 def warn_pragma_options_expected_align : Warning<
769   "expected 'align' following '#pragma options' - ignored">;
770 def warn_pragma_align_expected_equal : Warning<
771   "expected '=' following '#pragma %select{align|options align}0' - ignored">;
772 def warn_pragma_align_invalid_option : Warning<
773   "invalid alignment option in '#pragma %select{align|options align}0' - ignored">;
774 // - #pragma pack
775 def warn_pragma_pack_invalid_action : Warning<
776   "unknown action for '#pragma pack' - ignored">;
777 def warn_pragma_pack_malformed : Warning<
778   "expected integer or identifier in '#pragma pack' - ignored">;
779 // - #pragma unused
780 def warn_pragma_unused_expected_var : Warning<
781   "expected '#pragma unused' argument to be a variable name">;
782 def warn_pragma_unused_expected_punc : Warning<
783   "expected ')' or ',' in '#pragma unused'">;
784 // - #pragma fp_contract
785 def err_pragma_fp_contract_scope : Error<
786   "'#pragma fp_contract' should only appear at file scope or at the start of a "
787   "compound expression">; 
788 // - #pragma comment
789 def err_pragma_comment_malformed : Error<
790   "pragma comment requires parenthesized identifier and optional string">;
791 def err_pragma_comment_unknown_kind : Error<"unknown kind of pragma comment">;
792
793
794 // OpenCL Section 6.8.g
795 def err_not_opencl_storage_class_specifier : Error<
796   "OpenCL does not support the '%0' storage class specifier">;
797
798 // OpenCL EXTENSION pragma (OpenCL 1.1 [9.1])
799 def warn_pragma_expected_colon : Warning<
800   "missing ':' after %0 - ignoring">;
801 def warn_pragma_expected_enable_disable : Warning<
802   "expected 'enable' or 'disable' - ignoring">;
803 def warn_pragma_unknown_extension : Warning<
804   "unknown OpenCL extension %0 - ignoring">;
805
806 def err_seh_expected_handler : Error<
807   "expected '__except' or '__finally' block">;
808
809 def err_seh___except_block : Error<
810   "%0 only allowed in __except block">;
811
812 def err_seh___except_filter : Error<
813   "%0 only allowed in __except filter expression">;
814
815 def err_seh___finally_block : Error<
816   "%0 only allowed in __finally block">;
817
818 // OpenMP support.
819 def warn_pragma_omp_ignored : Warning <
820   "unexpected '#pragma omp ...' in program">, InGroup<SourceUsesOpenMP>, DefaultIgnore;
821 def warn_omp_extra_tokens_at_eol : Warning <
822   "extra tokens at end of '#pragma omp %0' are ignored">,
823   InGroup<ExtraTokens>;
824 def err_omp_unknown_directive : Error <
825   "expected an OpenMP directive">;
826 def err_omp_unexpected_directive : Error <
827   "unexpected OpenMP directive '#pragma omp %0'">;
828
829 } // end of Parse Issue category.
830
831 let CategoryName = "Modules Issue" in {
832 def err_module_expected_ident : Error<
833   "expected a module name after module import">;
834 def err_module_expected_semi : Error<
835   "expected ';' after module name">;
836 }
837
838 } // end of Parser diagnostics