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