]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/blob - contrib/llvm/tools/clang/include/clang/Basic/DiagnosticParseKinds.td
MFC r234353:
[FreeBSD/stable/9.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 = "Parse Issue" in {
22
23 def ext_empty_source_file : Extension<"ISO C forbids an empty source file">;
24 def ext_top_level_semi : Extension<
25   "extra ';' outside of a function">;
26 def warn_cxx98_compat_top_level_semi : Warning<
27   "extra ';' outside of a function is incompatible with C++98">,
28   InGroup<CXX98CompatPedantic>, DefaultIgnore;
29 def ext_extra_struct_semi : Extension<
30   "extra ';' inside a %0">;
31 def ext_extra_ivar_semi : Extension<
32   "extra ';' inside instance variable list">;
33
34 def ext_duplicate_declspec : Extension<"duplicate '%0' declaration specifier">;
35 def ext_plain_complex : ExtWarn<
36   "plain '_Complex' requires a type specifier; assuming '_Complex double'">;
37 def ext_integer_complex : Extension<
38   "complex integer types are an extension">;
39 def ext_thread_before : Extension<"'__thread' before 'static'">;
40
41 def ext_empty_struct_union : Extension<
42   "empty %select{struct|union}0 is a GNU extension">, InGroup<GNU>;
43 def warn_empty_struct_union_compat : Warning<"empty %select{struct|union}0 "
44   "has size 0 in C, size 1 in C++">, InGroup<CXXCompat>, DefaultIgnore;
45 def error_empty_enum : Error<"use of empty enum">;
46 def err_invalid_sign_spec : Error<"'%0' cannot be signed or unsigned">;
47 def err_invalid_short_spec : Error<"'short %0' is invalid">;
48 def err_invalid_long_spec : Error<"'long %0' is invalid">;
49 def err_invalid_longlong_spec : Error<"'long long %0' is invalid">;
50 def err_invalid_complex_spec : Error<"'_Complex %0' is invalid">;
51 def err_friend_storage_spec : Error<"'%0' is invalid in friend declarations">;
52
53 def ext_ident_list_in_param : Extension<
54   "type-less parameter names in function declaration">;
55 def ext_c99_variable_decl_in_for_loop : Extension<
56   "variable declaration in for loop is a C99-specific feature">, InGroup<C99>;
57 def ext_c99_compound_literal : Extension<
58   "compound literals are a C99-specific feature">, InGroup<C99>;
59 def ext_c99_flexible_array_member : Extension<
60   "Flexible array members are a C99-specific feature">, InGroup<C99>;
61 def ext_enumerator_list_comma : Extension<
62   "commas at the end of enumerator lists are a %select{C99|C++11}0-specific "
63   "feature">;
64 def warn_cxx98_compat_enumerator_list_comma : Warning<
65   "commas at the end of enumerator lists are incompatible with C++98">,
66   InGroup<CXX98CompatPedantic>, DefaultIgnore;
67 def err_enumerator_list_missing_comma : Error<
68   "missing ',' between enumerators">;
69 def err_enumerator_unnamed_no_def : Error<
70   "unnamed enumeration must be a definition">;
71 def ext_ms_enum_fixed_underlying_type : Extension<
72   "enumeration types with a fixed underlying type are a Microsoft extension">, 
73   InGroup<Microsoft>;
74 def warn_cxx98_compat_enum_fixed_underlying_type : Warning<
75   "enumeration types with a fixed underlying type are incompatible with C++98">,
76   InGroup<CXX98Compat>, DefaultIgnore;
77 def warn_cxx98_compat_alignof : Warning<
78   "alignof expressions are incompatible with C++98">,
79   InGroup<CXX98Compat>, DefaultIgnore;
80
81 def warn_microsoft_dependent_exists : Warning<
82   "dependent %select{__if_not_exists|__if_exists}0 declarations are ignored">, 
83   InGroup<DiagGroup<"microsoft-exists">>;
84
85 def ext_c11_generic_selection : Extension<
86   "generic selections are a C11-specific feature">, InGroup<C11>;
87 def err_duplicate_default_assoc : Error<
88   "duplicate default generic association">;
89 def note_previous_default_assoc : Note<
90   "previous default generic association is here">;
91
92 def ext_c11_alignas : Extension<
93   "_Alignas is a C11-specific feature">, InGroup<C11>;
94
95 def ext_gnu_indirect_goto : Extension<
96   "use of GNU indirect-goto extension">, InGroup<GNU>;
97 def ext_gnu_address_of_label : Extension<
98   "use of GNU address-of-label extension">, InGroup<GNU>;
99 def ext_gnu_local_label : Extension<
100   "use of GNU locally declared label extension">, InGroup<GNU>;
101 def ext_gnu_statement_expr : Extension<
102   "use of GNU statement expression extension">, InGroup<GNU>;
103 def ext_gnu_conditional_expr : Extension<
104   "use of GNU ?: expression extension, eliding middle term">, InGroup<GNU>;
105 def ext_gnu_empty_initializer : Extension<
106   "use of GNU empty initializer extension">, InGroup<GNU>;
107 def ext_gnu_array_range : Extension<"use of GNU array range extension">, 
108   InGroup<GNUDesignator>;
109 def ext_gnu_missing_equal_designator : ExtWarn<
110   "use of GNU 'missing =' extension in designator">, 
111   InGroup<GNUDesignator>;
112 def err_expected_equal_designator : Error<"expected '=' or another designator">;
113 def ext_gnu_old_style_field_designator : ExtWarn<
114   "use of GNU old-style field designator extension">, 
115   InGroup<GNUDesignator>;
116 def ext_gnu_case_range : Extension<"use of GNU case range extension">,
117   InGroup<GNU>;
118
119 // Generic errors.
120 def err_expected_expression : Error<"expected expression">;
121 def err_expected_type : Error<"expected a type">;
122 def err_expected_external_declaration : Error<"expected external declaration">;
123 def err_extraneous_closing_brace : Error<"extraneous closing brace ('}')">;
124 def err_expected_ident : Error<"expected identifier">;
125 def err_expected_ident_lparen : Error<"expected identifier or '('">;
126 def err_expected_ident_lbrace : Error<"expected identifier or '{'">;
127 def err_expected_lbrace : Error<"expected '{'">;
128 def err_expected_lparen : Error<"expected '('">;
129 def err_expected_lparen_or_lbrace : Error<"expected '('or '{'">;
130 def err_expected_rparen : Error<"expected ')'">;
131 def err_expected_lsquare : Error<"expected '['">;
132 def err_expected_rsquare : Error<"expected ']'">;
133 def err_expected_rbrace : Error<"expected '}'">;
134 def err_expected_greater : Error<"expected '>'">;
135 def err_expected_ggg : Error<"expected '>>>'">;
136 def err_expected_semi_declaration : Error<
137   "expected ';' at end of declaration">;
138 def err_expected_semi_decl_list : Error<
139   "expected ';' at end of declaration list">;
140 def ext_expected_semi_decl_list : ExtWarn<
141   "expected ';' at end of declaration list">;
142 def err_expected_member_name_or_semi : Error<
143   "expected member name or ';' after declaration specifiers">;
144 def err_function_declared_typedef : Error<
145   "function definition declared 'typedef'">;
146 def err_iboutletcollection_builtintype : Error<
147   "type argument of iboutletcollection attribute cannot be a builtin type">;
148 def err_iboutletcollection_with_protocol : Error<
149   "invalid argument of iboutletcollection attribute">;
150 def err_at_defs_cxx : Error<"@defs is not supported in Objective-C++">;
151 def err_at_in_class : Error<"unexpected '@' in member specification">;
152
153 def err_expected_fn_body : Error<
154   "expected function body after function declarator">;
155 def warn_attribute_on_function_definition : Warning<
156   "GCC does not allow %0 attribute in this position on a function definition">, 
157   InGroup<GccCompat>;
158 def warn_attribute_no_decl : Warning<
159   "attribute %0 ignored, because it is not attached to a declaration">, 
160   InGroup<IgnoredAttributes>;
161 def err_expected_method_body : Error<"expected method body">;
162 def err_invalid_token_after_toplevel_declarator : Error<
163   "expected ';' after top level declarator">;
164 def err_invalid_token_after_declarator_suggest_equal : Error<
165   "invalid '%0' at end of declaration; did you mean '='?">;
166 def err_expected_statement : Error<"expected statement">;
167 def err_expected_lparen_after : Error<"expected '(' after '%0'">;
168 def err_expected_lparen_after_id : Error<"expected '(' after %0">;
169 def err_expected_less_after : Error<"expected '<' after '%0'">;
170 def err_expected_equal_after : Error<"expected '=' after %0">;
171 def err_expected_comma : Error<"expected ','">;
172 def err_expected_lbrace_in_compound_literal : Error<
173   "expected '{' in compound literal">;
174 def err_expected_while : Error<"expected 'while' in do/while loop">;
175
176 def err_expected_semi_after : Error<"expected ';' after %0">;
177 def err_expected_semi_after_stmt : Error<"expected ';' after %0 statement">;
178 def err_expected_semi_after_expr : Error<"expected ';' after expression">;
179 def err_extraneous_token_before_semi : Error<"extraneous '%0' before ';'">;
180
181 def err_expected_semi_after_method_proto : Error<
182   "expected ';' after method prototype">;
183 def err_expected_semi_after_namespace_name : Error<
184   "expected ';' after namespace name">;
185 def err_unexpected_namespace_attributes_alias : Error<
186   "attributes can not be specified on namespace alias">;
187 def err_inline_namespace_alias : Error<"namespace alias cannot be inline">;
188 def err_namespace_nonnamespace_scope : Error<
189   "namespaces can only be defined in global or namespace scope">;
190 def err_nested_namespaces_with_double_colon : Error<
191   "nested namespace definition must define each namespace separately">;
192 def err_expected_semi_after_attribute_list : Error<
193   "expected ';' after attribute list">;
194 def err_expected_semi_after_static_assert : Error<
195   "expected ';' after static_assert">;
196 def err_expected_semi_for : Error<"expected ';' in 'for' statement specifier">;
197 def err_expected_colon_after : Error<"expected ':' after %0">;
198 def err_label_end_of_compound_statement : Error<
199   "label at end of compound statement: expected statement">;
200 def err_address_of_label_outside_fn : Error<
201   "use of address-of-label extension outside of a function body">;
202 def err_expected_string_literal : Error<"expected string literal">;
203 def err_asm_operand_wide_string_literal : Error<
204   "cannot use %select{unicode|wide}0 string literal in 'asm'">;
205 def err_expected_selector_for_method : Error<
206   "expected selector for Objective-C method">;
207 def err_expected_property_name : Error<"expected property name">;
208
209 def err_unexpected_at : Error<"unexpected '@' in program">;
210
211 def err_invalid_reference_qualifier_application : Error<
212   "'%0' qualifier may not be applied to a reference">;
213 def err_illegal_decl_reference_to_reference : Error<
214   "%0 declared as a reference to a reference">;
215 def ext_rvalue_reference : ExtWarn<
216   "rvalue references are a C++11 extension">, InGroup<CXX11>;
217 def warn_cxx98_compat_rvalue_reference : Warning<
218   "rvalue references are incompatible with C++98">,
219   InGroup<CXX98Compat>, DefaultIgnore;
220 def ext_ref_qualifier : ExtWarn<
221   "reference qualifiers on functions are a C++11 extension">, InGroup<CXX11>;
222 def warn_cxx98_compat_ref_qualifier : Warning<
223   "reference qualifiers on functions are incompatible with C++98">,
224   InGroup<CXX98Compat>, DefaultIgnore;
225 def ext_inline_namespace : ExtWarn<
226   "inline namespaces are a C++11 feature">, InGroup<CXX11>;
227 def warn_cxx98_compat_inline_namespace : Warning<
228   "inline namespaces are incompatible with C++98">,
229   InGroup<CXX98Compat>, DefaultIgnore;
230 def ext_generalized_initializer_lists : ExtWarn<
231   "generalized initializer lists are a C++11 extension">,
232   InGroup<CXX11>;
233 def warn_cxx98_compat_generalized_initializer_lists : Warning<
234   "generalized initializer lists are incompatible with C++98">,
235   InGroup<CXX98Compat>, DefaultIgnore;
236 def err_init_list_bin_op : Error<"initializer list cannot be used on the "
237   "%select{left|right}0 hand side of operator '%1'">;
238 def warn_cxx98_compat_trailing_return_type : Warning<
239   "trailing return types are incompatible with C++98">,
240   InGroup<CXX98Compat>, DefaultIgnore;
241 def ext_auto_type_specifier : ExtWarn<
242   "'auto' type specifier is a C++11 extension">, InGroup<CXX11>;
243 def warn_auto_storage_class : Warning<
244   "'auto' storage class specifier is redundant and incompatible with C++11">,
245   InGroup<CXX11Compat>, DefaultIgnore;
246 def ext_auto_storage_class : ExtWarn<
247   "'auto' storage class specifier is not permitted in C++11, and will not "
248   "be supported in future releases">, InGroup<DiagGroup<"auto-storage-class">>;
249 def ext_for_range : ExtWarn<
250   "range-based for loop is a C++11 extension">, InGroup<CXX11>;
251 def warn_cxx98_compat_for_range : Warning<
252   "range-based for loop is incompatible with C++98">,
253   InGroup<CXX98Compat>, DefaultIgnore;
254 def err_for_range_expected_decl : Error<
255   "for range declaration must declare a variable">;
256 def err_argument_required_after_attribute : Error<
257   "argument required after attribute">;
258 def err_missing_param : Error<"expected parameter declarator">;
259 def err_missing_comma_before_ellipsis : Error<
260   "C requires a comma prior to the ellipsis in a variadic function type">;
261 def err_unexpected_typedef_ident : Error<
262   "unexpected type name %0: expected identifier">;
263 def warn_cxx98_compat_decltype : Warning<
264   "'decltype' type specifier is incompatible with C++98">,
265   InGroup<CXX98Compat>, DefaultIgnore;
266 def err_unexpected_scope_on_base_decltype : Error<
267   "unexpected namespace scope prior to decltype">;
268 def err_expected_class_name : Error<"expected class name">;
269 def err_expected_class_name_not_template : 
270   Error<"'typename' is redundant; base classes are implicitly types">;
271 def err_unspecified_vla_size_with_static : Error<
272   "'static' may not be used with an unspecified variable length array size">;
273
274 def err_expected_case_before_expression: Error<
275   "expected 'case' keyword before expression">;
276
277 // Declarations.
278 def err_typename_requires_specqual : Error<
279   "type name requires a specifier or qualifier">;
280 def err_typename_invalid_storageclass : Error<
281   "type name does not allow storage class to be specified">;
282 def err_typename_invalid_functionspec : Error<
283   "type name does not allow function specifier to be specified">;
284 def err_typename_invalid_constexpr : Error<
285   "type name does not allow constexpr specifier to be specified">;
286 def err_typename_identifiers_only : Error<
287   "typename is allowed for identifiers only">;
288
289 def err_invalid_decl_spec_combination : Error<
290   "cannot combine with previous '%0' declaration specifier">;
291 def err_invalid_vector_decl_spec_combination : Error<
292   "cannot combine with previous '%0' declaration specifier. "
293   "'__vector' must be first">;
294 def err_invalid_pixel_decl_spec_combination : Error<
295   "'__pixel' must be preceded by '__vector'.  "
296   "'%0' declaration specifier not allowed here">;
297 def err_invalid_vector_decl_spec : Error<
298   "cannot use '%0' with '__vector'">;
299 def err_invalid_vector_bool_decl_spec : Error<
300   "cannot use '%0' with '__vector bool'">;
301 def warn_vector_long_decl_spec_combination : Warning<
302   "Use of 'long' with '__vector' is deprecated">, InGroup<Deprecated>;
303 def err_friend_invalid_in_context : Error<
304   "'friend' used outside of class">;
305 def err_unknown_typename : Error<
306   "unknown type name %0">;
307 def err_use_of_tag_name_without_tag : Error<
308   "must use '%1' tag to refer to type %0%select{| in this scope}2">;
309 def err_templated_using_directive : Error<
310   "cannot template a using directive">;
311 def err_templated_using_declaration : Error<
312   "cannot template a using declaration">;
313 def err_unexected_colon_in_nested_name_spec : Error<
314   "unexpected ':' in nested name specifier">;
315 def err_bool_redeclaration : Error<
316   "redeclaration of C++ built-in type 'bool'">;
317 def ext_c11_static_assert : Extension<
318   "_Static_assert is a C11-specific feature">, InGroup<C11>;
319 def warn_cxx98_compat_static_assert : Warning<
320   "static_assert declarations are incompatible with C++98">,
321   InGroup<CXX98Compat>, DefaultIgnore;
322
323 /// Objective-C parser diagnostics
324 def err_expected_minus_or_plus : Error<
325   "method type specifier must start with '-' or '+'">;
326 def err_objc_no_attributes_on_category : Error<
327   "attributes may not be specified on a category">;
328 def err_objc_missing_end : Error<"missing '@end'">;
329 def note_objc_container_start : Note<
330   "%select{class|protocol|category|class extension|implementation"
331   "|category implementation}0 started here">;
332 def warn_objc_protocol_qualifier_missing_id : Warning<
333   "protocol qualifiers without 'id' is archaic">;
334 def err_objc_unknown_at : Error<"expected an Objective-C directive after '@'">;
335 def err_illegal_super_cast : Error<
336   "cannot cast 'super' (it isn't an expression)">;
337 def err_nsnumber_nonliteral_unary : Error<
338   "@%0 must be followed by a number to form an NSNumber object">;
339
340 let CategoryName = "ARC Parse Issue" in {
341 def err_arc_bridge_retain : Error<
342   "unknown cast annotation __bridge_retain; did you mean __bridge_retained?">;
343 // To be default mapped to an error later.
344 def warn_arc_bridge_cast_nonarc : Warning<
345   "'%0' casts have no effect when not using ARC">,
346   InGroup<DiagGroup<"arc-bridge-casts-disallowed-in-nonarc">>;
347 }
348   
349 def err_objc_illegal_visibility_spec : Error<
350   "illegal visibility specification">;
351 def err_objc_illegal_interface_qual : Error<"illegal interface qualifier">;
352 def err_objc_expected_equal_for_getter : Error<
353   "expected '=' for Objective-C getter">;
354 def err_objc_expected_equal_for_setter : Error<
355   "expected '=' for Objective-C setter">;
356 def err_objc_expected_selector_for_getter_setter : Error<
357   "expected selector for Objective-C %select{setter|getter}0">;
358 def err_objc_property_requires_field_name : Error<
359   "property requires fields to be named">;
360 def err_objc_property_bitfield : Error<"property name cannot be a bitfield">;
361 def err_objc_expected_property_attr : Error<"unknown property attribute %0">;
362 def err_objc_properties_require_objc2 : Error<
363   "properties are an Objective-C 2 feature">;
364 def err_objc_unexpected_attr : Error<
365   "prefix attribute must be followed by an interface or protocol">;
366 def err_objc_directive_only_in_protocol : Error<
367   "directive may only be specified in protocols only">;
368 def err_missing_catch_finally : Error<
369   "@try statement without a @catch and @finally clause">;
370 def err_objc_concat_string : Error<"unexpected token after Objective-C string">;
371 def err_expected_objc_container : Error<
372   "'@end' must appear in an Objective-C context">;
373 def error_property_ivar_decl : Error<
374   "property synthesize requires specification of an ivar">;
375 def err_synthesized_property_name : Error<
376   "expected a property name in @synthesize">;
377 def warn_semicolon_before_method_body : Warning<
378   "semicolon before method body is ignored">,
379   InGroup<DiagGroup<"semicolon-before-method-body">>, DefaultIgnore;
380
381 def err_expected_field_designator : Error<
382   "expected a field designator, such as '.field = 4'">;
383
384 def err_declaration_does_not_declare_param : Error<
385   "declaration does not declare a parameter">;
386 def err_no_matching_param : Error<"parameter named %0 is missing">;
387
388 /// C++ parser diagnostics
389 def err_expected_unqualified_id : Error<
390   "expected %select{identifier|unqualified-id}0">;
391 def err_func_def_no_params : Error<
392   "function definition does not declare parameters">;
393 def err_expected_lparen_after_type : Error<
394   "expected '(' for function-style cast or type construction">;
395 def err_expected_init_in_condition : Error<
396   "variable declaration in condition must have an initializer">;
397 def err_expected_init_in_condition_lparen : Error<
398   "variable declaration in condition cannot have a parenthesized initializer">;
399 def warn_parens_disambiguated_as_function_decl : Warning<
400   "parentheses were disambiguated as a function declarator">,
401   InGroup<VexingParse>;
402 def warn_dangling_else : Warning<
403   "add explicit braces to avoid dangling else">,
404   InGroup<DanglingElse>;
405 def err_expected_member_or_base_name : Error<
406   "expected class member or base class name">;
407 def err_expected_lbrace_after_base_specifiers : Error<
408   "expected '{' after base class list">;
409 def ext_ellipsis_exception_spec : Extension<
410   "exception specification of '...' is a Microsoft extension">;
411 def err_dynamic_and_noexcept_specification : Error<
412   "cannot have both throw() and noexcept() clause on the same function">;
413 def err_except_spec_unparsed : Error<
414   "unexpected end of exception specification">;
415 def warn_cxx98_compat_noexcept_decl : Warning<
416   "noexcept specifications are incompatible with C++98">,
417   InGroup<CXX98Compat>, DefaultIgnore;
418 def err_expected_catch : Error<"expected catch">;
419 def err_expected_lbrace_or_comma : Error<"expected '{' or ','">;
420 def err_expected_rbrace_or_comma : Error<"expected '}' or ','">;
421 def err_expected_rsquare_or_comma : Error<"expected ']' or ','">;
422 def err_using_namespace_in_class : Error<
423   "'using namespace' is not allowed in classes">;
424 def err_destructor_tilde_identifier : Error<
425   "expected a class name after '~' to name a destructor">;
426 def err_destructor_template_id : Error<
427   "destructor name %0 does not refer to a template">;
428 def err_default_arg_unparsed : Error<
429   "unexpected end of default argument expression">;
430 def err_parser_impl_limit_overflow : Error<
431   "parser recursion limit reached, program too complex">, DefaultFatal;
432 def err_misplaced_ellipsis_in_declaration : Error<
433   "'...' must %select{immediately precede declared identifier|"
434   "be innermost component of anonymous pack declaration}0">;
435
436 // C++ derived classes
437 def err_dup_virtual : Error<"duplicate 'virtual' in base specifier">;
438
439 // C++ operator overloading
440 def err_literal_operator_string_prefix : Error<
441   "string literal after 'operator' cannot have an encoding prefix">;
442 def err_literal_operator_string_not_empty : Error<
443   "string literal after 'operator' must be '\"\"'">;
444 def err_literal_operator_missing_space : Error<
445   "C++11 requires a space between the \"\" and the user-defined suffix in a "
446   "literal operator">;
447 def warn_cxx98_compat_literal_operator : Warning<
448   "literal operators are incompatible with C++98">,
449   InGroup<CXX98Compat>, DefaultIgnore;
450
451 // Classes.
452 def err_anon_type_definition : Error<
453   "declaration of anonymous %0 must be a definition">;
454 def err_default_delete_in_multiple_declaration : Error<
455   "'= %select{default|delete}0' is a function definition and must occur in a "
456   "standalone declaration">;
457
458 def warn_cxx98_compat_noexcept_expr : Warning<
459   "noexcept expressions are incompatible with C++98">,
460   InGroup<CXX98Compat>, DefaultIgnore;
461 def warn_cxx98_compat_nullptr : Warning<
462   "'nullptr' is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
463
464 def warn_cxx98_compat_alignas : Warning<"'alignas' is incompatible with C++98">,
465   InGroup<CXX98Compat>, DefaultIgnore;
466 def warn_cxx98_compat_attribute : Warning<
467   "attributes are incompatible with C++98">,
468   InGroup<CXX98Compat>, DefaultIgnore;
469 def err_cxx11_attribute_forbids_arguments : Error<
470   "attribute '%0' cannot have an argument list">;
471 def err_cxx11_attribute_forbids_ellipsis : Error<
472   "attribute '%0' cannot be used as an attribute pack">;
473 def err_attributes_not_allowed : Error<"an attribute list cannot appear here">;
474 def err_l_square_l_square_not_attribute : Error<
475   "C++11 only allows consecutive left square brackets when "
476   "introducing an attribute">;
477 def err_alignas_pack_exp_unsupported : Error<
478   "pack expansions in alignment specifiers are not supported yet">;
479
480 /// C++ Templates
481 def err_expected_template : Error<"expected template">;
482 def err_unknown_template_name : Error<
483   "unknown template name %0">;
484 def err_expected_comma_greater : Error<
485   "expected ',' or '>' in template-parameter-list">;
486 def err_class_on_template_template_param : Error<
487   "template template parameter requires 'class' after the parameter list">;
488 def err_template_spec_syntax_non_template : Error<
489   "identifier followed by '<' indicates a class template specialization but "
490   "%0 %select{does not refer to a template|refers to a function "
491   "template|<unused>|refers to a template template parameter}1">;
492 def err_id_after_template_in_nested_name_spec : Error<
493   "expected template name after 'template' keyword in nested name specifier">;
494 def err_two_right_angle_brackets_need_space : Error<
495   "a space is required between consecutive right angle brackets (use '> >')">;
496 def warn_cxx0x_right_shift_in_template_arg : Warning<
497   "use of right-shift operator ('>>') in template argument will require "
498   "parentheses in C++11">;
499 def warn_cxx98_compat_two_right_angle_brackets : Warning<
500   "consecutive right angle brackets are incompatible with C++98 (use '> >')">,
501   InGroup<CXX98Compat>, DefaultIgnore;
502 def err_multiple_template_declarators : Error<
503     "%select{|a template declaration|an explicit template specialization|"
504     "an explicit template instantiation}0 can "
505     "only %select{|declare|declare|instantiate}0 a single entity">;
506 def err_explicit_instantiation_with_definition : Error<
507     "explicit template instantiation cannot have a definition; if this "
508     "definition is meant to be an explicit specialization, add '<>' after the "
509     "'template' keyword">;
510 def err_enum_template : Error<"enumeration cannot be a template">;
511 def err_explicit_instantiation_enum : Error<
512     "enumerations cannot be explicitly instantiated">;
513 def err_expected_template_parameter : Error<"expected template parameter">;
514
515 def err_missing_dependent_template_keyword : Error<
516   "use 'template' keyword to treat '%0' as a dependent template name">;
517 def warn_missing_dependent_template_keyword : ExtWarn<
518   "use 'template' keyword to treat '%0' as a dependent template name">;
519
520 def ext_extern_template : Extension<
521   "extern templates are a C++11 extension">, InGroup<CXX11>;
522 def warn_cxx98_compat_extern_template : Warning<
523   "extern templates are incompatible with C++98">,
524   InGroup<CXX98CompatPedantic>, DefaultIgnore;
525 def warn_static_inline_explicit_inst_ignored : Warning<
526   "ignoring '%select{static|inline}0' keyword on explicit template "
527   "instantiation">;
528   
529 // Constructor template diagnostics.
530 def err_out_of_line_constructor_template_id : Error<
531   "out-of-line constructor for %0 cannot have template arguments">;
532 def err_out_of_line_template_id_names_constructor : Error<
533   "qualified reference to %0 is a constructor name rather than a "
534   "template name wherever a constructor can be declared">;
535 def err_out_of_line_type_names_constructor : Error<
536   "qualified reference to %0 is a constructor name rather than a "
537   "type wherever a constructor can be declared">;
538
539 def err_expected_qualified_after_typename : Error<
540   "expected a qualified name after 'typename'">;
541 def warn_expected_qualified_after_typename : ExtWarn<
542   "expected a qualified name after 'typename'">;
543 def err_expected_semi_after_tagdecl : Error<
544   "expected ';' after %0">;
545
546 def err_typename_refers_to_non_type_template : Error<
547   "typename specifier refers to a non-template">;
548 def err_expected_type_name_after_typename : Error<
549   "expected an identifier or template-id after '::'">;
550 def err_explicit_spec_non_template : Error<
551   "explicit %select{specialization|instantiation}0 of non-template "
552   "%select{class|struct|union}1 %2">;
553   
554 def err_default_template_template_parameter_not_template : Error<
555   "default template argument for a template template parameter must be a class "
556   "template">;
557   
558 def err_ctor_init_missing_comma : Error<
559   "missing ',' between base or member initializers">;
560
561 // C++ declarations
562 def err_friend_decl_defines_type : Error<
563   "cannot define a type in a friend declaration">;
564 def err_missing_whitespace_digraph : Error<
565   "found '<::' after a "
566   "%select{template name|const_cast|dynamic_cast|reinterpret_cast|static_cast}0"
567   " which forms the digraph '<:' (aka '[') and a ':', did you mean '< ::'?">;
568
569 def ext_deleted_function : ExtWarn<
570   "deleted function definitions are a C++11 extension">, InGroup<CXX11>;
571 def warn_cxx98_compat_deleted_function : Warning<
572   "deleted function definitions are incompatible with C++98">,
573   InGroup<CXX98Compat>, DefaultIgnore;
574 def ext_defaulted_function : ExtWarn<
575   "defaulted function definitions are a C++11 extension">, InGroup<CXX11>;
576 def warn_cxx98_compat_defaulted_function : Warning<
577   "defaulted function definitions are incompatible with C++98">,
578   InGroup<CXX98Compat>, DefaultIgnore;
579
580 // C++11 in-class member initialization
581 def ext_nonstatic_member_init : ExtWarn<
582   "in-class initialization of non-static data member is a C++11 extension">,
583   InGroup<CXX11>;
584 def warn_cxx98_compat_nonstatic_member_init : Warning<
585   "in-class initialization of non-static data members is incompatible with C++98">,
586   InGroup<CXX98Compat>, DefaultIgnore;
587 def err_bitfield_member_init: Error<
588   "bitfield member cannot have an in-class initializer">;
589 def err_incomplete_array_member_init: Error<
590   "array bound cannot be deduced from an in-class initializer">;
591
592 // C++11 alias-declaration
593 def ext_alias_declaration : ExtWarn<
594   "alias declarations are a C++11 extension">, InGroup<CXX11>;
595 def warn_cxx98_compat_alias_declaration : Warning<
596   "alias declarations are incompatible with C++98">,
597   InGroup<CXX98Compat>, DefaultIgnore;
598 def err_alias_declaration_not_identifier : Error<
599   "name defined in alias declaration must be an identifier">;
600 def err_alias_declaration_specialization : Error<
601   "%select{partial specialization|explicit specialization|explicit instantiation}0 of alias templates is not permitted">;
602     
603 // C++11 override control
604 def ext_override_control_keyword : ExtWarn<
605   "'%0' keyword is a C++11 extension">, InGroup<CXX11>;
606 def warn_cxx98_compat_override_control_keyword : Warning<
607   "'%0' keyword is incompatible with C++98">,
608   InGroup<CXX98Compat>, DefaultIgnore;
609
610 def err_duplicate_virt_specifier : Error<
611   "class member already marked '%0'">;
612
613 def err_scoped_enum_missing_identifier : Error<
614   "scoped enumeration requires a name">;
615 def warn_cxx98_compat_scoped_enum : Warning<
616   "scoped enumerations are incompatible with C++98">,
617   InGroup<CXX98Compat>, DefaultIgnore;
618
619 def err_expected_parameter_pack : Error<
620   "expected the name of a parameter pack">;
621 def err_paren_sizeof_parameter_pack : Error<
622   "missing parentheses around the size of parameter pack %0">;
623 def err_sizeof_parameter_pack : Error<
624   "expected parenthesized parameter pack name in 'sizeof...' expression">;
625
626 // C++11 lambda expressions
627 def err_expected_comma_or_rsquare : Error<
628   "expected ',' or ']' in lambda capture list">;
629 def err_this_captured_by_reference : Error<
630   "'this' cannot be captured by reference">;
631 def err_expected_capture : Error<
632   "expected variable name or 'this' in lambda capture list">;
633 def err_expected_lambda_body : Error<"expected body of lambda expression">;
634 def warn_cxx98_compat_lambda : Warning<
635   "lambda expressions are incompatible with C++98">,
636   InGroup<CXX98Compat>, DefaultIgnore;
637 def err_lambda_missing_parens : Error<
638   "lambda requires '()' before %select{'mutable'|return type}0">;
639
640 // Availability attribute
641 def err_expected_version : Error<
642   "expected a version of the form 'major[.minor[.subminor]]'">;
643 def err_zero_version : Error<
644   "version number must have non-zero major, minor, or sub-minor version">;
645 def err_availability_expected_platform : Error<
646   "expected a platform name, e.g., 'macosx'">;
647 def err_availability_expected_change : Error<
648   "expected 'introduced', 'deprecated', or 'obsoleted'">;
649 def err_availability_unknown_change : Error<
650   "%0 is not an availability stage; use 'introduced', 'deprecated', or "
651   "'obsoleted'">;
652 def err_availability_redundant : Error<
653   "redundant %0 availability change; only the last specified change will "        "be used">;
654 def warn_availability_and_unavailable : Warning<
655   "'unavailable' availability overrides all other availability information">;
656
657 // Language specific pragmas
658 // - Generic warnings
659 def warn_pragma_expected_lparen : Warning<
660   "missing '(' after '#pragma %0' - ignoring">;
661 def warn_pragma_expected_rparen : Warning<
662   "missing ')' after '#pragma %0' - ignoring">;
663 def warn_pragma_expected_identifier : Warning<
664   "expected identifier in '#pragma %0' - ignored">;  
665 def warn_pragma_ms_struct : Warning<
666   "incorrect use of '#pragma ms_struct on|off' - ignored">;  
667 def warn_pragma_extra_tokens_at_eol : Warning<
668   "extra tokens at end of '#pragma %0' - ignored">; 
669 // - #pragma options
670 def warn_pragma_options_expected_align : Warning<
671   "expected 'align' following '#pragma options' - ignored">;
672 def warn_pragma_align_expected_equal : Warning<
673   "expected '=' following '#pragma %select{align|options align}0' - ignored">;
674 def warn_pragma_align_invalid_option : Warning<
675   "invalid alignment option in '#pragma %select{align|options align}0' - ignored">;
676 // - #pragma pack
677 def warn_pragma_pack_invalid_action : Warning<
678   "unknown action for '#pragma pack' - ignored">;
679 def warn_pragma_pack_malformed : Warning<
680   "expected integer or identifier in '#pragma pack' - ignored">;
681 // - #pragma unused
682 def warn_pragma_unused_expected_var : Warning<
683   "expected '#pragma unused' argument to be a variable name">;
684 def warn_pragma_unused_expected_punc : Warning<
685   "expected ')' or ',' in '#pragma unused'">;
686
687 // OpenCL Section 6.8.g
688 def err_not_opencl_storage_class_specifier : Error<
689   "OpenCL does not support the '%0' storage class specifier">;
690
691 // OpenCL EXTENSION pragma (OpenCL 1.1 [9.1])
692 def warn_pragma_expected_colon : Warning<
693   "missing ':' after %0 - ignoring">;
694 def warn_pragma_expected_enable_disable : Warning<
695   "expected 'enable' or 'disable' - ignoring">;
696 def warn_pragma_unknown_extension : Warning<
697   "unknown OpenCL extension %0 - ignoring">;
698
699 def err_seh_expected_handler : Error<
700   "expected '__except' or '__finally' block">;
701
702 def err_seh___except_block : Error<
703   "%0 only allowed in __except block">;
704
705 def err_seh___except_filter : Error<
706   "%0 only allowed in __except filter expression">;
707
708 def err_seh___finally_block : Error<
709   "%0 only allowed in __finally block">;
710   
711 } // end of Parse Issue category.
712
713 let CategoryName = "Modules Issue" in {
714 def err_module_expected_ident : Error<
715   "expected a module name after module import">;
716 def err_module_expected_semi : Error<
717   "expected a semicolon name after module name">;
718 }
719
720 } // end of Parser diagnostics