]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.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 / DiagnosticSemaKinds.td
1 //==--- DiagnosticSemaKinds.td - libsema 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 // Semantic Analysis
12 //===----------------------------------------------------------------------===//
13
14 let Component = "Sema" in {
15 let CategoryName = "Semantic Issue" in {
16
17 // For loop analysis
18 def warn_variables_not_in_loop_body : Warning<
19   "variable%select{s| %1|s %1 and %2|s %1, %2, and %3|s %1, %2, %3, and %4}0 "
20   "used in loop condition not modified in loop body">,
21   InGroup<DiagGroup<"loop-analysis">>, DefaultIgnore;
22
23 def warn_duplicate_enum_values : Warning<
24   "element %0 has been implicitly assigned %1 which another element has "
25   "been assigned">, InGroup<DiagGroup<"duplicate-enum">>, DefaultIgnore;
26 def note_duplicate_element : Note<"element %0 also has value %1">;
27
28 // Constant expressions
29 def err_expr_not_ice : Error<
30   "expression is not an %select{integer|integral}0 constant expression">;
31 def ext_expr_not_ice : Extension<
32   "expression is not an %select{integer|integral}0 constant expression; "
33   "folding it to a constant is a GNU extension">, InGroup<GNU>;
34 def err_typecheck_converted_constant_expression : Error<
35   "value of type %0 is not implicitly convertible to %1">;
36 def err_typecheck_converted_constant_expression_disallowed : Error<
37   "conversion from %0 to %1 is not allowed in a converted constant expression">;
38 def err_expr_not_cce : Error<
39   "%select{case value|enumerator value|non-type template argument}0 "
40   "is not a constant expression">;
41 def err_cce_narrowing : ExtWarn<
42   "%select{case value|enumerator value|non-type template argument}0 "
43   "%select{cannot be narrowed from type %2 to %3|"
44   "evaluates to %2, which cannot be narrowed to type %3}1">,
45   InGroup<CXX11Narrowing>, DefaultError;
46 def err_cce_narrowing_sfinae : Error<
47   "%select{case value|enumerator value|non-type template argument}0 "
48   "%select{cannot be narrowed from type %2 to %3|"
49   "evaluates to %2, which cannot be narrowed to type %3}1">;
50 def err_ice_not_integral : Error<
51   "integral constant expression must have integral or unscoped enumeration "
52   "type, not %0">;
53 def err_ice_incomplete_type : Error<
54   "integral constant expression has incomplete class type %0">;
55 def err_ice_explicit_conversion : Error<
56   "integral constant expression requires explicit conversion from %0 to %1">;
57 def note_ice_conversion_here : Note<
58   "conversion to %select{integral|enumeration}0 type %1 declared here">;
59 def err_ice_ambiguous_conversion : Error<
60   "ambiguous conversion from type %0 to an integral or unscoped "
61   "enumeration type">;
62
63 // Semantic analysis of constant literals.
64 def ext_predef_outside_function : Warning<
65   "predefined identifier is only valid inside function">,
66   InGroup<DiagGroup<"predefined-identifier-outside-function">>;
67 def warn_float_overflow : Warning<
68   "magnitude of floating-point constant too large for type %0; maximum is %1">,
69    InGroup<LiteralRange>;
70 def warn_float_underflow : Warning<
71   "magnitude of floating-point constant too small for type %0; minimum is %1">,
72   InGroup<LiteralRange>;
73 def warn_double_const_requires_fp64 : Warning<
74   "double precision constant requires cl_khr_fp64, casting to single precision">;
75
76 // C99 variable-length arrays
77 def ext_vla : Extension<"variable length arrays are a C99 feature">,
78   InGroup<VLAExtension>;
79 def warn_vla_used : Warning<"variable length array used">,
80   InGroup<VLA>, DefaultIgnore;
81 def warn_cxx11_compat_array_of_runtime_bound : Warning<
82   "arrays of runtime bound are incompatible with C++ standards before C++1y">,
83   InGroup<CXXPre1yCompatPedantic>, DefaultIgnore;
84 def err_vla_non_pod : Error<"variable length array of non-POD element type %0">;
85 def err_vla_in_sfinae : Error<
86   "variable length array cannot be formed during template argument deduction">;
87 def err_array_star_in_function_definition : Error<
88   "variable length array must be bound in function definition">;
89 def err_vla_decl_in_file_scope : Error<
90   "variable length array declaration not allowed at file scope">;
91 def err_vla_decl_has_static_storage : Error<
92   "variable length array declaration can not have 'static' storage duration">;
93 def err_vla_decl_has_extern_linkage : Error<
94   "variable length array declaration can not have 'extern' linkage">;
95 def ext_vla_folded_to_constant : Extension<
96   "variable length array folded to constant array as an extension">;
97
98 // C99 variably modified types
99 def err_variably_modified_template_arg : Error<
100   "variably modified type %0 cannot be used as a template argument">;
101 def err_variably_modified_nontype_template_param : Error<
102   "non-type template parameter of variably modified type %0">;
103 def err_variably_modified_new_type : Error<
104   "'new' cannot allocate object of variably modified type %0">;
105
106 // C99 Designated Initializers
107 def ext_designated_init : Extension<
108   "designated initializers are a C99 feature">, InGroup<C99>;
109 def err_array_designator_negative : Error<
110   "array designator value '%0' is negative">;
111 def err_array_designator_empty_range : Error<
112   "array designator range [%0, %1] is empty">;
113 def err_array_designator_non_array : Error<
114   "array designator cannot initialize non-array type %0">;
115 def err_array_designator_too_large : Error<
116   "array designator index (%0) exceeds array bounds (%1)">;
117 def err_field_designator_non_aggr : Error<
118   "field designator cannot initialize a "
119   "%select{non-struct, non-union|non-class}0 type %1">;
120 def err_field_designator_unknown : Error<
121   "field designator %0 does not refer to any field in type %1">;
122 def err_field_designator_nonfield : Error<
123   "field designator %0 does not refer to a non-static data member">;
124 def note_field_designator_found : Note<"field designator refers here">;
125 def err_designator_for_scalar_init : Error<
126   "designator in initializer for scalar type %0">;
127 def warn_subobject_initializer_overrides : Warning<
128   "subobject initialization overrides initialization of other fields "
129   "within its enclosing subobject">, InGroup<InitializerOverrides>;
130 def warn_initializer_overrides : Warning<
131   "initializer overrides prior initialization of this subobject">,
132   InGroup<InitializerOverrides>;
133 def note_previous_initializer : Note<
134   "previous initialization %select{|with side effects }0is here"
135   "%select{| (side effects may not occur at run time)}0">;
136 def err_designator_into_flexible_array_member : Error<
137   "designator into flexible array member subobject">;
138 def note_flexible_array_member : Note<
139   "initialized flexible array member %0 is here">;
140 def ext_flexible_array_init : Extension<
141   "flexible array initialization is a GNU extension">, InGroup<GNU>;
142
143 // Declarations.
144 def err_bad_variable_name : Error<
145   "%0 cannot be the name of a variable or data member">;
146 def err_bad_parameter_name : Error<
147   "'%0' cannot be the name of a parameter">;
148 def err_parameter_name_omitted : Error<"parameter name omitted">;
149 def warn_unused_parameter : Warning<"unused parameter %0">,
150   InGroup<UnusedParameter>, DefaultIgnore;
151 def warn_unused_variable : Warning<"unused variable %0">,
152   InGroup<UnusedVariable>, DefaultIgnore;
153 def warn_unused_exception_param : Warning<"unused exception parameter %0">,
154   InGroup<UnusedExceptionParameter>, DefaultIgnore;
155 def warn_decl_in_param_list : Warning<
156   "declaration of %0 will not be visible outside of this function">,
157   InGroup<Visibility>;
158 def warn_redefinition_in_param_list : Warning<
159   "redefinition of %0 will not be visible outside of this function">,
160   InGroup<Visibility>;
161 def warn_empty_parens_are_function_decl : Warning<
162   "empty parentheses interpreted as a function declaration">,
163   InGroup<VexingParse>;
164 def warn_parens_disambiguated_as_function_declaration : Warning<
165   "parentheses were disambiguated as a function declaration">,
166   InGroup<VexingParse>;
167 def note_additional_parens_for_variable_declaration : Note<
168   "add a pair of parentheses to declare a variable">;
169 def note_empty_parens_function_call : Note<
170   "change this ',' to a ';' to call %0">;
171 def note_empty_parens_default_ctor : Note<
172   "remove parentheses to declare a variable">;
173 def note_empty_parens_zero_initialize : Note<
174   "replace parentheses with an initializer to declare a variable">;
175 def warn_unused_function : Warning<"unused function %0">,
176   InGroup<UnusedFunction>, DefaultIgnore;
177 def warn_unused_member_function : Warning<"unused member function %0">,
178   InGroup<UnusedMemberFunction>, DefaultIgnore;
179 def warn_used_but_marked_unused: Warning<"%0 was marked unused but was used">,
180   InGroup<UsedButMarkedUnused>, DefaultIgnore;
181 def warn_unneeded_internal_decl : Warning<
182   "%select{function|variable}0 %1 is not needed and will not be emitted">,
183   InGroup<UnneededInternalDecl>, DefaultIgnore;
184 def warn_unneeded_static_internal_decl : Warning<
185   "'static' function %0 declared in header file "
186   "should be declared 'static inline'">,
187   InGroup<UnneededInternalDecl>, DefaultIgnore;
188 def warn_unneeded_member_function : Warning<
189   "member function %0 is not needed and will not be emitted">,
190   InGroup<UnneededMemberFunction>, DefaultIgnore;
191 def warn_unused_private_field: Warning<"private field %0 is not used">,
192   InGroup<UnusedPrivateField>, DefaultIgnore;
193
194 def warn_parameter_size: Warning<
195   "%0 is a large (%1 bytes) pass-by-value argument; "
196   "pass it by reference instead ?">, InGroup<LargeByValueCopy>;
197 def warn_return_value_size: Warning<
198   "return value of %0 is a large (%1 bytes) pass-by-value object; "
199   "pass it by reference instead ?">, InGroup<LargeByValueCopy>;
200 def warn_return_value_udt: Warning<
201   "%0 has C-linkage specified, but returns user-defined type %1 which is "
202   "incompatible with C">, InGroup<ReturnTypeCLinkage>;
203 def warn_return_value_udt_incomplete: Warning<
204   "%0 has C-linkage specified, but returns incomplete type %1 which could be "
205   "incompatible with C">, InGroup<ReturnTypeCLinkage>;
206 def warn_implicit_function_decl : Warning<
207   "implicit declaration of function %0">,
208   InGroup<ImplicitFunctionDeclare>, DefaultIgnore;
209 def ext_implicit_function_decl : ExtWarn<
210   "implicit declaration of function %0 is invalid in C99">,
211   InGroup<ImplicitFunctionDeclare>;
212 def note_function_suggestion : Note<"did you mean %0?">;
213
214 def err_ellipsis_first_arg : Error<
215   "ISO C requires a named argument before '...'">;
216 def err_declarator_need_ident : Error<"declarator requires an identifier">;
217 def err_bad_language : Error<"unknown linkage language">;
218 def warn_use_out_of_scope_declaration : Warning<
219   "use of out-of-scope declaration of %0">;
220 def err_inline_non_function : Error<
221   "'inline' can only appear on functions">;
222 def err_noreturn_non_function : Error<
223   "'_Noreturn' can only appear on functions">;
224 def warn_qual_return_type : Warning< 
225   "'%0' type qualifier%s1 on return type %plural{1:has|:have}1 no effect">,
226   InGroup<IgnoredQualifiers>, DefaultIgnore;
227
228 def warn_decl_shadow :
229   Warning<"declaration shadows a %select{"
230           "local variable|"
231           "variable in %2|"
232           "static data member of %2|"
233           "field of %2}1">,
234   InGroup<Shadow>, DefaultIgnore;
235
236 // C++ using declarations
237 def err_using_requires_qualname : Error<
238   "using declaration requires a qualified name">;
239 def err_using_typename_non_type : Error<
240   "'typename' keyword used on a non-type">;
241 def err_using_dependent_value_is_type : Error<
242   "dependent using declaration resolved to type without 'typename'">;
243 def err_using_decl_nested_name_specifier_is_not_class : Error<
244   "using declaration in class refers into '%0', which is not a class">;
245 def err_using_decl_nested_name_specifier_is_current_class : Error<
246   "using declaration refers to its own class">;
247 def err_using_decl_nested_name_specifier_is_not_base_class : Error<
248   "using declaration refers into '%0', which is not a base class of %1">;
249 def err_using_decl_constructor_not_in_direct_base : Error<
250   "%0 is not a direct base of %1, can not inherit constructors">;
251 def err_using_decl_constructor_conflict : Error<
252   "can not inherit constructor, already inherited constructor with "
253   "the same signature">;
254 def note_using_decl_constructor_conflict_current_ctor : Note<
255   "conflicting constructor">;
256 def note_using_decl_constructor_conflict_previous_ctor : Note<
257   "previous constructor">;
258 def note_using_decl_constructor_conflict_previous_using : Note<
259   "previously inherited here">;
260 def warn_using_decl_constructor_ellipsis : Warning<
261   "inheriting constructor does not inherit ellipsis">,
262   InGroup<DiagGroup<"inherited-variadic-ctor">>;
263 def note_using_decl_constructor_ellipsis : Note<
264   "constructor declared with ellipsis here">;
265 def err_using_decl_can_not_refer_to_class_member : Error<
266   "using declaration can not refer to class member">;
267 def err_using_decl_can_not_refer_to_namespace : Error<
268   "using declaration can not refer to namespace">;
269 def err_using_decl_constructor : Error<
270   "using declaration can not refer to a constructor">;
271 def warn_cxx98_compat_using_decl_constructor : Warning<
272   "inheriting constructors are incompatible with C++98">,
273   InGroup<CXX98Compat>, DefaultIgnore;
274 def err_using_decl_destructor : Error<
275   "using declaration can not refer to a destructor">;
276 def err_using_decl_template_id : Error<
277   "using declaration can not refer to a template specialization">;
278 def note_using_decl_target : Note<"target of using declaration">;
279 def note_using_decl_conflict : Note<"conflicting declaration">;
280 def err_using_decl_redeclaration : Error<"redeclaration of using decl">;
281 def err_using_decl_conflict : Error<
282   "target of using declaration conflicts with declaration already in scope">;
283 def err_using_decl_conflict_reverse : Error<
284   "declaration conflicts with target of using declaration already in scope">;
285 def note_using_decl : Note<"%select{|previous }0using declaration">;
286
287 def warn_access_decl_deprecated : Warning<
288   "access declarations are deprecated; use using declarations instead">,
289   InGroup<Deprecated>;
290
291 def warn_global_constructor : Warning<
292   "declaration requires a global constructor">,
293   InGroup<GlobalConstructors>, DefaultIgnore;
294 def warn_global_destructor : Warning<
295   "declaration requires a global destructor">,
296    InGroup<GlobalConstructors>, DefaultIgnore;
297 def warn_exit_time_destructor : Warning<
298   "declaration requires an exit-time destructor">,
299   InGroup<ExitTimeDestructors>, DefaultIgnore;
300
301 def err_invalid_thread : Error<
302   "'%0' is only allowed on variable declarations">;
303 def err_thread_non_global : Error<
304   "'%0' variables must have global storage">;
305 def err_thread_unsupported : Error<
306   "thread-local storage is unsupported for the current target">;
307
308 def warn_maybe_falloff_nonvoid_function : Warning<
309   "control may reach end of non-void function">,
310   InGroup<ReturnType>;
311 def warn_falloff_nonvoid_function : Warning<
312   "control reaches end of non-void function">,
313   InGroup<ReturnType>;
314 def err_maybe_falloff_nonvoid_block : Error<
315   "control may reach end of non-void block">;
316 def err_falloff_nonvoid_block : Error<
317   "control reaches end of non-void block">;
318 def warn_suggest_noreturn_function : Warning<
319   "%select{function|method}0 %1 could be declared with attribute 'noreturn'">,
320   InGroup<MissingNoreturn>, DefaultIgnore;
321 def warn_suggest_noreturn_block : Warning<
322   "block could be declared with attribute 'noreturn'">,
323   InGroup<MissingNoreturn>, DefaultIgnore;
324 def warn_unreachable : Warning<"will never be executed">,
325   InGroup<DiagGroup<"unreachable-code">>, DefaultIgnore;
326
327 /// Built-in functions.
328 def ext_implicit_lib_function_decl : ExtWarn<
329   "implicitly declaring library function '%0' with type %1">;
330 def note_please_include_header : Note<
331   "please include the header <%0> or explicitly provide a "
332   "declaration for '%1'">;
333 def note_previous_builtin_declaration : Note<"%0 is a builtin with type %1">;
334 def warn_implicit_decl_requires_stdio : Warning<
335   "declaration of built-in function '%0' requires inclusion of the header "
336   "<stdio.h>">,
337   InGroup<BuiltinRequiresHeader>;
338 def warn_implicit_decl_requires_setjmp : Warning<
339   "declaration of built-in function '%0' requires inclusion of the header "
340   "<setjmp.h>">,
341   InGroup<BuiltinRequiresHeader>;
342 def warn_implicit_decl_requires_ucontext : Warning<
343   "declaration of built-in function '%0' requires inclusion of the header "
344   "<ucontext.h>">,
345   InGroup<BuiltinRequiresHeader>;
346 def warn_redecl_library_builtin : Warning<
347   "incompatible redeclaration of library function %0">,
348   InGroup<DiagGroup<"incompatible-library-redeclaration">>;
349 def err_builtin_definition : Error<"definition of builtin function %0">;
350 def err_types_compatible_p_in_cplusplus : Error<
351   "__builtin_types_compatible_p is not valid in C++">;
352 def warn_builtin_unknown : Warning<"use of unknown builtin %0">,
353   InGroup<ImplicitFunctionDeclare>, DefaultError;
354 def warn_dyn_class_memaccess : Warning<
355   "%select{destination for|source of|first operand of|second operand of}0 this "
356   "%1 call is a pointer to dynamic class %2; vtable pointer will be "
357   "%select{overwritten|copied|moved|compared}3">,
358   InGroup<DiagGroup<"dynamic-class-memaccess">>;
359 def note_bad_memaccess_silence : Note<
360   "explicitly cast the pointer to silence this warning">;
361 def warn_sizeof_pointer_expr_memaccess : Warning<
362   "'%0' call operates on objects of type %1 while the size is based on a " 
363   "different type %2">, 
364   InGroup<SizeofPointerMemaccess>;
365 def warn_sizeof_pointer_expr_memaccess_note : Note<
366   "did you mean to %select{dereference the argument to 'sizeof' (and multiply "
367   "it by the number of elements)|remove the addressof in the argument to "
368   "'sizeof' (and multiply it by the number of elements)|provide an explicit "
369   "length}0?">;
370 def warn_sizeof_pointer_type_memaccess : Warning<
371   "argument to 'sizeof' in %0 call is the same pointer type %1 as the "
372   "%select{destination|source}2; expected %3 or an explicit length">,
373   InGroup<SizeofPointerMemaccess>;
374 def warn_strlcpycat_wrong_size : Warning<
375   "size argument in %0 call appears to be size of the source; expected the size of "
376   "the destination">,
377   InGroup<DiagGroup<"strlcpy-strlcat-size">>;
378 def note_strlcpycat_wrong_size : Note<
379   "change size argument to be the size of the destination">;
380   
381 def warn_strncat_large_size : Warning<
382   "the value of the size argument in 'strncat' is too large, might lead to a " 
383   "buffer overflow">, InGroup<StrncatSize>;
384 def warn_strncat_src_size : Warning<"size argument in 'strncat' call appears " 
385   "to be size of the source">, InGroup<StrncatSize>;
386 def warn_strncat_wrong_size : Warning<
387   "the value of the size argument to 'strncat' is wrong">, InGroup<StrncatSize>;
388 def note_strncat_wrong_size : Note<
389   "change the argument to be the free space in the destination buffer minus " 
390   "the terminating null byte">;
391
392 /// main()
393 // static main() is not an error in C, just in C++.
394 def warn_static_main : Warning<"'main' should not be declared static">,
395     InGroup<Main>;
396 def err_static_main : Error<"'main' is not allowed to be declared static">;
397 def err_inline_main : Error<"'main' is not allowed to be declared inline">;
398 def ext_noreturn_main : ExtWarn<
399   "'main' is not allowed to be declared _Noreturn">, InGroup<Main>;
400 def note_main_remove_noreturn : Note<"remove '_Noreturn'">;
401 def err_constexpr_main : Error<
402   "'main' is not allowed to be declared constexpr">;
403 def err_main_template_decl : Error<"'main' cannot be a template">;
404 def err_main_returns_nonint : Error<"'main' must return 'int'">;
405 def ext_main_returns_nonint : ExtWarn<"return type of 'main' is not 'int'">,
406     InGroup<MainReturnType>;
407 def note_main_change_return_type : Note<"change return type to 'int'">;
408 def err_main_surplus_args : Error<"too many parameters (%0) for 'main': "
409     "must be 0, 2, or 3">;
410 def warn_main_one_arg : Warning<"only one parameter on 'main' declaration">,
411     InGroup<Main>;
412 def err_main_arg_wrong : Error<"%select{first|second|third|fourth}0 "
413     "parameter of 'main' (%select{argument count|argument array|environment|"
414     "platform-specific data}0) must be of type %1">;
415
416 /// parser diagnostics
417 def ext_no_declarators : ExtWarn<"declaration does not declare anything">,
418   InGroup<MissingDeclarations>;
419 def ext_typedef_without_a_name : ExtWarn<"typedef requires a name">,
420   InGroup<MissingDeclarations>;
421 def err_typedef_not_identifier : Error<"typedef name must be an identifier">;
422 def err_statically_allocated_object : Error<
423   "interface type cannot be statically allocated">;
424 def err_object_cannot_be_passed_returned_by_value : Error<
425   "interface type %1 cannot be %select{returned|passed}0 by value"
426   "; did you forget * in %1?">;
427 def err_parameters_retval_cannot_have_fp16_type : Error<
428   "%select{parameters|function return value}0 cannot have __fp16 type; did you forget * ?">;
429 def err_opencl_half_load_store : Error<
430   "%select{loading directly from|assigning directly to}0 pointer to type %1 is not allowed">;
431 def err_opencl_cast_to_half : Error<"casting to type %0 is not allowed">;
432 def err_opencl_half_declaration : Error<
433   "declaring variable of type %0 is not allowed">;
434 def err_opencl_half_argument : Error<
435   "declaring function argument of type %0 is not allowed; did you forget * ?">;
436 def err_opencl_half_return : Error<
437   "declaring function return value of type %0 is not allowed; did you forget * ?">;
438 def warn_enum_value_overflow : Warning<"overflow in enumeration value">;
439 def warn_pragma_options_align_reset_failed : Warning<
440   "#pragma options align=reset failed: %0">;
441 def err_pragma_options_align_mac68k_target_unsupported : Error<
442   "mac68k alignment pragma is not supported on this target">;
443 def warn_pragma_pack_invalid_alignment : Warning<
444   "expected #pragma pack parameter to be '1', '2', '4', '8', or '16'">;
445 // Follow the MSVC implementation.
446 def warn_pragma_pack_show : Warning<"value of #pragma pack(show) == %0">;
447 def warn_pragma_pack_pop_identifer_and_alignment : Warning<
448   "specifying both a name and alignment to 'pop' is undefined">;
449 def warn_pragma_pack_pop_failed : Warning<"#pragma pack(pop, ...) failed: %0">;
450
451 def warn_pragma_unused_undeclared_var : Warning<
452   "undeclared variable %0 used as an argument for '#pragma unused'">;
453 def warn_pragma_unused_expected_var_arg : Warning<
454   "only variables can be arguments to '#pragma unused'">;
455 def err_pragma_push_visibility_mismatch : Error<
456   "#pragma visibility push with no matching #pragma visibility pop">;
457 def note_surrounding_namespace_ends_here : Note<
458   "surrounding namespace with visibility attribute ends here">;
459 def err_pragma_pop_visibility_mismatch : Error<
460   "#pragma visibility pop with no matching #pragma visibility push">;
461 def note_surrounding_namespace_starts_here : Note<
462   "surrounding namespace with visibility attribute starts here">;
463
464 /// Objective-C parser diagnostics
465 def err_duplicate_class_def : Error<
466   "duplicate interface definition for class %0">;
467 def err_undef_superclass : Error<
468   "cannot find interface declaration for %0, superclass of %1">;
469 def err_forward_superclass : Error<
470   "attempting to use the forward class %0 as superclass of %1">;
471 def err_no_nsconstant_string_class : Error<
472   "cannot find interface declaration for %0">;
473 def err_recursive_superclass : Error<
474   "trying to recursively use %0 as superclass of %1">;
475 def warn_previous_alias_decl : Warning<"previously declared alias is ignored">;
476 def err_conflicting_aliasing_type : Error<"conflicting types for alias %0">;
477 def warn_undef_interface : Warning<"cannot find interface declaration for %0">;
478 def warn_duplicate_protocol_def : Warning<"duplicate protocol definition of %0 is ignored">;
479 def err_protocol_has_circular_dependency : Error<
480   "protocol has circular dependency">;
481 def err_undeclared_protocol : Error<"cannot find protocol declaration for %0">;
482 def warn_undef_protocolref : Warning<"cannot find protocol definition for %0">;
483 def warn_readonly_property : Warning<
484   "attribute 'readonly' of property %0 restricts attribute "
485   "'readwrite' of property inherited from %1">;
486
487 def warn_property_attribute : Warning<
488   "'%1' attribute on property %0 does not match the property inherited from %2">;
489 def warn_property_types_are_incompatible : Warning<
490   "property type %0 is incompatible with type %1 inherited from %2">;
491 def err_undef_interface : Error<"cannot find interface declaration for %0">;
492 def err_category_forward_interface : Error<
493   "cannot define %select{category|class extension}0 for undefined class %1">;
494 def err_class_extension_after_impl : Error<
495   "cannot declare class extension for %0 after class implementation">;
496 def note_implementation_declared : Note<
497   "class implementation is declared here">;
498 def note_while_in_implementation : Note<
499   "detected while default synthesizing properties in class implementation">;
500 def note_class_declared : Note<
501   "class is declared here">;
502 def note_receiver_is_id : Note<
503   "receiver is treated with 'id' type for purpose of method lookup">;
504 def note_suppressed_class_declare : Note<
505   "class with specified objc_requires_property_definitions attribute is declared here">;
506 def err_objc_root_class_subclass : Error<
507   "objc_root_class attribute may only be specified on a root class declaration">;
508 def warn_objc_root_class_missing : Warning<
509         "class %0 defined without specifying a base class">,
510   InGroup<ObjCRootClass>;
511 def note_objc_needs_superclass : Note<
512   "add a super class to fix this problem">;
513 def warn_dup_category_def : Warning<
514   "duplicate definition of category %1 on interface %0">;
515 def err_conflicting_super_class : Error<"conflicting super class name %0">;
516 def err_dup_implementation_class : Error<"reimplementation of class %0">;
517 def err_dup_implementation_category : Error<
518   "reimplementation of category %1 for class %0">;
519 def err_conflicting_ivar_type : Error<
520   "instance variable %0 has conflicting type%diff{: $ vs $|}1,2">;
521 def err_duplicate_ivar_declaration : Error<
522   "instance variable is already declared">;
523 def warn_on_superclass_use : Warning<
524   "class implementation may not have super class">;
525 def err_conflicting_ivar_bitwidth : Error<
526   "instance variable %0 has conflicting bit-field width">;
527 def err_conflicting_ivar_name : Error<
528   "conflicting instance variable names: %0 vs %1">;
529 def err_inconsistant_ivar_count : Error<
530   "inconsistent number of instance variables specified">;
531 def warn_undef_method_impl : Warning<"method definition for %0 not found">,
532   InGroup<DiagGroup<"incomplete-implementation">>;
533 def note_required_for_protocol_at : 
534   Note<"required for direct or indirect protocol %0">;
535
536 def warn_conflicting_overriding_ret_types : Warning<
537   "conflicting return type in "
538   "declaration of %0%diff{: $ vs $|}1,2">,
539   InGroup<OverridingMethodMismatch>, DefaultIgnore;
540
541 def warn_conflicting_ret_types : Warning<
542   "conflicting return type in "
543   "implementation of %0%diff{: $ vs $|}1,2">,
544   InGroup<MismatchedReturnTypes>;
545
546 def warn_conflicting_overriding_ret_type_modifiers : Warning<
547   "conflicting distributed object modifiers on return type "
548   "in declaration of %0">,
549   InGroup<OverridingMethodMismatch>, DefaultIgnore;
550
551 def warn_conflicting_ret_type_modifiers : Warning<
552   "conflicting distributed object modifiers on return type "
553   "in implementation of %0">,
554   InGroup<DistributedObjectModifiers>;
555
556 def warn_non_covariant_overriding_ret_types : Warning<
557   "conflicting return type in "
558   "declaration of %0: %1 vs %2">,
559   InGroup<OverridingMethodMismatch>, DefaultIgnore;
560
561 def warn_non_covariant_ret_types : Warning<
562   "conflicting return type in "
563   "implementation of %0: %1 vs %2">,
564   InGroup<MethodSignatures>, DefaultIgnore;
565
566 def warn_conflicting_overriding_param_types : Warning<
567   "conflicting parameter types in "
568   "declaration of %0%diff{: $ vs $|}1,2">,
569   InGroup<OverridingMethodMismatch>, DefaultIgnore;
570
571 def warn_conflicting_param_types : Warning<
572   "conflicting parameter types in "
573   "implementation of %0%diff{: $ vs $|}1,2">,
574   InGroup<MismatchedParameterTypes>;
575
576 def warn_conflicting_param_modifiers : Warning<
577   "conflicting distributed object modifiers on parameter type "
578   "in implementation of %0">,
579   InGroup<DistributedObjectModifiers>;
580
581 def warn_conflicting_overriding_param_modifiers : Warning<
582   "conflicting distributed object modifiers on parameter type "
583   "in declaration of %0">,
584   InGroup<OverridingMethodMismatch>, DefaultIgnore;
585
586 def warn_non_contravariant_overriding_param_types : Warning<
587   "conflicting parameter types in "
588   "declaration of %0: %1 vs %2">,
589   InGroup<OverridingMethodMismatch>, DefaultIgnore;
590
591 def warn_non_contravariant_param_types : Warning<
592   "conflicting parameter types in "
593   "implementation of %0: %1 vs %2">,
594   InGroup<MethodSignatures>, DefaultIgnore;
595
596 def warn_conflicting_overriding_variadic :Warning<
597   "conflicting variadic declaration of method and its "
598   "implementation">,
599   InGroup<OverridingMethodMismatch>, DefaultIgnore;
600
601 def warn_conflicting_variadic :Warning<
602   "conflicting variadic declaration of method and its "
603   "implementation">;
604
605 def warn_category_method_impl_match:Warning<
606   "category is implementing a method which will also be implemented"
607   " by its primary class">, InGroup<ObjCProtocolMethodImpl>;
608
609 def warn_implements_nscopying : Warning<
610 "default assign attribute on property %0 which implements "
611 "NSCopying protocol is not appropriate with -fobjc-gc[-only]">;
612
613 def warn_multiple_method_decl : Warning<"multiple methods named %0 found">;
614 def warn_strict_multiple_method_decl : Warning<
615   "multiple methods named %0 found">, InGroup<StrictSelector>, DefaultIgnore;
616 def warn_accessor_property_type_mismatch : Warning<
617   "type of property %0 does not match type of accessor %1">;
618 def not_conv_function_declared_at : Note<"type conversion function declared here">;
619 def note_method_declared_at : Note<"method %0 declared here">;
620 def note_property_attribute : Note<"property %0 is declared "
621   "%select{deprecated|unavailable}1 here">;
622 def err_setter_type_void : Error<"type of setter must be void">;
623 def err_duplicate_method_decl : Error<"duplicate declaration of method %0">;
624 def warn_duplicate_method_decl : 
625   Warning<"multiple declarations of method %0 found and ignored">, 
626   InGroup<MethodDuplicate>, DefaultIgnore;
627 def err_objc_var_decl_inclass : 
628     Error<"cannot declare variable inside @interface or @protocol">;
629 def error_missing_method_context : Error<
630   "missing context for method declaration">;
631 def err_objc_property_attr_mutually_exclusive : Error<
632   "property attributes '%0' and '%1' are mutually exclusive">;
633 def err_objc_property_requires_object : Error<
634   "property with '%0' attribute must be of object type">;
635 def warn_objc_property_no_assignment_attribute : Warning<
636   "no 'assign', 'retain', or 'copy' attribute is specified - "
637   "'assign' is assumed">,
638   InGroup<ObjCPropertyNoAttribute>;
639 def warn_objc_isa_use : Warning<
640   "direct access to Objective-C's isa is deprecated in favor of "
641   "object_getClass()">, InGroup<DeprecatedObjCIsaUsage>;
642 def warn_objc_isa_assign : Warning<
643   "assignment to Objective-C's isa is deprecated in favor of "
644   "object_setClass()">, InGroup<DeprecatedObjCIsaUsage>;
645 def warn_objc_pointer_masking : Warning<
646   "bitmasking for introspection of Objective-C object pointers is strongly "
647   "discouraged">,
648   InGroup<DiagGroup<"deprecated-objc-pointer-introspection">>;
649 def warn_objc_property_default_assign_on_object : Warning<
650   "default property attribute 'assign' not appropriate for non-GC object">,
651   InGroup<ObjCPropertyNoAttribute>;
652 def warn_property_attr_mismatch : Warning<
653   "property attribute in class extension does not match the primary class">;
654 def warn_objc_property_copy_missing_on_block : Warning<
655     "'copy' attribute must be specified for the block property "
656     "when -fobjc-gc-only is specified">;
657 def warn_objc_property_retain_of_block : Warning<
658     "retain'ed block property does not copy the block "
659     "- use copy attribute instead">, InGroup<ObjCRetainBlockProperty>;
660 def warn_objc_readonly_property_has_setter : Warning<
661     "setter cannot be specified for a readonly property">,
662     InGroup<ObjCReadonlyPropertyHasSetter>;
663 def warn_atomic_property_rule : Warning<
664   "writable atomic property %0 cannot pair a synthesized %select{getter|setter}1 "
665   "with a user defined %select{getter|setter}2">,
666   InGroup<DiagGroup<"atomic-property-with-user-defined-accessor">>;
667 def note_atomic_property_fixup_suggest : Note<"setter and getter must both be "
668   "synthesized, or both be user defined,or the property must be nonatomic">;
669 def err_atomic_property_nontrivial_assign_op : Error<
670   "atomic property of reference type %0 cannot have non-trivial assignment"
671   " operator">;
672 def warn_owning_getter_rule : Warning<
673   "property's synthesized getter follows Cocoa naming"
674   " convention for returning 'owned' objects">,
675   InGroup<DiagGroup<"objc-property-matches-cocoa-ownership-rule">>;
676 def warn_auto_synthesizing_protocol_property :Warning<
677   "auto property synthesis will not synthesize property"
678   " declared in a protocol">,
679   InGroup<DiagGroup<"objc-protocol-property-synthesis">>;
680 def warn_no_autosynthesis_shared_ivar_property : Warning <
681   "auto property synthesis will not synthesize property "
682   "'%0' because it cannot share an ivar with another synthesized property">,
683   InGroup<ObjCNoPropertyAutoSynthesis>;
684 def warn_no_autosynthesis_property : Warning<
685   "auto property synthesis will not synthesize property "
686   "'%0' because it is 'readwrite' but it will be synthesized 'readonly' "
687   "via another property">,
688   InGroup<ObjCNoPropertyAutoSynthesis>;
689 def warn_autosynthesis_property_ivar_match :Warning<
690   "autosynthesized property %0 will use %select{|synthesized}1 instance variable "
691   "%2, not existing instance variable %3">,
692   InGroup<DiagGroup<"objc-autosynthesis-property-ivar-name-match">>;
693 def warn_missing_explicit_synthesis : Warning <
694   "auto property synthesis is synthesizing property not explicitly synthesized">,
695   InGroup<DiagGroup<"objc-missing-property-synthesis">>, DefaultIgnore;
696 def warn_property_getter_owning_mismatch : Warning<
697   "property declared as returning non-retained objects"
698   "; getter returning retained objects">;
699 def error_property_setter_ambiguous_use : Error<
700   "synthesized properties '%0' and '%1' both claim setter %2 -"
701   " use of this setter will cause unexpected behavior">;
702 def err_ownin_getter_rule : Error<
703   "property's synthesized getter follows Cocoa naming"
704   " convention for returning 'owned' objects">;
705 def warn_default_atomic_custom_getter_setter : Warning<
706   "atomic by default property %0 has a user defined %select{getter|setter}1 "
707   "(property should be marked 'atomic' if this is intended)">,
708   InGroup<CustomAtomic>, DefaultIgnore;
709 def err_use_continuation_class : Error<
710   "illegal redeclaration of property in class extension %0"
711   " (attribute must be 'readwrite', while its primary must be 'readonly')">;
712 def err_type_mismatch_continuation_class : Error<
713   "type of property %0 in class extension does not match "
714   "property type in primary class">;
715 def err_use_continuation_class_redeclaration_readwrite : Error<
716   "illegal redeclaration of 'readwrite' property in class extension %0"
717   " (perhaps you intended this to be a 'readwrite' redeclaration of a "
718   "'readonly' public property?)">;
719 def err_continuation_class : Error<"class extension has no primary class">;
720 def err_property_type : Error<"property cannot have array or function type %0">;
721 def error_missing_property_context : Error<
722   "missing context for property implementation declaration">;
723 def error_bad_property_decl : Error<
724   "property implementation must have its declaration in interface %0">;
725 def error_category_property : Error<
726   "property declared in category %0 cannot be implemented in "
727   "class implementation">;
728 def note_property_declare : Note<
729   "property declared here">;
730 def note_property_synthesize : Note<
731   "property synthesized here">;
732 def error_synthesize_category_decl : Error<
733   "@synthesize not allowed in a category's implementation">;
734 def error_reference_property : Error<
735   "property of reference type is not supported">;
736 def error_missing_property_interface : Error<
737   "property implementation in a category with no category declaration">;
738 def error_bad_category_property_decl : Error<
739   "property implementation must have its declaration in the category %0">;
740 def error_bad_property_context : Error<
741   "property implementation must be in a class or category implementation">;
742 def error_missing_property_ivar_decl : Error<
743   "synthesized property %0 must either be named the same as a compatible"
744   " instance variable or must explicitly name an instance variable">;
745 def error_synthesize_weak_non_arc_or_gc : Error<
746   "@synthesize of 'weak' property is only allowed in ARC or GC mode">;
747 def err_arc_perform_selector_retains : Error<
748   "performSelector names a selector which retains the object">;
749 def warn_arc_perform_selector_leaks : Warning<
750   "performSelector may cause a leak because its selector is unknown">,
751   InGroup<DiagGroup<"arc-performSelector-leaks">>;
752 def err_gc_weak_property_strong_type : Error<
753   "weak attribute declared on a __strong type property in GC mode">;
754 def warn_receiver_is_weak : Warning <
755   "weak %select{receiver|property|implicit property}0 may be "
756   "unpredictably set to nil">,
757   InGroup<DiagGroup<"receiver-is-weak">>, DefaultIgnore;
758 def note_arc_assign_to_strong : Note<
759   "assign the value to a strong variable to keep the object alive during use">;
760 def warn_arc_repeated_use_of_weak : Warning <
761   "weak %select{variable|property|implicit property|instance variable}0 %1 is "
762   "accessed multiple times in this %select{function|method|block|lambda}2 "
763   "but may be unpredictably set to nil; assign to a strong variable to keep "
764   "the object alive">,
765   InGroup<ARCRepeatedUseOfWeak>, DefaultIgnore;
766 def warn_implicitly_retains_self : Warning <
767   "block implicitly retains 'self'; explicitly mention 'self' to indicate "
768   "this is intended behavior">,
769   InGroup<DiagGroup<"implicit-retain-self">>, DefaultIgnore;
770 def warn_arc_possible_repeated_use_of_weak : Warning <
771   "weak %select{variable|property|implicit property|instance variable}0 %1 may "
772   "be accessed multiple times in this %select{function|method|block|lambda}2 "
773   "and may be unpredictably set to nil; assign to a strong variable to keep "
774   "the object alive">,
775   InGroup<ARCRepeatedUseOfWeakMaybe>, DefaultIgnore;
776 def note_arc_weak_also_accessed_here : Note<
777   "also accessed here">;
778 def err_incomplete_synthesized_property : Error<
779   "cannot synthesize property %0 with incomplete type %1">;
780
781 def error_property_ivar_type : Error<
782   "type of property %0 (%1) does not match type of instance variable %2 (%3)">;
783 def error_property_accessor_type : Error<
784   "type of property %0 (%1) does not match type of accessor %2 (%3)">;
785 def error_ivar_in_superclass_use : Error<
786   "property %0 attempting to use instance variable %1 declared in super class %2">;
787 def error_weak_property : Error<
788   "existing instance variable %1 for __weak property %0 must be __weak">;
789 def error_strong_property : Error<
790   "existing instance variable %1 for strong property %0 may not be __weak">;
791 def error_dynamic_property_ivar_decl : Error<
792   "dynamic property can not have instance variable specification">;
793 def error_duplicate_ivar_use : Error<
794   "synthesized properties %0 and %1 both claim instance variable %2">;
795 def error_property_implemented : Error<"property %0 is already implemented">;
796 def warn_objc_property_attr_mutually_exclusive : Warning<
797   "property attributes '%0' and '%1' are mutually exclusive">,
798   InGroup<ReadOnlySetterAttrs>, DefaultIgnore;
799 def warn_objc_missing_super_call : Warning<
800   "method possibly missing a [super %0] call">,
801   InGroup<ObjCMissingSuperCalls>;
802 def error_dealloc_bad_result_type : Error<
803   "dealloc return type must be correctly specified as 'void' under ARC, "
804   "instead of %0">;
805 def warn_undeclared_selector : Warning<
806   "undeclared selector %0">, InGroup<UndeclaredSelector>, DefaultIgnore;
807 def warn_implicit_atomic_property : Warning<
808   "property is assumed atomic by default">, InGroup<ImplicitAtomic>, DefaultIgnore;
809 def note_auto_readonly_iboutlet_fixup_suggest : Note<
810   "property should be changed to be readwrite">;
811 def warn_auto_readonly_iboutlet_property : Warning<
812   "readonly IBOutlet property '%0' when auto-synthesized may "
813   "not work correctly with 'nib' loader">,
814   InGroup<DiagGroup<"readonly-iboutlet-property">>;
815 def warn_auto_implicit_atomic_property : Warning<
816   "property is assumed atomic when auto-synthesizing the property">, 
817   InGroup<ImplicitAtomic>, DefaultIgnore;
818 def warn_unimplemented_selector:  Warning<
819   "unimplemented selector %0">, InGroup<Selector>, DefaultIgnore;
820 def warn_unimplemented_protocol_method : Warning<
821   "method %0 in protocol not implemented">, InGroup<Protocol>;
822
823 // C++ declarations
824 def err_static_assert_expression_is_not_constant : Error<
825   "static_assert expression is not an integral constant expression">;
826 def err_static_assert_failed : Error<"static_assert failed %0">;
827
828 def warn_inline_namespace_reopened_noninline : Warning<
829   "inline namespace cannot be reopened as a non-inline namespace">;
830 def err_inline_namespace_mismatch : Error<
831   "%select{|non-}0inline namespace "
832   "cannot be reopened as %select{non-|}0inline">;
833
834 def err_unexpected_friend : Error<
835   "friends can only be classes or functions">;
836 def ext_enum_friend : ExtWarn<
837   "enumeration type %0 cannot be a friend">;
838 def warn_cxx98_compat_enum_friend : Warning<
839   "befriending enumeration type %0 is incompatible with C++98">,
840   InGroup<CXX98Compat>, DefaultIgnore;
841 def ext_nonclass_type_friend : ExtWarn<
842   "non-class friend type %0 is a C++11 extension">, InGroup<CXX11>;
843 def warn_cxx98_compat_nonclass_type_friend : Warning<
844   "non-class friend type %0 is incompatible with C++98">,
845   InGroup<CXX98Compat>, DefaultIgnore;
846 def err_friend_is_member : Error<
847   "friends cannot be members of the declaring class">;
848 def warn_cxx98_compat_friend_is_member : Warning<
849   "friend declaration naming a member of the declaring class is incompatible "
850   "with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
851 def ext_unelaborated_friend_type : ExtWarn<
852   "unelaborated friend declaration is a C++11 extension; specify "
853   "'%select{struct|interface|union|class|enum}0' to befriend %1">,
854   InGroup<CXX11>;
855 def warn_cxx98_compat_unelaborated_friend_type : Warning<
856   "befriending %1 without '%select{struct|interface|union|class|enum}0' "
857   "keyword is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
858 def err_qualified_friend_not_found : Error<
859   "no function named %0 with type %1 was found in the specified scope">;
860 def err_introducing_special_friend : Error<
861   "must use a qualified name when declaring a %select{constructor|"
862   "destructor|conversion operator}0 as a friend">;
863 def err_tagless_friend_type_template : Error<
864   "friend type templates must use an elaborated type">;
865 def err_no_matching_local_friend : Error<
866   "no matching function found in local scope">;
867 def err_no_matching_local_friend_suggest : Error<
868   "no matching function %0 found in local scope; did you mean %2?">;
869 def err_partial_specialization_friend : Error<
870   "partial specialization cannot be declared as a friend">;
871 def err_qualified_friend_def : Error<
872   "friend function definition cannot be qualified with '%0'">;
873 def err_friend_def_in_local_class : Error<
874   "friend function cannot be defined in a local class">;
875 def err_friend_not_first_in_declaration : Error<
876   "'friend' must appear first in a non-function declaration">;
877 def err_using_decl_friend : Error<
878   "cannot befriend target of using declaration">;
879   
880 def err_invalid_member_in_interface : Error<
881   "%select{data member |non-public member function |static member function |"
882           "user-declared constructor|user-declared destructor|operator |"
883           "nested class }0%1 is not permitted within an interface type">;
884 def err_invalid_base_in_interface : Error<
885   "interface type cannot inherit from "
886   "%select{'struct|non-public 'interface|'class}0 %1'">;
887
888 def err_abstract_type_in_decl : Error<
889   "%select{return|parameter|variable|field|instance variable}0 type %1 is an abstract class">;
890 def err_allocation_of_abstract_type : Error<
891   "allocating an object of abstract class type %0">;
892 def err_throw_abstract_type : Error<
893   "cannot throw an object of abstract type %0">;
894 def err_array_of_abstract_type : Error<"array of abstract class type %0">;
895
896 def err_multiple_final_overriders : Error<
897   "virtual function %q0 has more than one final overrider in %1">; 
898 def note_final_overrider : Note<"final overrider of %q0 in %1">;
899
900 def err_type_defined_in_type_specifier : Error<
901   "%0 can not be defined in a type specifier">;
902 def err_type_defined_in_result_type : Error<
903   "%0 can not be defined in the result type of a function">;
904 def err_type_defined_in_param_type : Error<
905   "%0 can not be defined in a parameter type">;
906 def err_type_defined_in_alias_template : Error<
907   "%0 can not be defined in a type alias template">;
908
909 def note_pure_virtual_function : Note<
910   "unimplemented pure virtual method %0 in %1">;
911
912 def err_deleted_decl_not_first : Error<
913   "deleted definition must be first declaration">;
914
915 def err_deleted_override : Error<
916   "deleted function %0 cannot override a non-deleted function">;
917
918 def err_non_deleted_override : Error<
919   "non-deleted function %0 cannot override a deleted function">;
920
921 def warn_weak_vtable : Warning<
922   "%0 has no out-of-line virtual method definitions; its vtable will be "
923   "emitted in every translation unit">,
924   InGroup<DiagGroup<"weak-vtables">>, DefaultIgnore;
925 def warn_weak_template_vtable : Warning<
926   "explicit template instantiation %0 will emit a vtable in every "
927   "translation unit">,
928   InGroup<DiagGroup<"weak-template-vtables">>, DefaultIgnore;
929
930 def ext_using_undefined_std : ExtWarn<
931   "using directive refers to implicitly-defined namespace 'std'">;
932   
933 // C++ exception specifications
934 def err_exception_spec_in_typedef : Error<
935   "exception specifications are not allowed in %select{typedefs|type aliases}0">;
936 def err_distant_exception_spec : Error<
937   "exception specifications are not allowed beyond a single level "
938   "of indirection">;
939 def err_incomplete_in_exception_spec : Error<
940   "%select{|pointer to |reference to }0incomplete type %1 is not allowed "
941   "in exception specification">;
942 def err_rref_in_exception_spec : Error<
943   "rvalue reference type %0 is not allowed in exception specification">;
944 def err_mismatched_exception_spec : Error<
945   "exception specification in declaration does not match previous declaration">;
946 def warn_mismatched_exception_spec : ExtWarn<
947   "exception specification in declaration does not match previous declaration">;
948 def err_override_exception_spec : Error<
949   "exception specification of overriding function is more lax than "
950   "base version">;
951 def warn_override_exception_spec : ExtWarn<
952   "exception specification of overriding function is more lax than "
953   "base version">, InGroup<Microsoft>;
954 def err_incompatible_exception_specs : Error<
955   "target exception specification is not superset of source">;
956 def err_deep_exception_specs_differ : Error<
957   "exception specifications of %select{return|argument}0 types differ">;
958 def warn_missing_exception_specification : Warning<
959   "%0 is missing exception specification '%1'">;
960 def err_noexcept_needs_constant_expression : Error<
961   "argument to noexcept specifier must be a constant expression">;
962
963 // C++ access checking
964 def err_class_redeclared_with_different_access : Error<
965   "%0 redeclared with '%1' access">;
966 def err_access : Error<
967   "%1 is a %select{private|protected}0 member of %3">, AccessControl;
968 def ext_ms_using_declaration_inaccessible : ExtWarn<
969   "using declaration referring to inaccessible member '%0' (which refers "
970   "to accessible member '%1') is a Microsoft compatibility extension">,
971     AccessControl, InGroup<Microsoft>;
972 def err_access_ctor : Error<
973   "calling a %select{private|protected}0 constructor of class %2">, 
974   AccessControl;
975 def ext_rvalue_to_reference_access_ctor : ExtWarn<
976   "C++98 requires an accessible copy constructor for class %2 when binding "
977   "a reference to a temporary; was %select{private|protected}0">,
978   AccessControl, InGroup<BindToTemporaryCopy>;
979 def err_access_base_ctor : Error<
980   // The ERRORs represent other special members that aren't constructors, in
981   // hopes that someone will bother noticing and reporting if they appear
982   "%select{base class|inherited virtual base class}0 %1 has %select{private|"
983   "protected}3 %select{default |copy |move |*ERROR* |*ERROR* "
984   "|*ERROR*|}2constructor">, AccessControl;
985 def err_access_field_ctor : Error<
986   // The ERRORs represent other special members that aren't constructors, in
987   // hopes that someone will bother noticing and reporting if they appear
988   "field of type %0 has %select{private|protected}2 "
989   "%select{default |copy |move |*ERROR* |*ERROR* |*ERROR* |}1constructor">,
990   AccessControl;
991 def err_access_friend_function : Error<
992   "friend function %1 is a %select{private|protected}0 member of %3">,
993   AccessControl;
994
995 def err_access_dtor : Error<
996   "calling a %select{private|protected}1 destructor of class %0">, 
997   AccessControl;
998 def err_access_dtor_base :
999     Error<"base class %0 has %select{private|protected}1 destructor">,
1000     AccessControl;
1001 def err_access_dtor_vbase :
1002     Error<"inherited virtual base class %0 has "
1003     "%select{private|protected}1 destructor">,
1004     AccessControl;
1005 def err_access_dtor_temp :
1006     Error<"temporary of type %0 has %select{private|protected}1 destructor">,
1007     AccessControl;
1008 def err_access_dtor_exception :
1009     Error<"exception object of type %0 has %select{private|protected}1 "
1010           "destructor">, AccessControl;
1011 def err_access_dtor_field :
1012     Error<"field of type %1 has %select{private|protected}2 destructor">,
1013     AccessControl;
1014 def err_access_dtor_var :
1015     Error<"variable of type %1 has %select{private|protected}2 destructor">,
1016     AccessControl;
1017 def err_access_dtor_ivar :
1018     Error<"instance variable of type %0 has %select{private|protected}1 "
1019           "destructor">,
1020     AccessControl;
1021 def note_previous_access_declaration : Note<
1022   "previously declared '%1' here">;
1023 def note_access_natural : Note<
1024   "%select{|implicitly }1declared %select{private|protected}0 here">;
1025 def note_access_constrained_by_path : Note<
1026   "constrained by %select{|implicitly }1%select{private|protected}0"
1027   " inheritance here">;
1028 def note_access_protected_restricted_noobject : Note<
1029   "must name member using the type of the current context %0">;
1030 def note_access_protected_restricted_ctordtor : Note<
1031   "protected %select{constructor|destructor}0 can only be used to "
1032   "%select{construct|destroy}0 a base class subobject">;
1033 def note_access_protected_restricted_object : Note<
1034   "can only access this member on an object of type %0">;
1035 def warn_cxx98_compat_sfinae_access_control : Warning<
1036   "substitution failure due to access control is incompatible with C++98">,
1037   InGroup<CXX98Compat>, DefaultIgnore, NoSFINAE;
1038   
1039 // C++ name lookup
1040 def err_incomplete_nested_name_spec : Error<
1041   "incomplete type %0 named in nested name specifier">;
1042 def err_dependent_nested_name_spec : Error<
1043   "nested name specifier for a declaration cannot depend on a template "
1044   "parameter">;
1045 def err_nested_name_member_ref_lookup_ambiguous : Error<
1046   "lookup of %0 in member access expression is ambiguous">;
1047 def ext_nested_name_member_ref_lookup_ambiguous : ExtWarn<
1048   "lookup of %0 in member access expression is ambiguous; using member of %1">,
1049   InGroup<AmbigMemberTemplate>;
1050 def note_ambig_member_ref_object_type : Note<
1051   "lookup in the object type %0 refers here">;
1052 def note_ambig_member_ref_scope : Note<
1053   "lookup from the current scope refers here">;
1054 def err_qualified_member_nonclass : Error<
1055   "qualified member access refers to a member in %0">;
1056 def err_incomplete_member_access : Error<
1057   "member access into incomplete type %0">;
1058 def err_incomplete_type : Error<
1059   "incomplete type %0 where a complete type is required">;
1060 def warn_cxx98_compat_enum_nested_name_spec : Warning<
1061   "enumeration type in nested name specifier is incompatible with C++98">,
1062   InGroup<CXX98Compat>, DefaultIgnore;
1063   
1064 // C++ class members
1065 def err_storageclass_invalid_for_member : Error<
1066   "storage class specified for a member declaration">;
1067 def err_mutable_function : Error<"'mutable' cannot be applied to functions">;
1068 def err_mutable_reference : Error<"'mutable' cannot be applied to references">;
1069 def err_mutable_const : Error<"'mutable' and 'const' cannot be mixed">;
1070 def err_mutable_nonmember : Error<
1071   "'mutable' can only be applied to member variables">;
1072 def err_virtual_non_function : Error<
1073   "'virtual' can only appear on non-static member functions">;
1074 def err_virtual_out_of_class : Error<
1075   "'virtual' can only be specified inside the class definition">;
1076 def err_virtual_member_function_template : Error<
1077   "'virtual' can not be specified on member function templates">;
1078 def err_static_overrides_virtual : Error<
1079   "'static' member function %0 overrides a virtual function in a base class">;
1080 def err_explicit_non_function : Error<
1081   "'explicit' can only appear on non-static member functions">;
1082 def err_explicit_out_of_class : Error<
1083   "'explicit' can only be specified inside the class definition">;
1084 def err_explicit_non_ctor_or_conv_function : Error<
1085   "'explicit' can only be applied to a constructor or conversion function">;
1086 def err_static_not_bitfield : Error<"static member %0 cannot be a bit-field">;
1087 def err_static_out_of_line : Error<
1088   "'static' can only be specified inside the class definition">;
1089 def err_typedef_not_bitfield : Error<"typedef member %0 cannot be a bit-field">;
1090 def err_not_integral_type_bitfield : Error<
1091   "bit-field %0 has non-integral type %1">;
1092 def err_not_integral_type_anon_bitfield : Error<
1093   "anonymous bit-field has non-integral type %0">;
1094 def err_member_function_initialization : Error<
1095   "initializer on function does not look like a pure-specifier">;
1096 def err_non_virtual_pure : Error<
1097   "%0 is not virtual and cannot be declared pure">;
1098 def warn_pure_function_definition : ExtWarn<
1099   "function definition with pure-specifier is a Microsoft extension">,
1100   InGroup<Microsoft>;
1101 def err_implicit_object_parameter_init : Error<
1102   "cannot initialize object parameter of type %0 with an expression "
1103   "of type %1">;
1104 def err_qualified_member_of_unrelated : Error<
1105   "%q0 is not a member of class %1">;
1106
1107 def warn_call_to_pure_virtual_member_function_from_ctor_dtor : Warning<
1108   "call to pure virtual member function %0; overrides of %0 in subclasses are "
1109   "not available in the %select{constructor|destructor}1 of %2">;
1110
1111 def note_field_decl : Note<"member is declared here">;
1112 def note_ivar_decl : Note<"instance variable is declared here">;
1113 def note_bitfield_decl : Note<"bit-field is declared here">;
1114 def note_previous_decl : Note<"%0 declared here">;
1115 def note_implicit_param_decl : Note<"%0 is an implicit parameter">;
1116 def note_member_synthesized_at : Note<
1117   "implicit default %select{constructor|copy constructor|move constructor|copy "
1118   "assignment operator|move assignment operator|destructor}0 for %1 first "
1119   "required here">;
1120 def note_inhctor_synthesized_at : Note<
1121   "inheriting constructor for %0 first required here">;
1122 def err_missing_default_ctor : Error<
1123   "%select{|implicit default |inheriting }0constructor for %1 must explicitly "
1124   "initialize the %select{base class|member}2 %3 which does not have a default "
1125   "constructor">;
1126
1127 def err_illegal_union_or_anon_struct_member : Error<
1128   "%select{anonymous struct|union}0 member %1 has a non-trivial "
1129   "%select{constructor|copy constructor|move constructor|copy assignment "
1130   "operator|move assignment operator|destructor}2">;
1131 def warn_cxx98_compat_nontrivial_union_or_anon_struct_member : Warning<
1132   "%select{anonymous struct|union}0 member %1 with a non-trivial "
1133   "%select{constructor|copy constructor|move constructor|copy assignment "
1134   "operator|move assignment operator|destructor}2 is incompatible with C++98">,
1135   InGroup<CXX98Compat>, DefaultIgnore;
1136
1137 def note_nontrivial_virtual_dtor : Note<
1138   "destructor for %0 is not trivial because it is virtual">;
1139 def note_nontrivial_has_virtual : Note<
1140   "because type %0 has a virtual %select{member function|base class}1">;
1141 def note_nontrivial_no_def_ctor : Note<
1142   "because %select{base class of |field of |}0type %1 has no "
1143   "default constructor">;
1144 def note_user_declared_ctor : Note<
1145   "implicit default constructor suppressed by user-declared constructor">;
1146 def note_nontrivial_no_copy : Note<
1147   "because no %select{<<ERROR>>|constructor|constructor|assignment operator|"
1148   "assignment operator|<<ERROR>>}2 can be used to "
1149   "%select{<<ERROR>>|copy|move|copy|move|<<ERROR>>}2 "
1150   "%select{base class|field|an object}0 of type %3">;
1151 def note_nontrivial_user_provided : Note<
1152   "because %select{base class of |field of |}0type %1 has a user-provided "
1153   "%select{default constructor|copy constructor|move constructor|"
1154   "copy assignment operator|move assignment operator|destructor}2">;
1155 def note_nontrivial_in_class_init : Note<
1156   "because field %0 has an initializer">;
1157 def note_nontrivial_param_type : Note<
1158   "because its parameter is %diff{of type $, not $|of the wrong type}2,3">;
1159 def note_nontrivial_default_arg : Note<"because it has a default argument">;
1160 def note_nontrivial_variadic : Note<"because it is a variadic function">;
1161 def note_nontrivial_subobject : Note<
1162   "because the function selected to %select{construct|copy|move|copy|move|"
1163   "destroy}2 %select{base class|field}0 of type %1 is not trivial">;
1164 def note_nontrivial_objc_ownership : Note<
1165   "because type %0 has a member with %select{no|no|__strong|__weak|"
1166   "__autoreleasing}1 ownership">;
1167
1168 def err_static_data_member_not_allowed_in_anon_struct : Error<
1169   "static data member %0 not allowed in anonymous struct">;
1170 def ext_static_data_member_in_union : ExtWarn<
1171   "static data member %0 in union is a C++11 extension">, InGroup<CXX11>;
1172 def warn_cxx98_compat_static_data_member_in_union : Warning<
1173   "static data member %0 in union is incompatible with C++98">,
1174   InGroup<CXX98Compat>, DefaultIgnore;
1175 def err_union_member_of_reference_type : Error<
1176   "union member %0 has reference type %1">;
1177 def ext_anonymous_struct_union_qualified : Extension<
1178   "anonymous %select{struct|union}0 cannot be '%1'">;
1179 def err_different_return_type_for_overriding_virtual_function : Error<
1180   "virtual function %0 has a different return type "
1181   "%diff{($) than the function it overrides (which has return type $)|"
1182   "than the function it overrides}1,2">;
1183 def note_overridden_virtual_function : Note<
1184   "overridden virtual function is here">;
1185 def err_conflicting_overriding_cc_attributes : Error<
1186   "virtual function %0 has different calling convention attributes "
1187   "%diff{($) than the function it overrides (which has calling convention $)|"
1188   "than the function it overrides}1,2">;
1189
1190 def err_covariant_return_inaccessible_base : Error<
1191   "invalid covariant return for virtual function: %1 is a "
1192   "%select{private|protected}2 base class of %0">, AccessControl;
1193 def err_covariant_return_ambiguous_derived_to_base_conv : Error<
1194   "return type of virtual function %3 is not covariant with the return type of "
1195   "the function it overrides (ambiguous conversion from derived class "
1196   "%0 to base class %1:%2)">;
1197 def err_covariant_return_not_derived : Error<
1198   "return type of virtual function %0 is not covariant with the return type of "
1199   "the function it overrides (%1 is not derived from %2)">;
1200 def err_covariant_return_incomplete : Error<
1201   "return type of virtual function %0 is not covariant with the return type of "
1202   "the function it overrides (%1 is incomplete)">;
1203 def err_covariant_return_type_different_qualifications : Error<
1204   "return type of virtual function %0 is not covariant with the return type of "
1205   "the function it overrides (%1 has different qualifiers than %2)">;
1206 def err_covariant_return_type_class_type_more_qualified : Error<
1207   "return type of virtual function %0 is not covariant with the return type of "
1208   "the function it overrides (class type %1 is more qualified than class "
1209   "type %2">;
1210   
1211 // C++ constructors
1212 def err_constructor_cannot_be : Error<"constructor cannot be declared '%0'">;
1213 def err_invalid_qualified_constructor : Error<
1214   "'%0' qualifier is not allowed on a constructor">;
1215 def err_ref_qualifier_constructor : Error<
1216   "ref-qualifier '%select{&&|&}0' is not allowed on a constructor">;
1217
1218 def err_constructor_return_type : Error<
1219   "constructor cannot have a return type">;
1220 def err_constructor_redeclared : Error<"constructor cannot be redeclared">;
1221 def err_constructor_byvalue_arg : Error<
1222   "copy constructor must pass its first argument by reference">;
1223 def warn_no_constructor_for_refconst : Warning<
1224   "%select{struct|interface|union|class|enum}0 %1 does not declare any "
1225   "constructor to initialize its non-modifiable members">;
1226 def note_refconst_member_not_initialized : Note<
1227   "%select{const|reference}0 member %1 will never be initialized">;
1228 def ext_ms_explicit_constructor_call : ExtWarn<
1229   "explicit constructor calls are a Microsoft extension">, InGroup<Microsoft>;
1230
1231 // C++ destructors
1232 def err_destructor_not_member : Error<
1233   "destructor must be a non-static member function">;
1234 def err_destructor_cannot_be : Error<"destructor cannot be declared '%0'">;
1235 def err_invalid_qualified_destructor : Error<
1236   "'%0' qualifier is not allowed on a destructor">;
1237 def err_ref_qualifier_destructor : Error<
1238   "ref-qualifier '%select{&&|&}0' is not allowed on a destructor">;
1239 def err_destructor_return_type : Error<"destructor cannot have a return type">;
1240 def err_destructor_redeclared : Error<"destructor cannot be redeclared">;
1241 def err_destructor_with_params : Error<"destructor cannot have any parameters">;
1242 def err_destructor_variadic : Error<"destructor cannot be variadic">;
1243 def err_destructor_typedef_name : Error<
1244   "destructor cannot be declared using a %select{typedef|type alias}1 %0 of the class name">;
1245 def err_destructor_name : Error<
1246   "expected the class name after '~' to name the enclosing class">;
1247 def err_destructor_class_name : Error<
1248   "expected the class name after '~' to name a destructor">;
1249 def err_ident_in_dtor_not_a_type : Error<
1250   "identifier %0 in object destruction expression does not name a type">;
1251 def err_destructor_expr_type_mismatch : Error<
1252   "destructor type %0 in object destruction expression does not match the "
1253   "type %1 of the object being destroyed">;
1254 def note_destructor_type_here : Note<
1255   "type %0 is declared here">;
1256
1257 def err_destructor_template : Error<
1258   "destructor cannot be declared as a template">;
1259
1260 // C++ initialization
1261 def err_init_conversion_failed : Error<
1262   "cannot initialize %select{a variable|a parameter|return object|an "
1263   "exception object|a member subobject|an array element|a new value|a value|a "
1264   "base class|a constructor delegation|a vector element}0 "
1265   "%diff{of type $ with an %select{rvalue|lvalue}2 of type $|"
1266   "with an %select{rvalue|lvalue}2 of incompatible type}1,3"
1267   "%select{|: different classes%diff{ ($ vs $)|}5,6"
1268   "|: different number of parameters (%5 vs %6)"
1269   "|: type mismatch at %ordinal5 parameter%diff{ ($ vs $)|}6,7"
1270   "|: different return type%diff{ ($ vs $)|}5,6"
1271   "|: different qualifiers ("
1272   "%select{none|const|restrict|const and restrict|volatile|const and volatile|"
1273   "volatile and restrict|const, volatile, and restrict}5 vs "
1274   "%select{none|const|restrict|const and restrict|volatile|const and volatile|"
1275   "volatile and restrict|const, volatile, and restrict}6)}4">;
1276
1277 def err_lvalue_to_rvalue_ref : Error<"rvalue reference %diff{to type $ cannot "
1278   "bind to lvalue of type $|cannot bind to incompatible lvalue}0,1">;
1279 def err_lvalue_reference_bind_to_initlist : Error<
1280   "%select{non-const|volatile}0 lvalue reference to type %1 cannot bind to an "
1281   "initializer list temporary">;
1282 def err_lvalue_reference_bind_to_temporary : Error<
1283   "%select{non-const|volatile}0 lvalue reference %diff{to type $ cannot bind "
1284   "to a temporary of type $|cannot bind to incompatible temporary}1,2">;
1285 def err_lvalue_reference_bind_to_unrelated : Error<
1286   "%select{non-const|volatile}0 lvalue reference "
1287   "%diff{to type $ cannot bind to a value of unrelated type $|"
1288   "cannot bind to a value of unrelated type}1,2">;
1289 def err_reference_bind_drops_quals : Error<
1290   "binding of reference %diff{to type $ to a value of type $ drops qualifiers|"
1291   "drops qualifiers}0,1">;
1292 def err_reference_bind_failed : Error<
1293   "reference %diff{to type $ could not bind to an %select{rvalue|lvalue}1 of "
1294   "type $|could not bind to %select{rvalue|lvalue}1 of incompatible type}0,2">;
1295 def err_reference_bind_init_list : Error<
1296   "reference to type %0 cannot bind to an initializer list">;
1297 def warn_temporary_array_to_pointer_decay : Warning<
1298   "pointer is initialized by a temporary array, which will be destroyed at the "
1299   "end of the full-expression">,
1300   InGroup<DiagGroup<"address-of-array-temporary">>;
1301 def err_init_list_bad_dest_type : Error<
1302   "%select{|non-aggregate }0type %1 cannot be initialized with an initializer "
1303   "list">;
1304 def err_member_function_call_bad_cvr : Error<"member function %0 not viable: "
1305     "'this' argument has type %1, but function is not marked "
1306     "%select{const|restrict|const or restrict|volatile|const or volatile|"
1307     "volatile or restrict|const, volatile, or restrict}2">;
1308
1309 def err_reference_bind_to_bitfield : Error<
1310   "%select{non-const|volatile}0 reference cannot bind to "
1311   "bit-field%select{| %1}2">;
1312 def err_reference_bind_to_vector_element : Error<
1313   "%select{non-const|volatile}0 reference cannot bind to vector element">;
1314 def err_reference_var_requires_init : Error<
1315   "declaration of reference variable %0 requires an initializer">;
1316 def err_reference_without_init : Error<
1317   "reference to type %0 requires an initializer">;
1318 def note_value_initialization_here : Note<
1319   "in value-initialization of type %0 here">;
1320 def err_reference_has_multiple_inits : Error<
1321   "reference cannot be initialized with multiple values">;
1322 def err_init_non_aggr_init_list : Error<
1323   "initialization of non-aggregate type %0 with an initializer list">;
1324 def err_init_reference_member_uninitialized : Error<
1325   "reference member of type %0 uninitialized">;
1326 def note_uninit_reference_member : Note<
1327   "uninitialized reference member is here">;
1328 def warn_field_is_uninit : Warning<"field %0 is uninitialized when used here">,
1329   InGroup<Uninitialized>;
1330 def warn_reference_field_is_uninit : Warning<
1331   "reference %0 is not yet bound to a value when used here">,
1332   InGroup<Uninitialized>;
1333 def warn_static_self_reference_in_init : Warning<
1334   "static variable %0 is suspiciously used within its own initialization">,
1335   InGroup<UninitializedStaticSelfInit>;
1336 def warn_uninit_self_reference_in_init : Warning<
1337   "variable %0 is uninitialized when used within its own initialization">,
1338   InGroup<Uninitialized>;
1339 def warn_uninit_self_reference_in_reference_init : Warning<
1340   "reference %0 is not yet bound to a value when used within its own"
1341   " initialization">,
1342   InGroup<Uninitialized>;
1343 def warn_uninit_var : Warning<
1344   "variable %0 is uninitialized when %select{used here|captured by block}1">,
1345   InGroup<Uninitialized>, DefaultIgnore;
1346 def warn_sometimes_uninit_var : Warning<
1347   "variable %0 is %select{used|captured}1 uninitialized whenever "
1348   "%select{'%3' condition is %select{true|false}4|"
1349   "'%3' loop %select{is entered|exits because its condition is false}4|"
1350   "'%3' loop %select{condition is true|exits because its condition is false}4|"
1351   "switch %3 is taken}2">, InGroup<UninitializedSometimes>, DefaultIgnore;
1352 def warn_maybe_uninit_var : Warning<
1353   "variable %0 may be uninitialized when "
1354   "%select{used here|captured by block}1">,
1355   InGroup<UninitializedMaybe>, DefaultIgnore;
1356 def note_uninit_var_def : Note<"variable %0 is declared here">;
1357 def note_uninit_var_use : Note<
1358   "%select{uninitialized use occurs|variable is captured by block}0 here">;
1359 def warn_uninit_byref_blockvar_captured_by_block : Warning<
1360   "block pointer variable %0 is uninitialized when captured by block">,
1361   InGroup<Uninitialized>, DefaultIgnore;
1362 def note_block_var_fixit_add_initialization : Note<
1363   "maybe you meant to use __block %0">;
1364 def note_var_fixit_add_initialization : Note<
1365   "initialize the variable %0 to silence this warning">;
1366 def note_uninit_fixit_remove_cond : Note<
1367   "remove the %select{'%1' if its condition|condition if it}0 "
1368   "is always %select{false|true}2">;
1369 def err_init_incomplete_type : Error<"initialization of incomplete type %0">;
1370
1371 def warn_unsequenced_mod_mod : Warning<
1372   "multiple unsequenced modifications to %0">, InGroup<Unsequenced>;
1373 def warn_unsequenced_mod_use : Warning<
1374   "unsequenced modification and access to %0">, InGroup<Unsequenced>;
1375
1376 def err_temp_copy_no_viable : Error<
1377   "no viable constructor %select{copying variable|copying parameter|"
1378   "returning object|throwing object|copying member subobject|copying array "
1379   "element|allocating object|copying temporary|initializing base subobject|"
1380   "initializing vector element|capturing value}0 of type %1">;
1381 def ext_rvalue_to_reference_temp_copy_no_viable : ExtWarn<
1382   "no viable constructor %select{copying variable|copying parameter|"
1383   "returning object|throwing object|copying member subobject|copying array "
1384   "element|allocating object|copying temporary|initializing base subobject|"
1385   "initializing vector element|capturing value}0 of type %1; C++98 requires a copy "
1386   "constructor when binding a reference to a temporary">,
1387   InGroup<BindToTemporaryCopy>;
1388 def err_temp_copy_ambiguous : Error<
1389   "ambiguous constructor call when %select{copying variable|copying "
1390   "parameter|returning object|throwing object|copying member subobject|copying "
1391   "array element|allocating object|copying temporary|initializing base subobject|"
1392   "initializing vector element|capturing value}0 of type %1">;
1393 def err_temp_copy_deleted : Error<
1394   "%select{copying variable|copying parameter|returning object|throwing "
1395   "object|copying member subobject|copying array element|allocating object|"
1396   "copying temporary|initializing base subobject|initializing vector element|"
1397   "capturing value}0 of type %1 invokes deleted constructor">;
1398 def err_temp_copy_incomplete : Error<
1399   "copying a temporary object of incomplete type %0">;
1400 def warn_cxx98_compat_temp_copy : Warning<
1401   "%select{copying variable|copying parameter|returning object|throwing "
1402   "object|copying member subobject|copying array element|allocating object|"
1403   "copying temporary|initializing base subobject|initializing vector element}1 "
1404   "of type %2 when binding a reference to a temporary would %select{invoke "
1405   "an inaccessible constructor|find no viable constructor|find ambiguous "
1406   "constructors|invoke a deleted constructor}0 in C++98">,
1407   InGroup<CXX98CompatBindToTemporaryCopy>, DefaultIgnore;
1408 def err_selected_explicit_constructor : Error<
1409   "chosen constructor is explicit in copy-initialization">;
1410 def note_constructor_declared_here : Note<
1411   "constructor declared here">;
1412
1413 // C++11 decltype
1414 def err_decltype_in_declarator : Error<
1415     "'decltype' cannot be used to name a declaration">;
1416     
1417 // C++11 auto
1418 def warn_cxx98_compat_auto_type_specifier : Warning<
1419   "'auto' type specifier is incompatible with C++98">,
1420   InGroup<CXX98Compat>, DefaultIgnore;
1421 def err_auto_variable_cannot_appear_in_own_initializer : Error<
1422   "variable %0 declared with 'auto' type cannot appear in its own initializer">;
1423 def err_illegal_decl_array_of_auto : Error<
1424   "'%0' declared as array of %1">;
1425 def err_new_array_of_auto : Error<
1426   "cannot allocate array of 'auto'">;
1427 def err_auto_not_allowed : Error<
1428   "'auto' not allowed %select{in function prototype|in non-static struct member"
1429   "|in non-static union member|in non-static class member|in interface member"
1430   "|in exception declaration|in template parameter|in block literal"
1431   "|in template argument|in typedef|in type alias|in function return type"
1432   "|in conversion function type|here}0">;
1433 def err_auto_var_requires_init : Error<
1434   "declaration of variable %0 with type %1 requires an initializer">;
1435 def err_auto_new_requires_ctor_arg : Error<
1436   "new expression for type %0 requires a constructor argument">;
1437 def err_auto_new_requires_parens : Error<
1438   "new expression for type %0 cannot use list-initialization">;
1439 def err_auto_var_init_no_expression : Error<
1440   "initializer for variable %0 with type %1 is empty">;
1441 def err_auto_var_init_multiple_expressions : Error<
1442   "initializer for variable %0 with type %1 contains multiple expressions">;
1443 def err_auto_new_ctor_multiple_expressions : Error<
1444   "new expression for type %0 contains multiple constructor arguments">;
1445 def err_auto_missing_trailing_return : Error<
1446   "'auto' return without trailing return type">;
1447 def err_trailing_return_without_auto : Error<
1448   "function with trailing return type must specify return type 'auto', not %0">;
1449 def err_trailing_return_in_parens : Error<
1450   "trailing return type may not be nested within parentheses">;
1451 def err_auto_var_deduction_failure : Error<
1452   "variable %0 with type %1 has incompatible initializer of type %2">;
1453 def err_auto_var_deduction_failure_from_init_list : Error<
1454   "cannot deduce actual type for variable %0 with type %1 from initializer list">;
1455 def err_auto_new_deduction_failure : Error<
1456   "new expression for type %0 has incompatible constructor argument of type %1">;
1457 def err_auto_different_deductions : Error<
1458   "'%select{auto|decltype(auto)}0' deduced as %1 in declaration of %2 and "
1459   "deduced as %3 in declaration of %4">;
1460 def err_implied_std_initializer_list_not_found : Error<
1461   "cannot deduce type of initializer list because std::initializer_list was "
1462   "not found; include <initializer_list>">;
1463 def err_malformed_std_initializer_list : Error<
1464   "std::initializer_list must be a class template with a single type parameter">;
1465 def warn_dangling_std_initializer_list : Warning<
1466   "array backing the initializer list will be destroyed at the end of "
1467   "%select{the full-expression|the constructor}0">,
1468   InGroup<DiagGroup<"dangling-initializer-list">>;
1469
1470 // C++1y decltype(auto) type
1471 def err_decltype_auto_cannot_be_combined : Error<
1472   "'decltype(auto)' cannot be combined with other type specifiers">;
1473 def err_decltype_auto_function_declarator_not_declaration : Error<
1474   "'decltype(auto)' can only be used as a return type "
1475   "in a function declaration">;
1476 def err_decltype_auto_compound_type : Error<
1477   "cannot form %select{pointer to|reference to|array of}0 'decltype(auto)'">;
1478 def err_decltype_auto_initializer_list : Error<
1479   "cannot deduce 'decltype(auto)' from initializer list">;
1480
1481 // C++1y deduced return types
1482 def err_auto_fn_deduction_failure : Error<
1483   "cannot deduce return type %0 from returned value of type %1">;
1484 def err_auto_fn_different_deductions : Error<
1485   "'%select{auto|decltype(auto)}0' in return type deduced as %1 here but "
1486   "deduced as %2 in earlier return statement">;
1487 def err_auto_fn_used_before_defined : Error<
1488   "function %0 with deduced return type cannot be used before it is defined">;
1489 def err_auto_fn_no_return_but_not_auto : Error<
1490   "cannot deduce return type %0 for function with no return statements">;
1491 def err_auto_fn_return_void_but_not_auto : Error<
1492   "cannot deduce return type %0 from omitted return expression">;
1493 def err_auto_fn_return_init_list : Error<
1494   "cannot deduce return type from initializer list">;
1495 def err_auto_fn_virtual : Error<
1496   "function with deduced return type cannot be virtual">;
1497
1498 // C++11 override control
1499 def override_keyword_only_allowed_on_virtual_member_functions : Error<
1500   "only virtual member functions can be marked '%0'">;
1501 def err_function_marked_override_not_overriding : Error<
1502   "%0 marked 'override' but does not override any member functions">;
1503 def err_class_marked_final_used_as_base : Error<
1504   "base %0 is marked 'final'">;
1505 def warn_abstract_final_class : Warning<
1506   "abstract class is marked 'final'">, InGroup<AbstractFinalClass>;
1507
1508 // C++11 attributes
1509 def err_repeat_attribute : Error<"'%0' attribute cannot be repeated">;
1510
1511 // C++11 final
1512 def err_final_function_overridden : Error<
1513   "declaration of %0 overrides a 'final' function">;
1514
1515 // C++11 scoped enumerations
1516 def err_enum_invalid_underlying : Error<
1517   "non-integral type %0 is an invalid underlying type">;
1518 def err_enumerator_too_large : Error<
1519   "enumerator value is not representable in the underlying type %0">;
1520 def ext_enumerator_too_large : ExtWarn<
1521   "enumerator value is not representable in the underlying type %0">,
1522   InGroup<Microsoft>;
1523 def err_enumerator_wrapped : Error<
1524   "enumerator value %0 is not representable in the underlying type %1">;
1525 def err_enum_redeclare_type_mismatch : Error<
1526   "enumeration redeclared with different underlying type %0 (was %1)">;
1527 def err_enum_redeclare_fixed_mismatch : Error<
1528   "enumeration previously declared with %select{non|}0fixed underlying type">;
1529 def err_enum_redeclare_scoped_mismatch : Error<
1530   "enumeration previously declared as %select{un|}0scoped">;
1531 def err_enum_class_reference : Error<
1532   "reference to %select{|scoped }0enumeration must use 'enum' "
1533   "not 'enum class'">;
1534 def err_only_enums_have_underlying_types : Error<
1535   "only enumeration types have underlying types">;
1536
1537 // C++11 delegating constructors
1538 def err_delegating_ctor : Error<
1539   "delegating constructors are permitted only in C++11">;
1540 def warn_cxx98_compat_delegating_ctor : Warning<
1541   "delegating constructors are incompatible with C++98">,
1542   InGroup<CXX98Compat>, DefaultIgnore;
1543 def err_delegating_initializer_alone : Error<
1544   "an initializer for a delegating constructor must appear alone">;
1545 def warn_delegating_ctor_cycle : Warning<
1546   "constructor for %0 creates a delegation cycle">, DefaultError,
1547   InGroup<DelegatingCtorCycles>;
1548 def note_it_delegates_to : Note<"it delegates to">;
1549 def note_which_delegates_to : Note<"which delegates to">;
1550
1551 // C++11 range-based for loop
1552 def err_for_range_decl_must_be_var : Error<
1553   "for range declaration must declare a variable">;
1554 def err_for_range_storage_class : Error<
1555   "loop variable %0 may not be declared %select{'extern'|'static'|"
1556   "'__private_extern__'|'auto'|'register'|'constexpr'}1">;
1557 def err_type_defined_in_for_range : Error<
1558   "types may not be defined in a for range declaration">;
1559 def err_for_range_deduction_failure : Error<
1560   "cannot use type %0 as a range">;
1561 def err_for_range_incomplete_type : Error<
1562   "cannot use incomplete type %0 as a range">;
1563 def err_for_range_iter_deduction_failure : Error<
1564   "cannot use type %0 as an iterator">;
1565 def err_for_range_member_begin_end_mismatch : Error<
1566   "range type %0 has '%select{begin|end}1' member but no '%select{end|begin}1' member">;
1567 def err_for_range_begin_end_types_differ : Error<
1568   "'begin' and 'end' must return the same type (got %0 and %1)">;
1569 def note_in_for_range: Note<
1570   "when looking up '%select{begin|end}0' function for range expression "
1571   "of type %1">;
1572 def err_for_range_invalid: Error<
1573   "invalid range expression of type %0; no viable '%select{begin|end}1' "
1574   "function available">;
1575 def err_for_range_dereference : Error<
1576   "invalid range expression of type %0; did you mean to dereference it "
1577   "with '*'?">;
1578 def note_for_range_invalid_iterator : Note <
1579   "in implicit call to 'operator%select{!=|*|++}0' for iterator of type %1">;
1580 def note_for_range_begin_end : Note<
1581   "selected '%select{begin|end}0' %select{function|template }1%2 with iterator type %3">;
1582
1583 // C++11 constexpr
1584 def warn_cxx98_compat_constexpr : Warning<
1585   "'constexpr' specifier is incompatible with C++98">,
1586   InGroup<CXX98Compat>, DefaultIgnore;
1587 // FIXME: Maybe this should also go in -Wc++1y-compat?
1588 def warn_cxx1y_compat_constexpr_not_const : Warning<
1589   "'constexpr' non-static member function will not be implicitly 'const' "
1590   "in C++1y; add 'const' to avoid a change in behavior">,
1591   InGroup<DiagGroup<"constexpr-not-const">>;
1592 def err_invalid_constexpr : Error<
1593   "%select{function parameter|typedef|non-static data member}0 "
1594   "cannot be constexpr">;
1595 def err_invalid_constexpr_member : Error<"non-static data member cannot be "
1596   "constexpr%select{; did you intend to make it %select{const|static}0?|}1">;
1597 def err_constexpr_tag : Error<
1598   "%select{class|struct|interface|union|enum}0 cannot be marked constexpr">;
1599 def err_constexpr_dtor : Error<"destructor cannot be marked constexpr">;
1600 def err_constexpr_no_declarators : Error<
1601   "constexpr can only be used in variable and function declarations">;
1602 def err_invalid_constexpr_var_decl : Error<
1603   "constexpr variable declaration must be a definition">;
1604 def err_constexpr_static_mem_var_requires_init : Error<
1605   "declaration of constexpr static data member %0 requires an initializer">;
1606 def err_constexpr_var_non_literal : Error<
1607   "constexpr variable cannot have non-literal type %0">;
1608 def err_constexpr_var_requires_const_init : Error<
1609   "constexpr variable %0 must be initialized by a constant expression">;
1610 def err_constexpr_redecl_mismatch : Error<
1611   "%select{non-constexpr declaration of %0 follows constexpr declaration"
1612   "|constexpr declaration of %0 follows non-constexpr declaration}1">;
1613 def err_constexpr_virtual : Error<"virtual function cannot be constexpr">;
1614 def err_constexpr_virtual_base : Error<
1615   "constexpr %select{member function|constructor}0 not allowed in "
1616   "%select{struct|interface|class}1 with virtual base "
1617   "%plural{1:class|:classes}2">;
1618 def note_non_literal_incomplete : Note<
1619   "incomplete type %0 is not a literal type">;
1620 def note_non_literal_virtual_base : Note<"%select{struct|interface|class}0 "
1621   "with virtual base %plural{1:class|:classes}1 is not a literal type">;
1622 def note_constexpr_virtual_base_here : Note<"virtual base class declared here">;
1623 def err_constexpr_non_literal_return : Error<
1624   "constexpr function's return type %0 is not a literal type">;
1625 def err_constexpr_non_literal_param : Error<
1626   "constexpr %select{function|constructor}1's %ordinal0 parameter type %2 is "
1627   "not a literal type">;
1628 def err_constexpr_body_invalid_stmt : Error<
1629   "statement not allowed in constexpr %select{function|constructor}0">;
1630 def ext_constexpr_body_invalid_stmt : ExtWarn<
1631   "use of this statement in a constexpr %select{function|constructor}0 "
1632   "is a C++1y extension">, InGroup<CXX1y>;
1633 def warn_cxx11_compat_constexpr_body_invalid_stmt : Warning<
1634   "use of this statement in a constexpr %select{function|constructor}0 "
1635   "is incompatible with C++ standards before C++1y">,
1636   InGroup<CXXPre1yCompat>, DefaultIgnore;
1637 def ext_constexpr_type_definition : ExtWarn<
1638   "type definition in a constexpr %select{function|constructor}0 "
1639   "is a C++1y extension">, InGroup<CXX1y>;
1640 def warn_cxx11_compat_constexpr_type_definition : Warning<
1641   "type definition in a constexpr %select{function|constructor}0 "
1642   "is incompatible with C++ standards before C++1y">,
1643   InGroup<CXXPre1yCompat>, DefaultIgnore;
1644 def err_constexpr_vla : Error<
1645   "variably-modified type %0 cannot be used in a constexpr "
1646   "%select{function|constructor}1">;
1647 def ext_constexpr_local_var : ExtWarn<
1648   "variable declaration in a constexpr %select{function|constructor}0 "
1649   "is a C++1y extension">, InGroup<CXX1y>;
1650 def warn_cxx11_compat_constexpr_local_var : Warning<
1651   "variable declaration in a constexpr %select{function|constructor}0 "
1652   "is incompatible with C++ standards before C++1y">,
1653   InGroup<CXXPre1yCompat>, DefaultIgnore;
1654 def err_constexpr_local_var_static : Error<
1655   "%select{static|thread_local}1 variable not permitted in a constexpr "
1656   "%select{function|constructor}0">;
1657 def err_constexpr_local_var_non_literal_type : Error<
1658   "variable of non-literal type %1 cannot be defined in a constexpr "
1659   "%select{function|constructor}0">;
1660 def err_constexpr_local_var_no_init : Error<
1661   "variables defined in a constexpr %select{function|constructor}0 must be "
1662   "initialized">;
1663 def ext_constexpr_function_never_constant_expr : ExtWarn<
1664   "constexpr %select{function|constructor}0 never produces a "
1665   "constant expression">, InGroup<DiagGroup<"invalid-constexpr">>, DefaultError;
1666 def err_constexpr_body_no_return : Error<
1667   "no return statement in constexpr function">;
1668 def warn_cxx11_compat_constexpr_body_no_return : Warning<
1669   "constexpr function with no return statements is incompatible with C++ "
1670   "standards before C++1y">, InGroup<CXXPre1yCompat>, DefaultIgnore;
1671 def ext_constexpr_body_multiple_return : ExtWarn<
1672   "multiple return statements in constexpr function is a C++1y extension">,
1673   InGroup<CXX1y>;
1674 def warn_cxx11_compat_constexpr_body_multiple_return : Warning<
1675   "multiple return statements in constexpr function "
1676   "is incompatible with C++ standards before C++1y">,
1677   InGroup<CXXPre1yCompat>, DefaultIgnore;
1678 def note_constexpr_body_previous_return : Note<
1679   "previous return statement is here">;
1680 def err_constexpr_function_try_block : Error<
1681   "function try block not allowed in constexpr %select{function|constructor}0">;
1682 def err_constexpr_union_ctor_no_init : Error<
1683   "constexpr union constructor does not initialize any member">;
1684 def err_constexpr_ctor_missing_init : Error<
1685   "constexpr constructor must initialize all members">;
1686 def note_constexpr_ctor_missing_init : Note<
1687   "member not initialized by constructor">;
1688 def err_constexpr_method_non_literal : Error<
1689   "non-literal type %0 cannot have constexpr members">;
1690 def note_non_literal_no_constexpr_ctors : Note<
1691   "%0 is not literal because it is not an aggregate and has no constexpr "
1692   "constructors other than copy or move constructors">;
1693 def note_non_literal_base_class : Note<
1694   "%0 is not literal because it has base class %1 of non-literal type">;
1695 def note_non_literal_field : Note<
1696   "%0 is not literal because it has data member %1 of "
1697   "%select{non-literal|volatile}3 type %2">;
1698 def note_non_literal_user_provided_dtor : Note<
1699   "%0 is not literal because it has a user-provided destructor">;
1700 def note_non_literal_nontrivial_dtor : Note<
1701   "%0 is not literal because it has a non-trivial destructor">;
1702 def warn_private_extern : Warning<
1703   "use of __private_extern__ on a declaration may not produce external symbol "
1704   "private to the linkage unit and is deprecated">, InGroup<PrivateExtern>;
1705 def note_private_extern : Note<
1706   "use __attribute__((visibility(\"hidden\"))) attribute instead">;
1707
1708 // C++11 char16_t/char32_t
1709 def warn_cxx98_compat_unicode_type : Warning<
1710   "'%0' type specifier is incompatible with C++98">,
1711   InGroup<CXX98Compat>, DefaultIgnore;
1712  
1713 // Objective-C++
1714 def err_objc_decls_may_only_appear_in_global_scope : Error<
1715   "Objective-C declarations may only appear in global scope">;
1716 def warn_auto_var_is_id : Warning<
1717   "'auto' deduced as 'id' in declaration of %0">,
1718   InGroup<DiagGroup<"auto-var-id">>;
1719
1720 // Attributes
1721 def err_nsobject_attribute : Error<
1722   "__attribute ((NSObject)) is for pointer types only">;
1723 def err_attribute_can_be_applied_only_to_symbol_declaration : Error<
1724   "%0 attribute can be applied only to symbol declaration">;
1725 def err_attributes_are_not_compatible : Error<
1726   "%0 and %1 attributes are not compatible">;
1727 def err_attribute_wrong_number_arguments : Error<
1728   "attribute %plural{0:takes no arguments|1:takes one argument|"
1729   ":requires exactly %0 arguments}0">;
1730 def err_attribute_too_many_arguments : Error<
1731   "attribute takes no more than %0 argument%s0">;
1732 def err_suppress_autosynthesis : Error<
1733   "objc_requires_property_definitions attribute may only be specified on a class"
1734   "to a class declaration">;
1735 def err_attribute_too_few_arguments : Error<
1736   "attribute takes at least %0 argument%s0">;
1737 def err_attribute_missing_parameter_name : Error<
1738   "attribute requires unquoted parameter">;
1739 def err_attribute_invalid_vector_type : Error<"invalid vector element type %0">;
1740 def err_attribute_bad_neon_vector_size : Error<
1741   "Neon vector size must be 64 or 128 bits">;
1742 def err_attribute_argument_not_int : Error<
1743   "'%0' attribute requires integer constant">;
1744 def err_aligned_attribute_argument_not_int : Error<
1745   "'aligned' attribute requires integer constant">;
1746 def err_alignas_attribute_wrong_decl_type : Error<
1747   "'%select{alignas|_Alignas}0' attribute cannot be applied to a %select{"
1748   "function parameter|variable with 'register' storage class|"
1749   "'catch' variable|bit-field}1">;
1750 def err_alignas_missing_on_definition : Error<
1751   "'%select{alignas|_Alignas}0' must be specified on definition if it is "
1752   "specified on any declaration">;
1753 def note_alignas_on_declaration : Note<
1754   "declared with '%select{alignas|_Alignas}0' attribute here">;
1755 def err_alignas_mismatch : Error<
1756   "redeclaration has different alignment requirement (%1 vs %0)">;
1757 def err_alignas_underaligned : Error<
1758   "requested alignment is less than minimum alignment of %1 for type %0">;
1759 def err_attribute_first_argument_not_int_or_bool : Error<
1760   "%0 attribute first argument must be of int or bool type">;
1761 def err_attribute_argument_outof_range : Error<
1762   "init_priority attribute requires integer constant between "
1763   "101 and 65535 inclusive">;
1764 def err_init_priority_object_attr : Error<
1765   "can only use 'init_priority' attribute on file-scope definitions "
1766   "of objects of class type">;
1767 def err_attribute_argument_vec_type_hint : Error<
1768   "invalid attribute argument %0 - expecting a vector or vectorizable scalar type">;
1769 def err_attribute_argument_n_not_int : Error<
1770   "'%0' attribute requires parameter %1 to be an integer constant">;
1771 def err_attribute_argument_n_not_string : Error<
1772   "'%0' attribute requires parameter %1 to be a string">;
1773 def err_attribute_argument_n_not_identifier : Error<
1774   "'%0' attribute requires parameter %1 to be an identifier">;
1775 def err_attribute_argument_out_of_bounds : Error<
1776   "'%0' attribute parameter %1 is out of bounds">;
1777 def err_attribute_requires_objc_interface : Error<
1778   "attribute may only be applied to an Objective-C interface">;
1779 def err_attribute_uuid_malformed_guid : Error<
1780   "uuid attribute contains a malformed GUID">;
1781 def warn_nonnull_pointers_only : Warning<
1782   "nonnull attribute only applies to pointer arguments">;
1783 def err_attribute_pointers_only : Error<
1784   "'%0' attribute only applies to pointer arguments">;
1785 def err_attribute_invalid_implicit_this_argument : Error<
1786   "'%0' attribute is invalid for the implicit this argument">;
1787 def err_ownership_type : Error<
1788   "%0 attribute only applies to %1 arguments">;
1789 def err_format_strftime_third_parameter : Error<
1790   "strftime format attribute requires 3rd parameter to be 0">;
1791 def err_format_attribute_requires_variadic : Error<
1792   "format attribute requires variadic function">;
1793 def err_format_attribute_not : Error<"format argument not %0">;
1794 def err_format_attribute_result_not : Error<"function does not return %0">;
1795 def err_format_attribute_implicit_this_format_string : Error<
1796   "format attribute cannot specify the implicit this argument as the format "
1797   "string">;
1798 def warn_unknown_method_family : Warning<"unrecognized method family">;
1799 def err_init_method_bad_return_type : Error<
1800   "init methods must return an object pointer type, not %0">;
1801 def err_attribute_invalid_size : Error<
1802   "vector size not an integral multiple of component size">;
1803 def err_attribute_zero_size : Error<"zero vector size">;
1804 def err_typecheck_vector_not_convertable : Error<
1805   "can't convert between vector values of different size (%0 and %1)">;
1806 def err_typecheck_ext_vector_not_typedef : Error<
1807   "ext_vector_type only applies to types, not variables">;
1808 def err_ext_vector_component_exceeds_length : Error<
1809   "vector component access exceeds type %0">;
1810 def err_ext_vector_component_name_illegal : Error<
1811   "illegal vector component name '%0'">;
1812 def err_attribute_address_space_not_int : Error<
1813   "address space attribute requires an integer constant">;
1814 def err_attribute_address_space_negative : Error<
1815   "address space is negative">;
1816 def err_attribute_address_space_too_high : Error<
1817   "address space is larger than the maximum supported (%0)">;
1818 def err_attribute_address_multiple_qualifiers : Error<
1819   "multiple address spaces specified for type">;
1820 def err_attribute_address_function_type : Error<
1821   "function type may not be qualified with an address space">;
1822 def err_as_qualified_auto_decl : Error<
1823   "automatic variable qualified with an address space">;
1824 def err_arg_with_address_space : Error<
1825   "parameter may not be qualified with an address space">;
1826 def err_field_with_address_space : Error<
1827   "field may not be qualified with an address space">;
1828 def err_attr_objc_ownership_redundant : Error<
1829   "the type %0 is already explicitly ownership-qualified">;
1830 def err_attribute_not_string : Error<
1831   "argument to %0 attribute was not a string literal">;
1832 def err_undeclared_nsnumber : Error<
1833   "NSNumber must be available to use Objective-C literals">;
1834 def err_invalid_nsnumber_type : Error<
1835   "%0 is not a valid literal type for NSNumber">;
1836 def err_undeclared_nsstring : Error<
1837   "cannot box a string value because NSString has not been declared">;
1838 def err_objc_illegal_boxed_expression_type : Error<
1839   "illegal type %0 used in a boxed expression">;
1840 def err_objc_incomplete_boxed_expression_type : Error<
1841   "incomplete type %0 used in a boxed expression">;
1842 def err_undeclared_nsarray : Error<
1843   "NSArray must be available to use Objective-C array literals">;
1844 def err_undeclared_nsdictionary : Error<
1845   "NSDictionary must be available to use Objective-C dictionary "
1846   "literals">;
1847 def err_undeclared_boxing_method : Error<
1848   "declaration of %0 is missing in %1 class">;
1849 def err_objc_literal_method_sig : Error<
1850   "literal construction method %0 has incompatible signature">;
1851 def note_objc_literal_method_param : Note<
1852   "%select{first|second|third}0 parameter has unexpected type %1 "
1853   "(should be %2)">;
1854 def note_objc_literal_method_return : Note<
1855   "method returns unexpected type %0 (should be an object type)">;
1856 def err_invalid_collection_element : Error<
1857   "collection element of type %0 is not an Objective-C object">;
1858 def err_box_literal_collection : Error<
1859   "%select{string|character|boolean|numeric}0 literal must be prefixed by '@' "
1860   "in a collection">;
1861 def warn_objc_literal_comparison : Warning<
1862   "direct comparison of %select{an array literal|a dictionary literal|"
1863   "a numeric literal|a boxed expression|}0 has undefined behavior">,
1864   InGroup<ObjCLiteralComparison>;
1865 def warn_objc_string_literal_comparison : Warning<
1866   "direct comparison of a string literal has undefined behavior">, 
1867   InGroup<ObjCStringComparison>;
1868 def note_objc_literal_comparison_isequal : Note<
1869   "use 'isEqual:' instead">;
1870
1871 let CategoryName = "Cocoa API Issue" in {
1872 def warn_objc_redundant_literal_use : Warning<
1873   "using %0 with a literal is redundant">, InGroup<ObjCRedundantLiteralUse>;
1874 }
1875
1876 def err_attr_tlsmodel_arg : Error<"tls_model must be \"global-dynamic\", "
1877   "\"local-dynamic\", \"initial-exec\" or \"local-exec\"">;
1878
1879 def err_only_annotate_after_access_spec : Error<
1880   "access specifier can only have annotation attributes">;
1881
1882 def err_attribute_section_invalid_for_target : Error<
1883   "argument to 'section' attribute is not valid for this target: %0">;
1884 def err_attribute_section_local_variable : Error<
1885   "'section' attribute is not valid on local variables">;
1886 def warn_mismatched_section : Warning<
1887   "section does not match previous declaration">, InGroup<Section>;
1888
1889 def err_anonymous_property: Error<
1890   "anonymous property is not supported">;
1891 def err_property_is_variably_modified: Error<
1892   "property '%0' has a variably modified type">;
1893 def err_no_getter_for_property : Error<
1894   "no getter defined for property '%0'">;
1895 def err_no_setter_for_property : Error<
1896   "no setter defined for property '%0'">;
1897 def error_cannot_find_suitable_getter : Error<
1898   "cannot find suitable getter for property '%0'">;
1899 def error_cannot_find_suitable_setter : Error<
1900   "cannot find suitable setter for property '%0'">;
1901
1902 def err_attribute_aligned_not_power_of_two : Error<
1903   "requested alignment is not a power of 2">;
1904 def err_attribute_aligned_greater_than_8192 : Error<
1905   "requested alignment must be 8192 bytes or smaller">;
1906 def warn_redeclaration_without_attribute_prev_attribute_ignored : Warning<
1907   "'%0' redeclared without %1 attribute: previous %1 ignored">;
1908 def warn_attribute_ignored : Warning<"%0 attribute ignored">,
1909   InGroup<IgnoredAttributes>;
1910 def warn_attribute_after_definition_ignored : Warning<
1911   "attribute %0 after definition is ignored">,
1912    InGroup<IgnoredAttributes>;
1913 def warn_unknown_attribute_ignored : Warning<
1914   "unknown attribute %0 ignored">, InGroup<UnknownAttributes>;
1915 def warn_cxx11_gnu_attribute_on_type : Warning<
1916   "attribute %0 ignored, because it cannot be applied to a type">,
1917   InGroup<IgnoredAttributes>;
1918 def warn_unhandled_ms_attribute_ignored : Warning<
1919   "__declspec attribute %0 is not supported">, 
1920   InGroup<IgnoredAttributes>;
1921 def err_attribute_invalid_on_stmt : Error<
1922   "%0 attribute cannot be applied to a statement">;
1923 def warn_declspec_attribute_ignored : Warning<
1924   "attribute %0 is ignored, place it after "
1925   "\"%select{class|struct|union|interface|enum}1\" to apply attribute to "
1926   "type declaration">, InGroup<IgnoredAttributes>;
1927 def warn_attribute_precede_definition : Warning<
1928   "attribute declaration must precede definition">,
1929   InGroup<IgnoredAttributes>;
1930 def warn_attribute_void_function_method : Warning<
1931   "attribute %0 cannot be applied to "
1932   "%select{functions|Objective-C method}1 without return value">,
1933   InGroup<IgnoredAttributes>;
1934 def warn_attribute_weak_on_field : Warning<
1935   "__weak attribute cannot be specified on a field declaration">,
1936   InGroup<IgnoredAttributes>;
1937 def warn_gc_attribute_weak_on_local : Warning<
1938   "Objective-C GC does not allow weak variables on the stack">,
1939   InGroup<IgnoredAttributes>;
1940 def warn_nsobject_attribute : Warning<
1941   "__attribute ((NSObject)) may be put on a typedef only, "
1942   "attribute is ignored">, InGroup<NSobjectAttribute>;
1943 def warn_attribute_weak_on_local : Warning<
1944   "__weak attribute cannot be specified on an automatic variable when ARC "
1945   "is not enabled">,
1946   InGroup<IgnoredAttributes>;
1947 def warn_weak_identifier_undeclared : Warning<
1948   "weak identifier %0 never declared">;
1949 def err_attribute_weak_static : Error<
1950   "weak declaration cannot have internal linkage">;
1951 def warn_attribute_weak_import_invalid_on_definition : Warning<
1952   "'weak_import' attribute cannot be specified on a definition">,
1953   InGroup<IgnoredAttributes>;
1954 def err_attribute_weakref_not_static : Error<
1955   "weakref declaration must have internal linkage">;
1956 def err_attribute_weakref_not_global_context : Error<
1957   "weakref declaration of '%0' must be in a global context">;
1958 def err_attribute_weakref_without_alias : Error<
1959   "weakref declaration of '%0' must also have an alias attribute">;
1960 def err_alias_not_supported_on_darwin : Error <
1961   "only weak aliases are supported on darwin">;
1962 def warn_attribute_wrong_decl_type : Warning<
1963   "%0 attribute only applies to %select{functions|unions|"
1964   "variables and functions|functions and methods|parameters|"
1965   "functions, methods and blocks|functions, methods, and classes|"
1966   "functions, methods, and parameters|classes|variables|methods|"
1967   "variables, functions and labels|fields and global variables|structs|"
1968   "variables, functions and tag types|thread-local variables|"
1969   "variables and fields|variables, data members and tag types|"
1970   "types and namespaces}1">,
1971   InGroup<IgnoredAttributes>;
1972 def err_attribute_wrong_decl_type : Error<
1973   "%0 attribute only applies to %select{functions|unions|"
1974   "variables and functions|functions and methods|parameters|"
1975   "functions, methods and blocks|functions, methods, and classes|"
1976   "functions, methods, and parameters|classes|variables|methods|"
1977   "variables, functions and labels|fields and global variables|structs|"
1978   "variables, functions and tag types|thread-local variables|"
1979   "variables and fields|variables, data members and tag types|"
1980   "types and namespaces}1">;
1981 def warn_function_attribute_wrong_type : Warning<
1982   "'%0' only applies to function types; type here is %1">,
1983   InGroup<IgnoredAttributes>;
1984 def warn_pointer_attribute_wrong_type : Warning<
1985   "'%0' only applies to pointer types; type here is %1">,
1986   InGroup<IgnoredAttributes>;
1987 def warn_objc_object_attribute_wrong_type : Warning<
1988   "'%0' only applies to Objective-C object or block pointer types; type here is %1">,
1989   InGroup<IgnoredAttributes>;
1990 def warn_attribute_requires_functions_or_static_globals : Warning<
1991   "%0 only applies to variables with static storage duration and functions">,
1992   InGroup<IgnoredAttributes>;
1993 def warn_gnu_inline_attribute_requires_inline : Warning<
1994   "'gnu_inline' attribute requires function to be marked 'inline',"
1995   " attribute ignored">,
1996   InGroup<IgnoredAttributes>;
1997 def err_attribute_vecreturn_only_vector_member : Error<
1998   "the vecreturn attribute can only be used on a class or structure with one member, which must be a vector">;
1999 def err_attribute_vecreturn_only_pod_record : Error<
2000   "the vecreturn attribute can only be used on a POD (plain old data) class or structure (i.e. no virtual functions)">;
2001 def err_cconv_change : Error<
2002   "function declared '%0' here was previously declared "
2003   "%select{'%2'|without calling convention}1">;
2004 def warn_cconv_ignored : Warning<
2005   "calling convention %0 ignored for this target">, InGroup<IgnoredAttributes>;
2006 def err_cconv_knr : Error<
2007   "function with no prototype cannot use %0 calling convention">;
2008 def err_cconv_varargs : Error<
2009   "variadic function cannot use %0 calling convention">;
2010 def err_regparm_mismatch : Error<"function declared with regparm(%0) "
2011   "attribute was previously declared "
2012   "%plural{0:without the regparm|:with the regparm(%1)}1 attribute">;
2013 def err_returns_retained_mismatch : Error<
2014   "function declared with the ns_returns_retained attribute "
2015   "was previously declared without the ns_returns_retained attribute">;
2016 def err_objc_precise_lifetime_bad_type : Error<
2017   "objc_precise_lifetime only applies to retainable types; type here is %0">;
2018 def warn_objc_precise_lifetime_meaningless : Error<
2019   "objc_precise_lifetime is not meaningful for "
2020   "%select{__unsafe_unretained|__autoreleasing}0 objects">;
2021 def err_invalid_pcs : Error<"invalid PCS type">;
2022 def err_attribute_can_be_applied_only_to_value_decl : Error<
2023   "%0 attribute can only be applied to value declarations">;
2024 def warn_attribute_not_on_decl : Warning<
2025   "%0 attribute ignored when parsing type">, InGroup<IgnoredAttributes>;
2026 def err_base_specifier_attribute : Error<
2027   "%0 attribute cannot be applied to a base specifier">;
2028
2029 // Availability attribute
2030 def warn_availability_unknown_platform : Warning<
2031   "unknown platform %0 in availability macro">, InGroup<Availability>;
2032 def warn_availability_version_ordering : Warning<
2033   "feature cannot be %select{introduced|deprecated|obsoleted}0 in %1 version "
2034   "%2 before it was %select{introduced|deprecated|obsoleted}3 in version %4; "
2035   "attribute ignored">, InGroup<Availability>;
2036 def warn_mismatched_availability: Warning<
2037   "availability does not match previous declaration">, InGroup<Availability>;
2038 def warn_mismatched_availability_override : Warning<
2039   "overriding method %select{introduced after|"
2040   "deprecated before|obsoleted before}0 overridden method on %1 (%2 vs. %3)">, 
2041   InGroup<Availability>;
2042 def warn_mismatched_availability_override_unavail : Warning<
2043   "overriding method cannot be unavailable on %0 when its overridden method is "
2044   "available">,
2045   InGroup<Availability>;
2046 def note_overridden_method : Note<
2047   "overridden method is here">;
2048
2049 // Thread Safety Attributes
2050 def warn_thread_attribute_ignored : Warning<
2051   "ignoring %0 attribute because its argument is invalid">,
2052   InGroup<ThreadSafetyAttributes>, DefaultIgnore;
2053 def warn_thread_attribute_argument_not_lockable : Warning<
2054   "%0 attribute requires arguments whose type is annotated "
2055   "with 'lockable' attribute; type here is '%1'">,
2056   InGroup<ThreadSafetyAttributes>, DefaultIgnore;
2057 def warn_thread_attribute_argument_not_class : Warning<
2058   "%0 attribute requires arguments that are class type or point to"
2059   " class type; type here is '%1'">,
2060   InGroup<ThreadSafetyAttributes>, DefaultIgnore;  
2061 def warn_thread_attribute_decl_not_lockable : Warning<
2062   "%0 attribute can only be applied in a context annotated "
2063   "with 'lockable' attribute">,
2064   InGroup<ThreadSafetyAttributes>, DefaultIgnore;
2065 def warn_thread_attribute_decl_not_pointer : Warning<
2066   "'%0' only applies to pointer types; type here is %1">,
2067   InGroup<ThreadSafetyAttributes>, DefaultIgnore;
2068 def warn_thread_attribute_wrong_decl_type : Warning<
2069   "%0 attribute only applies to %select{"
2070   "fields and global variables|functions and methods|"
2071   "classes and structs}1">,
2072   InGroup<ThreadSafetyAttributes>, DefaultIgnore;  
2073 def err_attribute_argument_out_of_range : Error<
2074   "%0 attribute parameter %1 is out of bounds: "
2075   "%plural{0:no parameters to index into|"
2076   "1:can only be 1, since there is one parameter|"
2077   ":must be between 1 and %2}2">;
2078
2079 // Thread Safety Analysis   
2080 def warn_unlock_but_no_lock : Warning<
2081   "unlocking '%0' that was not locked">,
2082   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2083 def warn_double_lock : Warning<
2084   "locking '%0' that is already locked">,
2085   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2086 def warn_no_unlock : Warning<
2087   "mutex '%0' is still locked at the end of function">,
2088   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2089 def warn_expecting_locked : Warning<
2090   "expecting mutex '%0' to be locked at the end of function">,
2091   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;  
2092 // FIXME: improve the error message about locks not in scope
2093 def warn_lock_some_predecessors : Warning<
2094   "mutex '%0' is not locked on every path through here">,
2095   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2096 def warn_expecting_lock_held_on_loop : Warning<
2097   "expecting mutex '%0' to be locked at start of each loop">,
2098   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2099 def note_locked_here : Note<"mutex acquired here">;
2100 def warn_lock_exclusive_and_shared : Warning<
2101   "mutex '%0' is locked exclusively and shared in the same scope">,
2102   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2103 def note_lock_exclusive_and_shared : Note<
2104   "the other lock of mutex '%0' is here">;
2105 def warn_variable_requires_any_lock : Warning<
2106   "%select{reading|writing}1 variable '%0' requires locking "
2107   "%select{any mutex|any mutex exclusively}1">,
2108   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2109 def warn_var_deref_requires_any_lock : Warning<
2110   "%select{reading|writing}1 the value pointed to by '%0' requires locking "
2111   "%select{any mutex|any mutex exclusively}1">,
2112   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2113 def warn_fun_excludes_mutex : Warning<
2114   "cannot call function '%0' while mutex '%1' is locked">,
2115   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2116 def warn_cannot_resolve_lock : Warning<
2117   "cannot resolve lock expression">,
2118   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2119
2120 // Imprecise thread safety warnings
2121 def warn_variable_requires_lock : Warning<
2122   "%select{reading|writing}2 variable '%0' requires locking "
2123   "%select{'%1'|'%1' exclusively}2">,
2124   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2125 def warn_var_deref_requires_lock : Warning<
2126   "%select{reading|writing}2 the value pointed to by '%0' requires locking "
2127   "%select{'%1'|'%1' exclusively}2">,
2128   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2129 def warn_fun_requires_lock : Warning<
2130   "calling function '%0' requires %select{shared|exclusive}2 lock on '%1'">,
2131   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2132
2133 // Precise thread safety warnings
2134 def warn_variable_requires_lock_precise : Warning<
2135   "%select{reading|writing}2 variable '%0' requires locking "
2136   "%select{'%1'|'%1' exclusively}2">,
2137   InGroup<ThreadSafetyPrecise>, DefaultIgnore;
2138 def warn_var_deref_requires_lock_precise : Warning<
2139   "%select{reading|writing}2 the value pointed to by '%0' requires locking "
2140   "%select{'%1'|'%1' exclusively}2">,
2141   InGroup<ThreadSafetyPrecise>, DefaultIgnore;
2142 def warn_fun_requires_lock_precise : Warning<
2143   "calling function '%0' requires %select{shared|exclusive}2 lock on '%1'">,
2144   InGroup<ThreadSafetyPrecise>, DefaultIgnore;
2145 def note_found_mutex_near_match : Note<"found near match '%0'">;
2146
2147 // Dummy warning that will trigger "beta" warnings from the analysis if enabled. 
2148 def warn_thread_safety_beta : Warning<
2149   "Thread safety beta warning.">, InGroup<ThreadSafetyBeta>, DefaultIgnore;
2150
2151 def warn_impcast_vector_scalar : Warning<
2152   "implicit conversion turns vector to scalar: %0 to %1">,
2153   InGroup<Conversion>, DefaultIgnore;
2154 def warn_impcast_complex_scalar : Warning<
2155   "implicit conversion discards imaginary component: %0 to %1">,
2156   InGroup<Conversion>, DefaultIgnore;
2157 def warn_impcast_float_precision : Warning<
2158   "implicit conversion loses floating-point precision: %0 to %1">,
2159   InGroup<Conversion>, DefaultIgnore;
2160 def warn_impcast_float_integer : Warning<
2161   "implicit conversion turns floating-point number into integer: %0 to %1">,
2162   InGroup<Conversion>, DefaultIgnore;
2163 def warn_impcast_integer_sign : Warning<
2164   "implicit conversion changes signedness: %0 to %1">,
2165   InGroup<SignConversion>, DefaultIgnore;
2166 def warn_impcast_integer_sign_conditional : Warning<
2167   "operand of ? changes signedness: %0 to %1">,
2168   InGroup<SignConversion>, DefaultIgnore;
2169 def warn_impcast_integer_precision : Warning<
2170   "implicit conversion loses integer precision: %0 to %1">,
2171   InGroup<Conversion>, DefaultIgnore;
2172 def warn_impcast_integer_64_32 : Warning<
2173   "implicit conversion loses integer precision: %0 to %1">,
2174   InGroup<Shorten64To32>, DefaultIgnore;
2175 def warn_impcast_integer_precision_constant : Warning<
2176   "implicit conversion from %2 to %3 changes value from %0 to %1">,
2177   InGroup<ConstantConversion>;
2178 def warn_impcast_bitfield_precision_constant : Warning<
2179   "implicit truncation from %2 to bitfield changes value from %0 to %1">,
2180   InGroup<BitFieldConstantConversion>;
2181 def warn_impcast_literal_float_to_integer : Warning<
2182   "implicit conversion from %0 to %1 changes value from %2 to %3">,
2183   InGroup<LiteralConversion>;
2184 def warn_impcast_string_literal_to_bool : Warning<
2185   "implicit conversion turns string literal into bool: %0 to %1">,
2186   InGroup<StringConversion>, DefaultIgnore;
2187 def warn_impcast_different_enum_types : Warning<
2188   "implicit conversion from enumeration type %0 to different enumeration type "
2189   "%1">, InGroup<EnumConversion>;
2190 def warn_impcast_bool_to_null_pointer : Warning<
2191     "initialization of pointer of type %0 to null from a constant boolean "
2192     "expression">, InGroup<BoolConversion>;
2193 def warn_non_literal_null_pointer : Warning<
2194     "expression which evaluates to zero treated as a null pointer constant of "
2195     "type %0">, InGroup<NonLiteralNullConversion>;
2196 def warn_impcast_null_pointer_to_integer : Warning<
2197     "implicit conversion of NULL constant to %0">,
2198     InGroup<NullConversion>;
2199 def warn_impcast_floating_point_to_bool : Warning<
2200     "implicit conversion turns floating-point number into bool: %0 to %1">,
2201     InGroup<ImplicitConversionFloatingPointToBool>;
2202 def warn_impcast_function_to_bool : Warning<
2203     "address of function %q0 will always evaluate to 'true'">,
2204     InGroup<BoolConversion>;
2205 def note_function_to_bool_silence : Note<
2206     "prefix with the address-of operator to silence this warning">;
2207 def note_function_to_bool_call : Note<
2208     "suffix with parentheses to turn this into a function call">;
2209
2210 def warn_cast_align : Warning<
2211   "cast from %0 to %1 increases required alignment from %2 to %3">,
2212   InGroup<CastAlign>, DefaultIgnore;
2213
2214 def warn_int_to_pointer_cast : Warning<
2215   "cast to %1 from smaller integer type %0">,
2216   InGroup<IntToPointerCast>;
2217
2218 def warn_attribute_ignored_for_field_of_type : Warning<
2219   "%0 attribute ignored for field of type %1">,
2220   InGroup<IgnoredAttributes>;
2221 def warn_transparent_union_attribute_field_size_align : Warning<
2222   "%select{alignment|size}0 of field %1 (%2 bits) does not match the "
2223   "%select{alignment|size}0 of the first field in transparent union; "
2224   "transparent_union attribute ignored">,
2225   InGroup<IgnoredAttributes>;
2226 def note_transparent_union_first_field_size_align : Note<
2227   "%select{alignment|size}0 of first field is %1 bits">;
2228 def warn_transparent_union_attribute_not_definition : Warning<
2229   "transparent_union attribute can only be applied to a union definition; "
2230   "attribute ignored">,
2231   InGroup<IgnoredAttributes>;
2232 def warn_transparent_union_attribute_floating : Warning<
2233   "first field of a transparent union cannot have %select{floating point|"
2234   "vector}0 type %1; transparent_union attribute ignored">,
2235   InGroup<IgnoredAttributes>;
2236 def warn_transparent_union_attribute_zero_fields : Warning<
2237   "transparent union definition must contain at least one field; "
2238   "transparent_union attribute ignored">,
2239   InGroup<IgnoredAttributes>;
2240 def warn_attribute_type_not_supported : Warning<
2241   "'%0' attribute argument not supported: %1">,
2242   InGroup<IgnoredAttributes>;
2243 def warn_attribute_unknown_visibility : Warning<"unknown visibility '%0'">,
2244   InGroup<IgnoredAttributes>;
2245 def warn_attribute_protected_visibility :
2246   Warning<"target does not support 'protected' visibility; using 'default'">,
2247   InGroup<DiagGroup<"unsupported-visibility">>;
2248 def err_mismatched_visibility: Error<"visibility does not match previous declaration">;
2249 def warn_attribute_unknown_endian : Warning<"unknown endian '%0'">,
2250   InGroup<IgnoredAttributes>;
2251 def note_previous_attribute : Note<"previous attribute is here">;
2252 def err_unknown_machine_mode : Error<"unknown machine mode %0">;
2253 def err_unsupported_machine_mode : Error<"unsupported machine mode %0">;
2254 def err_mode_not_primitive : Error<
2255   "mode attribute only supported for integer and floating-point types">;
2256 def err_mode_wrong_type : Error<
2257   "type of machine mode does not match type of base type">;
2258 def err_attr_wrong_decl : Error<
2259   "'%0' attribute invalid on this declaration, requires typedef or value">;
2260 def warn_attribute_nonnull_no_pointers : Warning<
2261   "'nonnull' attribute applied to function with no pointer arguments">,
2262   InGroup<IgnoredAttributes>;
2263 def warn_attribute_malloc_pointer_only : Warning<
2264   "'malloc' attribute only applies to functions returning a pointer type">,
2265   InGroup<IgnoredAttributes>;
2266 def warn_attribute_sentinel_named_arguments : Warning<
2267   "'sentinel' attribute requires named arguments">,
2268   InGroup<IgnoredAttributes>;
2269 def warn_attribute_sentinel_not_variadic : Warning<
2270   "'sentinel' attribute only supported for variadic %select{functions|blocks}0">,
2271   InGroup<IgnoredAttributes>;
2272 def err_attribute_sentinel_less_than_zero : Error<
2273   "'sentinel' parameter 1 less than zero">;
2274 def err_attribute_sentinel_not_zero_or_one : Error<
2275   "'sentinel' parameter 2 not 0 or 1">;
2276 def err_attribute_cleanup_arg_not_found : Error<
2277   "'cleanup' argument %0 not found">;
2278 def err_attribute_cleanup_arg_not_function : Error<
2279   "'cleanup' argument %0 is not a function">;
2280 def err_attribute_cleanup_func_must_take_one_arg : Error<
2281   "'cleanup' function %0 must take 1 parameter">;
2282 def err_attribute_cleanup_func_arg_incompatible_type : Error<
2283   "'cleanup' function %0 parameter has "
2284   "%diff{type $ which is incompatible with type $|incompatible type}1,2">;
2285 def err_attribute_regparm_wrong_platform : Error<
2286   "'regparm' is not valid on this platform">;
2287 def err_attribute_regparm_invalid_number : Error<
2288   "'regparm' parameter must be between 0 and %0 inclusive">;
2289
2290
2291 // Clang-Specific Attributes
2292 def warn_attribute_iboutlet : Warning<
2293   "%0 attribute can only be applied to instance variables or properties">,
2294   InGroup<IgnoredAttributes>;
2295 def warn_attribute_ibaction: Warning<
2296   "ibaction attribute can only be applied to Objective-C instance methods">,
2297   InGroup<IgnoredAttributes>;
2298 def err_iboutletcollection_type : Error<
2299   "invalid type %0 as argument of iboutletcollection attribute">;
2300 def warn_iboutlet_object_type : Warning<
2301   "%select{instance variable|property}2 with %0 attribute must "
2302   "be an object type (invalid %1)">,
2303   InGroup<DiagGroup<"invalid-iboutlet">>;
2304 def err_attribute_overloadable_not_function : Error<
2305   "'overloadable' attribute can only be applied to a function">;
2306 def err_attribute_overloadable_missing : Error<
2307   "%select{overloaded function|redeclaration of}0 %1 must have the "
2308   "'overloadable' attribute">;
2309 def note_attribute_overloadable_prev_overload : Note<
2310   "previous overload of function is here">;
2311 def err_attribute_overloadable_no_prototype : Error<
2312   "'overloadable' function %0 must have a prototype">;
2313 def warn_ns_attribute_wrong_return_type : Warning<
2314   "%0 attribute only applies to %select{functions|methods}1 that "
2315   "return %select{an Objective-C object|a pointer|a non-retainable pointer}2">,
2316   InGroup<IgnoredAttributes>;
2317 def warn_ns_attribute_wrong_parameter_type : Warning<
2318   "%0 attribute only applies to %select{Objective-C object|pointer}1 "
2319   "parameters">,
2320   InGroup<IgnoredAttributes>;
2321 def warn_objc_requires_super_protocol : Warning<
2322   "%0 attribute cannot be applied to %select{methods in protocols|dealloc}1">,
2323   InGroup<DiagGroup<"requires-super-attribute">>;
2324 def note_protocol_decl : Note<
2325   "protocol is declared here">;
2326
2327 def err_ns_bridged_not_interface : Error<
2328   "parameter of 'ns_bridged' attribute does not name an Objective-C class">;
2329
2330 // Function Parameter Semantic Analysis.
2331 def err_param_with_void_type : Error<"argument may not have 'void' type">;
2332 def err_void_only_param : Error<
2333   "'void' must be the first and only parameter if specified">;
2334 def err_void_param_qualified : Error<
2335   "'void' as parameter must not have type qualifiers">;
2336 def err_ident_list_in_fn_declaration : Error<
2337   "a parameter list without types is only allowed in a function definition">;
2338 def ext_param_not_declared : Extension<
2339   "parameter %0 was not declared, defaulting to type 'int'">;
2340 def err_param_typedef_of_void : Error<
2341   "empty parameter list defined with a %select{typedef|type alias}0 of 'void' not allowed%select{ in C++|}0">;
2342 def err_param_default_argument : Error<
2343   "C does not support default arguments">;
2344 def err_param_default_argument_redefinition : Error<
2345   "redefinition of default argument">;
2346 def warn_param_default_argument_redefinition : ExtWarn<
2347   "redefinition of default argument">;
2348 def err_param_default_argument_missing : Error<
2349   "missing default argument on parameter">;
2350 def err_param_default_argument_missing_name : Error<
2351   "missing default argument on parameter %0">;
2352 def err_param_default_argument_references_param : Error<
2353   "default argument references parameter %0">;
2354 def err_param_default_argument_references_local : Error<
2355   "default argument references local variable %0 of enclosing function">;
2356 def err_param_default_argument_references_this : Error<
2357   "default argument references 'this'">;
2358 def err_param_default_argument_nonfunc : Error<
2359   "default arguments can only be specified for parameters in a function "
2360   "declaration">;
2361 def err_param_default_argument_template_redecl : Error<
2362   "default arguments cannot be added to a function template that has already "
2363   "been declared">;
2364 def err_param_default_argument_member_template_redecl : Error<
2365   "default arguments cannot be added to an out-of-line definition of a member "
2366   "of a %select{class template|class template partial specialization|nested "
2367   "class in a template}0">;
2368 def err_uninitialized_member_for_assign : Error<
2369   "cannot define the implicit default assignment operator for %0, because "
2370   "non-static %select{reference|const}1 member %2 can't use default "
2371   "assignment operator">;
2372 def err_uninitialized_member_in_ctor : Error<
2373   "%select{|implicit default |inheriting }0constructor for %1 must explicitly "
2374   "initialize the %select{reference|const}2 member %3">;
2375 def err_default_arg_makes_ctor_special : Error<
2376   "addition of default argument on redeclaration makes this constructor a "
2377   "%select{default|copy|move}0 constructor">;
2378
2379 def err_use_of_default_argument_to_function_declared_later : Error<
2380   "use of default argument to function %0 that is declared later in class %1">;
2381 def note_default_argument_declared_here : Note<
2382   "default argument declared here">;
2383
2384 def ext_param_promoted_not_compatible_with_prototype : ExtWarn<
2385   "%diff{promoted type $ of K&R function parameter is not compatible with the "
2386   "parameter type $|promoted type of K&R function parameter is not compatible "
2387   "with parameter type}0,1 declared in a previous prototype">,
2388   InGroup<KNRPromotedParameter>;
2389
2390
2391 // C++ Overloading Semantic Analysis.
2392 def err_ovl_diff_return_type : Error<
2393   "functions that differ only in their return type cannot be overloaded">;
2394 def err_ovl_static_nonstatic_member : Error<
2395   "static and non-static member functions with the same parameter types "
2396   "cannot be overloaded">;
2397
2398 def err_ovl_no_viable_function_in_call : Error<
2399   "no matching function for call to %0">;
2400 def err_ovl_no_viable_member_function_in_call : Error<
2401   "no matching member function for call to %0">;
2402 def err_ovl_ambiguous_call : Error<
2403   "call to %0 is ambiguous">;
2404 def err_ovl_deleted_call : Error<
2405   "call to %select{unavailable|deleted}0 function %1%2">;
2406 def err_ovl_ambiguous_member_call : Error<
2407   "call to member function %0 is ambiguous">;
2408 def err_ovl_deleted_member_call : Error<
2409   "call to %select{unavailable|deleted}0 member function %1%2">;
2410 def note_ovl_too_many_candidates : Note<
2411     "remaining %0 candidate%s0 omitted; "
2412     "pass -fshow-overloads=all to show them">;
2413 def note_ovl_candidate : Note<"candidate "
2414     "%select{function|function|constructor|"
2415     "function |function |constructor |"
2416     "is the implicit default constructor|"
2417     "is the implicit copy constructor|"
2418     "is the implicit move constructor|"
2419     "is the implicit copy assignment operator|"
2420     "is the implicit move assignment operator|"
2421     "is an inherited constructor}0%1"
2422     "%select{| has different class%diff{ (expected $ but has $)|}3,4"
2423     "| has different number of parameters (expected %3 but has %4)"
2424     "| has type mismatch at %ordinal3 parameter"
2425     "%diff{ (expected $ but has $)|}4,5"
2426     "| has different return type%diff{ ($ expected but has $)|}3,4"
2427     "| has different qualifiers (expected "
2428     "%select{none|const|restrict|const and restrict|volatile|const and volatile"
2429     "|volatile and restrict|const, volatile, and restrict}3 but found "
2430     "%select{none|const|restrict|const and restrict|volatile|const and volatile"
2431     "|volatile and restrict|const, volatile, and restrict}4)}2">;
2432
2433 def note_ovl_candidate_inherited_constructor : Note<"inherited from here">;
2434 def note_ovl_candidate_bad_deduction : Note<
2435     "candidate template ignored: failed template argument deduction">;
2436 def note_ovl_candidate_incomplete_deduction : Note<"candidate template ignored: "
2437     "couldn't infer template argument %0">;
2438 def note_ovl_candidate_inconsistent_deduction : Note<
2439     "candidate template ignored: deduced conflicting %select{types|values|"
2440     "templates}0 for parameter %1%diff{ ($ vs. $)|}2,3">;
2441 def note_ovl_candidate_explicit_arg_mismatch_named : Note<
2442     "candidate template ignored: invalid explicitly-specified argument "
2443     "for template parameter %0">;
2444 def note_ovl_candidate_explicit_arg_mismatch_unnamed : Note<
2445     "candidate template ignored: invalid explicitly-specified argument "
2446     "for %ordinal0 template parameter">;
2447 def note_ovl_candidate_instantiation_depth : Note<
2448     "candidate template ignored: substitution exceeded maximum template "
2449     "instantiation depth">;
2450 def note_ovl_candidate_underqualified : Note<
2451     "candidate template ignored: can't deduce a type for %0 which would "
2452     "make %2 equal %1">;
2453 def note_ovl_candidate_substitution_failure : Note<
2454     "candidate template ignored: substitution failure%0%1">;
2455 def note_ovl_candidate_disabled_by_enable_if : Note<
2456     "candidate template ignored: disabled by %0%1">;
2457 def note_ovl_candidate_failed_overload_resolution : Note<
2458     "candidate template ignored: couldn't resolve reference to overloaded "
2459     "function %0">;
2460 def note_ovl_candidate_non_deduced_mismatch : Note<
2461     "candidate template ignored: could not match %diff{$ against $|types}0,1">;
2462 // This note is needed because the above note would sometimes print two
2463 // different types with the same name.  Remove this note when the above note
2464 // can handle that case properly.
2465 def note_ovl_candidate_non_deduced_mismatch_qualified : Note<
2466     "candidate template ignored: could not match %q0 against %q1">;
2467     
2468 // Note that we don't treat templates differently for this diagnostic.
2469 def note_ovl_candidate_arity : Note<"candidate "
2470     "%select{function|function|constructor|function|function|constructor|"
2471     "constructor (the implicit default constructor)|"
2472     "constructor (the implicit copy constructor)|"
2473     "constructor (the implicit move constructor)|"
2474     "function (the implicit copy assignment operator)|"
2475     "function (the implicit move assignment operator)|"
2476     "constructor (inherited)}0 %select{|template }1"
2477     "not viable: requires%select{ at least| at most|}2 %3 argument%s3, but %4 "
2478     "%plural{1:was|:were}4 provided">;
2479
2480 def note_ovl_candidate_arity_one : Note<"candidate "
2481     "%select{function|function|constructor|function|function|constructor|"
2482     "constructor (the implicit default constructor)|"
2483     "constructor (the implicit copy constructor)|"
2484     "constructor (the implicit move constructor)|"
2485     "function (the implicit copy assignment operator)|"
2486     "function (the implicit move assignment operator)|"
2487     "constructor (inherited)}0 %select{|template }1not viable: "
2488     "%select{requires at least|allows at most single|requires single}2 "
2489     "argument %3, but %plural{0:no|:%4}4 arguments were provided">;
2490
2491 def note_ovl_candidate_deleted : Note<
2492     "candidate %select{function|function|constructor|"
2493     "function |function |constructor |"
2494     "constructor (the implicit default constructor)|"
2495     "constructor (the implicit copy constructor)|"
2496     "constructor (the implicit move constructor)|"
2497     "function (the implicit copy assignment operator)|"
2498     "function (the implicit move assignment operator)|"
2499     "constructor (inherited)}0%1 has been "
2500     "%select{explicitly made unavailable|explicitly deleted|"
2501     "implicitly deleted}2">;
2502
2503 // Giving the index of the bad argument really clutters this message, and
2504 // it's relatively unimportant because 1) it's generally obvious which
2505 // argument(s) are of the given object type and 2) the fix is usually
2506 // to complete the type, which doesn't involve changes to the call line
2507 // anyway.  If people complain, we can change it.
2508 def note_ovl_candidate_bad_conv_incomplete : Note<"candidate "
2509     "%select{function|function|constructor|"
2510     "function |function |constructor |"
2511     "constructor (the implicit default constructor)|"
2512     "constructor (the implicit copy constructor)|"
2513     "constructor (the implicit move constructor)|"
2514     "function (the implicit copy assignment operator)|"
2515     "function (the implicit move assignment operator)|"
2516     "constructor (inherited)}0%1 "
2517     "not viable: cannot convert argument of incomplete type "
2518     "%diff{$ to $|to parameter type}2,3">;
2519 def note_ovl_candidate_bad_list_argument : Note<"candidate "
2520     "%select{function|function|constructor|"
2521     "function |function |constructor |"
2522     "constructor (the implicit default constructor)|"
2523     "constructor (the implicit copy constructor)|"
2524     "constructor (the implicit move constructor)|"
2525     "function (the implicit copy assignment operator)|"
2526     "function (the implicit move assignment operator)|"
2527     "constructor (inherited)}0%1 "
2528     "not viable: cannot convert initializer list argument to %3">;
2529 def note_ovl_candidate_bad_overload : Note<"candidate "
2530     "%select{function|function|constructor|"
2531     "function |function |constructor |"
2532     "constructor (the implicit default constructor)|"
2533     "constructor (the implicit copy constructor)|"
2534     "constructor (the implicit move constructor)|"
2535     "function (the implicit copy assignment operator)|"
2536     "function (the implicit move assignment operator)|"
2537     "constructor (inherited)}0%1"
2538     " not viable: no overload of %3 matching %2 for %ordinal4 argument">;
2539 def note_ovl_candidate_bad_conv : Note<"candidate "
2540     "%select{function|function|constructor|"
2541     "function |function |constructor |"
2542     "constructor (the implicit default constructor)|"
2543     "constructor (the implicit copy constructor)|"
2544     "constructor (the implicit move constructor)|"
2545     "function (the implicit copy assignment operator)|"
2546     "function (the implicit move assignment operator)|"
2547     "constructor (inherited)}0%1"
2548     " not viable: no known conversion "
2549     "%diff{from $ to $|from argument type to parameter type}2,3 for "
2550     "%select{%ordinal5 argument|object argument}4"
2551     "%select{|; dereference the argument with *|"
2552     "; take the address of the argument with &|"
2553     "; remove *|"
2554     "; remove &}6">;
2555 def note_ovl_candidate_bad_arc_conv : Note<"candidate "
2556     "%select{function|function|constructor|"
2557     "function |function |constructor |"
2558     "constructor (the implicit default constructor)|"
2559     "constructor (the implicit copy constructor)|"
2560     "constructor (the implicit move constructor)|"
2561     "function (the implicit copy assignment operator)|"
2562     "function (the implicit move assignment operator)|"
2563     "constructor (inherited)}0%1"
2564     " not viable: cannot implicitly convert argument "
2565     "%diff{of type $ to $|type to parameter type}2,3 for "
2566     "%select{%ordinal5 argument|object argument}4 under ARC">;
2567 def note_ovl_candidate_bad_lvalue : Note<"candidate "
2568     "%select{function|function|constructor|"
2569     "function |function |constructor |"
2570     "constructor (the implicit default constructor)|"
2571     "constructor (the implicit copy constructor)|"
2572     "constructor (the implicit move constructor)|"
2573     "function (the implicit copy assignment operator)|"
2574     "function (the implicit move assignment operator)|"
2575     "constructor (inherited)}0%1"
2576     " not viable: expects an l-value for "
2577     "%select{%ordinal3 argument|object argument}2">;
2578 def note_ovl_candidate_bad_addrspace : Note<"candidate "
2579     "%select{function|function|constructor|"
2580     "function |function |constructor |"
2581     "constructor (the implicit default constructor)|"
2582     "constructor (the implicit copy constructor)|"
2583     "constructor (the implicit move constructor)|"
2584     "function (the implicit copy assignment operator)|"
2585     "function (the implicit move assignment operator)|"
2586     "constructor (inherited)}0%1 not viable: "
2587     "%select{%ordinal6|'this'}5 argument (%2) is in "
2588     "address space %3, but parameter must be in address space %4">;
2589 def note_ovl_candidate_bad_gc : Note<"candidate "
2590     "%select{function|function|constructor|"
2591     "function |function |constructor |"
2592     "constructor (the implicit default constructor)|"
2593     "constructor (the implicit copy constructor)|"
2594     "constructor (the implicit move constructor)|"
2595     "function (the implicit copy assignment operator)|"
2596     "function (the implicit move assignment operator)|"
2597     "constructor (inherited)}0%1 not viable: "
2598     "%select{%ordinal6|'this'}5 argument (%2) has %select{no|__weak|__strong}3 "
2599     "ownership, but parameter has %select{no|__weak|__strong}4 ownership">;
2600 def note_ovl_candidate_bad_ownership : Note<"candidate "
2601     "%select{function|function|constructor|"
2602     "function |function |constructor |"
2603     "constructor (the implicit default constructor)|"
2604     "constructor (the implicit copy constructor)|"
2605     "constructor (the implicit move constructor)|"
2606     "function (the implicit copy assignment operator)|"
2607     "function (the implicit move assignment operator)|"
2608     "constructor (inherited)}0%1 not viable: "
2609     "%select{%ordinal6|'this'}5 argument (%2) has "
2610     "%select{no|__unsafe_unretained|__strong|__weak|__autoreleasing}3 ownership,"
2611     " but parameter has %select{no|__unsafe_unretained|__strong|__weak|"
2612     "__autoreleasing}4 ownership">;
2613 def note_ovl_candidate_bad_cvr_this : Note<"candidate "
2614     "%select{|function|||function|||||"
2615     "function (the implicit copy assignment operator)|"
2616     "function (the implicit move assignment operator)|}0 not viable: "
2617     "'this' argument has type %2, but method is not marked "
2618     "%select{const|restrict|const or restrict|volatile|const or volatile|"
2619     "volatile or restrict|const, volatile, or restrict}3">;
2620 def note_ovl_candidate_bad_cvr : Note<"candidate "
2621     "%select{function|function|constructor|"
2622     "function |function |constructor |"
2623     "constructor (the implicit default constructor)|"
2624     "constructor (the implicit copy constructor)|"
2625     "constructor (the implicit move constructor)|"
2626     "function (the implicit copy assignment operator)|"
2627     "function (the implicit move assignment operator)|"
2628     "constructor (inherited)}0%1 not viable: "
2629     "%ordinal4 argument (%2) would lose "
2630     "%select{const|restrict|const and restrict|volatile|const and volatile|"
2631     "volatile and restrict|const, volatile, and restrict}3 qualifier"
2632     "%select{||s||s|s|s}3">;
2633 def note_ovl_candidate_bad_base_to_derived_conv : Note<"candidate "
2634     "%select{function|function|constructor|"
2635     "function |function |constructor |"
2636     "constructor (the implicit default constructor)|"
2637     "constructor (the implicit copy constructor)|"
2638     "constructor (the implicit move constructor)|"
2639     "function (the implicit copy assignment operator)|"
2640     "function (the implicit move assignment operator)|"
2641     "constructor (inherited)}0%1"
2642     " not viable: cannot %select{convert from|convert from|bind}2 "
2643     "%select{base class pointer|superclass|base class object of type}2 %3 to "
2644     "%select{derived class pointer|subclass|derived class reference}2 %4 for "
2645     "%ordinal5 argument">;
2646 def note_ovl_candidate_bad_target : Note<
2647     "candidate %select{function|function|constructor|"
2648     "function |function |constructor |"
2649     "constructor (the implicit default constructor)|"
2650     "constructor (the implicit copy constructor)|"
2651     "constructor (the implicit move constructor)|"
2652     "function (the implicit copy assignment operator)|"
2653     "function (the implicit move assignment operator)|"
2654     "constructor (inherited)}0 not viable: call to "
2655     "%select{__device__|__global__|__host__|__host__ __device__}1 function from"
2656     " %select{__device__|__global__|__host__|__host__ __device__}2 function">;
2657
2658 def note_ambiguous_type_conversion: Note<
2659     "because of ambiguity in conversion %diff{of $ to $|between types}0,1">;
2660 def note_ovl_builtin_binary_candidate : Note<
2661     "built-in candidate %0">;
2662 def note_ovl_builtin_unary_candidate : Note<
2663     "built-in candidate %0">;
2664 def err_ovl_no_viable_function_in_init : Error<
2665   "no matching constructor for initialization of %0">;
2666 def err_ovl_no_conversion_in_cast : Error<
2667   "cannot convert %1 to %2 without a conversion operator">;
2668 def err_ovl_no_viable_conversion_in_cast : Error<
2669   "no matching conversion for %select{|static_cast|reinterpret_cast|"
2670   "dynamic_cast|C-style cast|functional-style cast}0 from %1 to %2">;
2671 def err_ovl_ambiguous_conversion_in_cast : Error<
2672   "ambiguous conversion for %select{|static_cast|reinterpret_cast|"
2673   "dynamic_cast|C-style cast|functional-style cast}0 from %1 to %2">;
2674 def err_ovl_deleted_conversion_in_cast : Error<
2675   "%select{|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
2676   "functional-style cast}0 from %1 to %2 uses deleted function">;
2677 def err_ovl_ambiguous_init : Error<"call to constructor of %0 is ambiguous">;
2678 def err_ref_init_ambiguous : Error<
2679   "reference initialization of type %0 with initializer of type %1 is ambiguous">;
2680 def err_ovl_deleted_init : Error<
2681   "call to %select{unavailable|deleted}0 constructor of %1">;
2682 def err_ovl_deleted_special_init : Error<
2683   "call to implicitly-deleted %select{default constructor|copy constructor|"
2684   "move constructor|copy assignment operator|move assignment operator|"
2685   "destructor|function}0 of %1">;
2686 def err_ovl_ambiguous_oper_unary : Error<
2687   "use of overloaded operator '%0' is ambiguous (operand type %1)">;
2688 def err_ovl_ambiguous_oper_binary : Error<
2689   "use of overloaded operator '%0' is ambiguous (with operand types %1 and %2)">;
2690 def err_ovl_no_viable_oper : Error<"no viable overloaded '%0'">;
2691 def err_ovl_deleted_oper : Error<
2692   "overload resolution selected %select{unavailable|deleted}0 operator '%1'%2">;
2693 def err_ovl_deleted_special_oper : Error<
2694   "object of type %0 cannot be %select{constructed|copied|moved|assigned|"
2695   "assigned|destroyed}1 because its %select{default constructor|"
2696   "copy constructor|move constructor|copy assignment operator|"
2697   "move assignment operator|destructor}1 is implicitly deleted">;
2698 def err_ovl_no_viable_subscript :
2699     Error<"no viable overloaded operator[] for type %0">;
2700 def err_ovl_no_oper :
2701     Error<"type %0 does not provide a %select{subscript|call}1 operator">;
2702 def err_ovl_unresolvable : Error<
2703   "reference to overloaded function could not be resolved; "
2704   "did you mean to call it%select{| with no arguments}0?">;
2705 def err_bound_member_function : Error<
2706   "reference to non-static member function must be called"
2707   "%select{|; did you mean to call it with no arguments?}0">;
2708 def note_possible_target_of_call : Note<"possible target for call">;
2709
2710 def err_ovl_no_viable_object_call : Error<
2711   "no matching function for call to object of type %0">;
2712 def err_ovl_ambiguous_object_call : Error<
2713   "call to object of type %0 is ambiguous">;
2714 def err_ovl_deleted_object_call : Error<
2715   "call to %select{unavailable|deleted}0 function call operator in type %1%2">;
2716 def note_ovl_surrogate_cand : Note<"conversion candidate of type %0">;
2717 def err_member_call_without_object : Error<
2718   "call to non-static member function without an object argument">;
2719
2720 // C++ Address of Overloaded Function
2721 def err_addr_ovl_no_viable : Error<
2722   "address of overloaded function %0 does not match required type %1">;
2723 def err_addr_ovl_ambiguous : Error<
2724   "address of overloaded function %0 is ambiguous">;
2725 def err_addr_ovl_not_func_ptrref : Error<
2726   "address of overloaded function %0 cannot be converted to type %1">;
2727 def err_addr_ovl_no_qualifier : Error<
2728   "can't form member pointer of type %0 without '&' and class name">;
2729
2730 // C++11 Literal Operators
2731 def err_ovl_no_viable_literal_operator : Error<
2732   "no matching literal operator for call to %0"
2733   "%select{| with argument of type %2| with arguments of types %2 and %3}1"
2734   "%select{| or 'const char *', and no matching literal operator template}4">;
2735
2736 // C++ Template Declarations
2737 def err_template_param_shadow : Error<
2738   "declaration of %0 shadows template parameter">;
2739 def note_template_param_here : Note<"template parameter is declared here">;
2740 def warn_template_export_unsupported : Warning<
2741   "exported templates are unsupported">;
2742 def err_template_outside_namespace_or_class_scope : Error<
2743   "templates can only be declared in namespace or class scope">;
2744 def err_template_linkage : Error<"templates must have C++ linkage">;
2745 def err_template_typedef : Error<"a typedef cannot be a template">;
2746 def err_template_unnamed_class : Error<
2747   "cannot declare a class template with no name">;
2748 def err_template_param_list_different_arity : Error<
2749   "%select{too few|too many}0 template parameters in template "
2750   "%select{|template parameter }1redeclaration">;
2751 def note_template_param_list_different_arity : Note<
2752   "%select{too few|too many}0 template parameters in template template "
2753   "argument">;
2754 def note_template_prev_declaration : Note<
2755   "previous template %select{declaration|template parameter}0 is here">;
2756 def err_template_param_different_kind : Error<
2757   "template parameter has a different kind in template "
2758   "%select{|template parameter }0redeclaration">;
2759 def note_template_param_different_kind : Note<
2760   "template parameter has a different kind in template argument">;
2761   
2762 def err_template_nontype_parm_different_type : Error<
2763   "template non-type parameter has a different type %0 in template "
2764   "%select{|template parameter }1redeclaration">;
2765
2766 def note_template_nontype_parm_different_type : Note<
2767   "template non-type parameter has a different type %0 in template argument">;
2768 def note_template_nontype_parm_prev_declaration : Note<
2769   "previous non-type template parameter with type %0 is here">;
2770 def err_template_nontype_parm_bad_type : Error<
2771   "a non-type template parameter cannot have type %0">;
2772 def err_template_param_default_arg_redefinition : Error<
2773   "template parameter redefines default argument">;
2774 def note_template_param_prev_default_arg : Note<
2775   "previous default template argument defined here">;
2776 def err_template_param_default_arg_missing : Error<
2777   "template parameter missing a default argument">;
2778 def ext_template_parameter_default_in_function_template : ExtWarn<
2779   "default template arguments for a function template are a C++11 extension">,
2780   InGroup<CXX11>;
2781 def warn_cxx98_compat_template_parameter_default_in_function_template : Warning<
2782   "default template arguments for a function template are incompatible with C++98">,
2783   InGroup<CXX98Compat>, DefaultIgnore;
2784 def err_template_parameter_default_template_member : Error<
2785   "cannot add a default template argument to the definition of a member of a "
2786   "class template">;
2787 def err_template_parameter_default_friend_template : Error<
2788   "default template argument not permitted on a friend template">;
2789 def err_template_template_parm_no_parms : Error<
2790   "template template parameter must have its own template parameters">;
2791
2792 def err_template_variable : Error<"variable %0 declared as a template">;
2793 def err_template_variable_noparams : Error<
2794   "extraneous 'template<>' in declaration of variable %0">;
2795 def err_template_member : Error<"member %0 declared as a template">;
2796 def err_template_member_noparams : Error<
2797   "extraneous 'template<>' in declaration of member %0">;
2798 def err_template_tag_noparams : Error<
2799   "extraneous 'template<>' in declaration of %0 %1">;
2800 def err_template_decl_ref : Error<
2801   "cannot refer to class template %0 without a template argument list">;
2802
2803 // C++ Template Argument Lists
2804 def err_template_missing_args : Error<
2805   "use of class template %0 requires template arguments">;
2806 def err_template_arg_list_different_arity : Error<
2807   "%select{too few|too many}0 template arguments for "
2808   "%select{class template|function template|template template parameter"
2809   "|template}1 %2">;
2810 def note_template_decl_here : Note<"template is declared here">;
2811 def note_member_of_template_here : Note<"member is declared here">;
2812 def err_template_arg_must_be_type : Error<
2813   "template argument for template type parameter must be a type">;
2814 def err_template_arg_must_be_type_suggest : Error<
2815   "template argument for template type parameter must be a type; did you forget 'typename'?">;
2816 def err_template_arg_must_be_expr : Error<
2817   "template argument for non-type template parameter must be an expression">;
2818 def err_template_arg_nontype_ambig : Error<
2819   "template argument for non-type template parameter is treated as function type %0">;
2820 def err_template_arg_must_be_template : Error<
2821   "template argument for template template parameter must be a class template%select{| or type alias template}0">;
2822 def ext_template_arg_local_type : ExtWarn<
2823   "template argument uses local type %0">, InGroup<LocalTypeTemplateArgs>;
2824 def ext_template_arg_unnamed_type : ExtWarn<
2825   "template argument uses unnamed type">, InGroup<UnnamedTypeTemplateArgs>;
2826 def warn_cxx98_compat_template_arg_local_type : Warning<
2827   "local type %0 as template argument is incompatible with C++98">,
2828   InGroup<CXX98CompatLocalTypeTemplateArgs>, DefaultIgnore;
2829 def warn_cxx98_compat_template_arg_unnamed_type : Warning<
2830   "unnamed type as template argument is incompatible with C++98">,
2831   InGroup<CXX98CompatUnnamedTypeTemplateArgs>, DefaultIgnore;
2832 def note_template_unnamed_type_here : Note<
2833   "unnamed type used in template argument was declared here">;
2834 def err_template_arg_overload_type : Error<
2835   "template argument is the type of an unresolved overloaded function">;
2836 def err_template_arg_not_class_template : Error<
2837   "template argument does not refer to a class template or template "
2838   "template parameter">;
2839 def note_template_arg_refers_here_func : Note<
2840   "template argument refers to function template %0, here">;
2841 def err_template_arg_template_params_mismatch : Error<
2842   "template template argument has different template parameters than its "
2843   "corresponding template template parameter">;
2844 def err_template_arg_not_integral_or_enumeral : Error<
2845   "non-type template argument of type %0 must have an integral or enumeration"
2846   " type">;
2847 def err_template_arg_not_ice : Error<
2848   "non-type template argument of type %0 is not an integral constant "
2849   "expression">;
2850 def err_template_arg_not_address_constant : Error<
2851   "non-type template argument of type %0 is not a constant expression">;
2852 def warn_cxx98_compat_template_arg_null : Warning<
2853   "use of null pointer as non-type template argument is incompatible with "
2854   "C++98">, InGroup<CXX98Compat>, DefaultIgnore;
2855 def err_template_arg_untyped_null_constant : Error<
2856   "null non-type template argument must be cast to template parameter type %0">;
2857 def err_template_arg_wrongtype_null_constant : Error<
2858  "null non-type template argument of type %0 does not match template parameter "
2859  "of type %1">;
2860 def err_deduced_non_type_template_arg_type_mismatch : Error<
2861   "deduced non-type template argument does not have the same type as the "
2862   "its corresponding template parameter%diff{ ($ vs $)|}0,1">;
2863 def err_template_arg_not_convertible : Error<
2864   "non-type template argument of type %0 cannot be converted to a value "
2865   "of type %1">;
2866 def warn_template_arg_negative : Warning<
2867   "non-type template argument with value '%0' converted to '%1' for unsigned "
2868   "template parameter of type %2">, InGroup<Conversion>, DefaultIgnore;
2869 def warn_template_arg_too_large : Warning<
2870   "non-type template argument value '%0' truncated to '%1' for "
2871   "template parameter of type %2">, InGroup<Conversion>, DefaultIgnore;
2872 def err_template_arg_no_ref_bind : Error<
2873   "non-type template parameter of reference type "
2874   "%diff{$ cannot bind to template argument of type $"
2875   "|cannot bind to template of incompatible argument type}0,1">;
2876 def err_template_arg_ref_bind_ignores_quals : Error<
2877   "reference binding of non-type template parameter "
2878   "%diff{of type $ to template argument of type $|to template argument}0,1 "
2879   "ignores qualifiers">;
2880 def err_template_arg_not_decl_ref : Error<
2881   "non-type template argument does not refer to any declaration">;
2882 def err_template_arg_not_object_or_func_form : Error<
2883   "non-type template argument does not directly refer to an object or "
2884   "function">;
2885 def err_template_arg_not_address_of : Error<
2886   "non-type template argument for template parameter of pointer type %0 must "
2887   "have its address taken">;
2888 def err_template_arg_address_of_non_pointer : Error<
2889   "address taken in non-type template argument for template parameter of "
2890   "reference type %0">;
2891 def err_template_arg_reference_var : Error<
2892   "non-type template argument of reference type %0 is not an object">;
2893 def err_template_arg_field : Error<
2894   "non-type template argument refers to non-static data member %0">;
2895 def err_template_arg_method : Error<
2896   "non-type template argument refers to non-static member function %0">;
2897 def err_template_arg_object_no_linkage : Error<
2898   "non-type template argument refers to %select{function|object}0 %1 that "
2899   "does not have linkage">;
2900 def warn_cxx98_compat_template_arg_object_internal : Warning<
2901   "non-type template argument referring to %select{function|object}0 %1 with "
2902   "internal linkage is incompatible with C++98">,
2903   InGroup<CXX98Compat>, DefaultIgnore;
2904 def ext_template_arg_object_internal : ExtWarn<
2905   "non-type template argument referring to %select{function|object}0 %1 with "
2906   "internal linkage is a C++11 extension">, InGroup<CXX11>;
2907 def err_template_arg_thread_local : Error<
2908   "non-type template argument refers to thread-local object">;
2909 def note_template_arg_internal_object : Note<
2910   "non-type template argument refers to %select{function|object}0 here">;
2911 def note_template_arg_refers_here : Note<
2912   "non-type template argument refers here">;
2913 def err_template_arg_not_object_or_func : Error<
2914   "non-type template argument does not refer to an object or function">;
2915 def err_template_arg_not_pointer_to_member_form : Error<
2916   "non-type template argument is not a pointer to member constant">;
2917 def ext_template_arg_extra_parens : ExtWarn<
2918   "address non-type template argument cannot be surrounded by parentheses">;
2919 def warn_cxx98_compat_template_arg_extra_parens : Warning<
2920   "redundant parentheses surrounding address non-type template argument are "
2921   "incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
2922 def err_pointer_to_member_type : Error<
2923   "invalid use of pointer to member type after %select{.*|->*}0">;
2924 def err_pointer_to_member_call_drops_quals : Error<
2925   "call to pointer to member function of type %0 drops '%1' qualifier%s2">;
2926 def err_pointer_to_member_oper_value_classify: Error<
2927   "pointer-to-member function type %0 can only be called on an "
2928   "%select{rvalue|lvalue}1">;
2929
2930 // C++ template specialization
2931 def err_template_spec_unknown_kind : Error<
2932   "can only provide an explicit specialization for a class template, function "
2933   "template, or a member function, static data member, "
2934   "%select{or member class|member class, or member enumeration}0 of a "
2935   "class template">;
2936 def note_specialized_entity : Note<
2937   "explicitly specialized declaration is here">;
2938 def err_template_spec_decl_function_scope : Error<
2939   "explicit specialization of %0 in function scope">;
2940 def err_template_spec_decl_class_scope : Error<
2941   "explicit specialization of %0 in class scope">;
2942 def err_template_spec_decl_friend : Error<
2943   "cannot declare an explicit specialization in a friend">;
2944 def err_template_spec_decl_out_of_scope_global : Error<
2945   "%select{class template|class template partial|function template|member "
2946   "function|static data member|member class|member enumeration}0 "
2947   "specialization of %1 must originally be declared in the global scope">;
2948 def err_template_spec_decl_out_of_scope : Error<
2949   "%select{class template|class template partial|function template|member "
2950   "function|static data member|member class|member enumeration}0 "
2951   "specialization of %1 must originally be declared in namespace %2">;
2952 def ext_template_spec_decl_out_of_scope : ExtWarn<
2953   "first declaration of %select{class template|class template partial|"
2954   "function template|member function|static data member|member class|"
2955   "member enumeration}0 specialization of %1 outside namespace %2 is a "
2956   "C++11 extension">, InGroup<CXX11>;
2957 def warn_cxx98_compat_template_spec_decl_out_of_scope : Warning<
2958   "%select{class template|class template partial|function template|member "
2959   "function|static data member|member class|member enumeration}0 "
2960   "specialization of %1 outside namespace %2 is incompatible with C++98">,
2961   InGroup<CXX98Compat>, DefaultIgnore;
2962 def err_template_spec_redecl_out_of_scope : Error<
2963   "%select{class template|class template partial|function template|member "
2964   "function|static data member|member class|member enumeration}0 "
2965   "specialization of %1 not in a namespace enclosing %2">;
2966 def err_template_spec_redecl_global_scope : Error<
2967   "%select{class template|class template partial|function template|member "
2968   "function|static data member|member class|member enumeration}0 "
2969   "specialization of %1 must occur at global scope">;
2970 def err_spec_member_not_instantiated : Error<
2971   "specialization of member %q0 does not specialize an instantiated member">;
2972 def note_specialized_decl : Note<"attempt to specialize declaration here">;
2973 def err_specialization_after_instantiation : Error<
2974   "explicit specialization of %0 after instantiation">;
2975 def note_instantiation_required_here : Note<
2976   "%select{implicit|explicit}0 instantiation first required here">;
2977 def err_template_spec_friend : Error<
2978   "template specialization declaration cannot be a friend">;
2979 def err_template_spec_default_arg : Error<
2980   "default argument not permitted on an explicit "
2981   "%select{instantiation|specialization}0 of function %1">;
2982 def err_not_class_template_specialization : Error<
2983   "cannot specialize a %select{dependent template|template template "
2984   "parameter}0">;
2985 def err_function_specialization_in_class : Error<
2986   "cannot specialize a function %0 within class scope">;
2987 def ext_function_specialization_in_class : ExtWarn<
2988   "explicit specialization of %0 within class scope is a Microsoft extension">,
2989   InGroup<Microsoft>;
2990 def ext_explicit_specialization_storage_class : ExtWarn<
2991   "explicit specialization cannot have a storage class">;
2992 def err_explicit_specialization_inconsistent_storage_class : Error<
2993   "explicit specialization has extraneous, inconsistent storage class "
2994   "'%select{none|extern|static|__private_extern__|auto|register}0'">;
2995
2996 // C++ class template specializations and out-of-line definitions
2997 def err_template_spec_needs_header : Error<
2998   "template specialization requires 'template<>'">;
2999 def err_template_spec_needs_template_parameters : Error<
3000   "template specialization or definition requires a template parameter list "
3001   "corresponding to the nested type %0">;
3002 def err_template_param_list_matches_nontemplate : Error<
3003   "template parameter list matching the non-templated nested type %0 should "
3004   "be empty ('template<>')">;
3005 def err_alias_template_extra_headers : Error<
3006   "extraneous template parameter list in alias template declaration">;
3007 def err_template_spec_extra_headers : Error<
3008   "extraneous template parameter list in template specialization or "
3009   "out-of-line template definition">;
3010 def warn_template_spec_extra_headers : Warning<
3011   "extraneous template parameter list in template specialization">;
3012 def note_explicit_template_spec_does_not_need_header : Note<
3013   "'template<>' header not required for explicitly-specialized class %0 "
3014   "declared here">;
3015 def err_template_qualified_declarator_no_match : Error<
3016   "nested name specifier '%0' for declaration does not refer into a class, "
3017   "class template or class template partial specialization">;
3018 def err_specialize_member_of_template : Error<
3019   "cannot specialize (with 'template<>') a member of an unspecialized "
3020   "template">;
3021
3022 // C++ Class Template Partial Specialization
3023 def err_default_arg_in_partial_spec : Error<
3024     "default template argument in a class template partial specialization">;
3025 def err_dependent_non_type_arg_in_partial_spec : Error<
3026     "non-type template argument depends on a template parameter of the "
3027     "partial specialization">;
3028 def err_dependent_typed_non_type_arg_in_partial_spec : Error<
3029     "non-type template argument specializes a template parameter with "
3030     "dependent type %0">;
3031 def err_partial_spec_args_match_primary_template : Error<
3032     "class template partial specialization does not specialize any template "
3033     "argument; to %select{declare|define}0 the primary template, remove the "
3034     "template argument list">; 
3035 def warn_partial_specs_not_deducible : Warning<
3036     "class template partial specialization contains "
3037     "%select{a template parameter|template parameters}0 that can not be "
3038     "deduced; this partial specialization will never be used">;
3039 def note_partial_spec_unused_parameter : Note<
3040     "non-deducible template parameter %0">;
3041 def err_partial_spec_ordering_ambiguous : Error<
3042     "ambiguous partial specializations of %0">;
3043 def note_partial_spec_match : Note<"partial specialization matches %0">;
3044 def err_partial_spec_redeclared : Error<
3045   "class template partial specialization %0 cannot be redeclared">;
3046 def note_prev_partial_spec_here : Note<
3047   "previous declaration of class template partial specialization %0 is here">;
3048 def err_partial_spec_fully_specialized : Error<
3049   "partial specialization of %0 does not use any of its template parameters">;
3050   
3051 // C++ Function template specializations
3052 def err_function_template_spec_no_match : Error<
3053     "no function template matches function template specialization %0">;
3054 def err_function_template_spec_ambiguous : Error<
3055     "function template specialization %0 ambiguously refers to more than one "
3056     "function template; explicitly specify%select{| additional}1 template "
3057     "arguments to identify a particular function template">;
3058 def note_function_template_spec_matched : Note<
3059     "function template matches specialization %0">;
3060 def err_function_template_partial_spec : Error<
3061     "function template partial specialization is not allowed">;
3062
3063 // C++ Template Instantiation
3064 def err_template_recursion_depth_exceeded : Error<
3065   "recursive template instantiation exceeded maximum depth of %0">,
3066   DefaultFatal, NoSFINAE;
3067 def note_template_recursion_depth : Note<
3068   "use -ftemplate-depth=N to increase recursive template instantiation depth">;
3069
3070 def err_template_instantiate_within_definition : Error<
3071   "%select{implicit|explicit}0 instantiation of template %1 within its"
3072   " own definition">;
3073 def err_template_instantiate_undefined : Error<
3074   "%select{implicit|explicit}0 instantiation of undefined template %1">;
3075 def err_implicit_instantiate_member_undefined : Error<
3076   "implicit instantiation of undefined member %0">;
3077 def note_template_class_instantiation_here : Note<
3078   "in instantiation of template class %0 requested here">;
3079 def note_template_member_class_here : Note<
3080   "in instantiation of member class %0 requested here">;
3081 def note_template_member_function_here : Note<
3082   "in instantiation of member function %q0 requested here">;
3083 def note_function_template_spec_here : Note<
3084   "in instantiation of function template specialization %q0 requested here">;
3085 def note_template_static_data_member_def_here : Note<
3086   "in instantiation of static data member %q0 requested here">;
3087 def note_template_enum_def_here : Note<
3088   "in instantiation of enumeration %q0 requested here">;
3089 def note_template_type_alias_instantiation_here : Note<
3090   "in instantiation of template type alias %0 requested here">;
3091 def note_template_exception_spec_instantiation_here : Note<
3092   "in instantiation of exception specification for %0 requested here">;
3093   
3094 def note_default_arg_instantiation_here : Note<
3095   "in instantiation of default argument for '%0' required here">;
3096 def note_default_function_arg_instantiation_here : Note<
3097   "in instantiation of default function argument expression "
3098   "for '%0' required here">;
3099 def note_explicit_template_arg_substitution_here : Note<
3100   "while substituting explicitly-specified template arguments into function "
3101   "template %0 %1">;
3102 def note_function_template_deduction_instantiation_here : Note<
3103   "while substituting deduced template arguments into function template %0 "
3104   "%1">;
3105 def note_partial_spec_deduct_instantiation_here : Note<
3106   "during template argument deduction for class template partial "
3107   "specialization %0 %1">;
3108 def note_prior_template_arg_substitution : Note<
3109   "while substituting prior template arguments into %select{non-type|template}0"
3110   " template parameter%1 %2">;
3111 def note_template_default_arg_checking : Note<
3112   "while checking a default template argument used here">;
3113 def note_instantiation_contexts_suppressed : Note<
3114   "(skipping %0 context%s0 in backtrace; use -ftemplate-backtrace-limit=0 to "
3115   "see all)">;
3116
3117 def err_field_instantiates_to_function : Error<
3118   "data member instantiated with function type %0">;
3119 def err_variable_instantiates_to_function : Error<
3120   "%select{variable|static data member}0 instantiated with function type %1">;
3121 def err_nested_name_spec_non_tag : Error<
3122   "type %0 cannot be used prior to '::' because it has no members">;
3123
3124 // C++ Explicit Instantiation
3125 def err_explicit_instantiation_duplicate : Error<
3126     "duplicate explicit instantiation of %0">;
3127 def note_previous_explicit_instantiation : Note<
3128     "previous explicit instantiation is here">;
3129 def ext_explicit_instantiation_after_specialization : Extension<
3130     "explicit instantiation of %0 that occurs after an explicit "
3131     "specialization will be ignored (C++11 extension)">,
3132     InGroup<CXX11>;
3133 def warn_cxx98_compat_explicit_instantiation_after_specialization : Warning<
3134     "explicit instantiation of %0 that occurs after an explicit "
3135     "specialization is incompatible with C++98">,
3136     InGroup<CXX98CompatPedantic>, DefaultIgnore;
3137 def note_previous_template_specialization : Note<
3138     "previous template specialization is here">;
3139 def err_explicit_instantiation_nontemplate_type : Error<
3140     "explicit instantiation of non-templated type %0">;
3141 def note_nontemplate_decl_here : Note<
3142     "non-templated declaration is here">;
3143 def err_explicit_instantiation_in_class : Error<
3144   "explicit instantiation of %0 in class scope">;
3145 def err_explicit_instantiation_out_of_scope : Error<
3146   "explicit instantiation of %0 not in a namespace enclosing %1">;
3147 def err_explicit_instantiation_must_be_global : Error<
3148   "explicit instantiation of %0 must occur at global scope">;
3149 def warn_explicit_instantiation_out_of_scope_0x : Warning<
3150   "explicit instantiation of %0 not in a namespace enclosing %1">, 
3151   InGroup<CXX11Compat>, DefaultIgnore;
3152 def warn_explicit_instantiation_must_be_global_0x : Warning<
3153   "explicit instantiation of %0 must occur at global scope">, 
3154   InGroup<CXX11Compat>, DefaultIgnore;
3155   
3156 def err_explicit_instantiation_requires_name : Error<
3157   "explicit instantiation declaration requires a name">;
3158 def err_explicit_instantiation_of_typedef : Error<
3159   "explicit instantiation of typedef %0">;
3160 def err_explicit_instantiation_storage_class : Error<
3161   "explicit instantiation cannot have a storage class">;
3162 def err_explicit_instantiation_not_known : Error<
3163   "explicit instantiation of %0 does not refer to a function template, member "
3164   "function, member class, or static data member">;
3165 def note_explicit_instantiation_here : Note<
3166   "explicit instantiation refers here">;
3167 def err_explicit_instantiation_data_member_not_instantiated : Error<
3168   "explicit instantiation refers to static data member %q0 that is not an "
3169   "instantiation">;
3170 def err_explicit_instantiation_member_function_not_instantiated : Error<
3171   "explicit instantiation refers to member function %q0 that is not an "
3172   "instantiation">;
3173 def err_explicit_instantiation_ambiguous : Error<
3174   "partial ordering for explicit instantiation of %0 is ambiguous">;
3175 def note_explicit_instantiation_candidate : Note<
3176   "explicit instantiation candidate function template here %0">;
3177 def err_explicit_instantiation_inline : Error<
3178   "explicit instantiation cannot be 'inline'">;
3179 def warn_explicit_instantiation_inline_0x : Warning<
3180   "explicit instantiation cannot be 'inline'">, InGroup<CXX11Compat>,
3181   DefaultIgnore;
3182 def err_explicit_instantiation_constexpr : Error<
3183   "explicit instantiation cannot be 'constexpr'">;
3184 def ext_explicit_instantiation_without_qualified_id : Extension<
3185   "qualifier in explicit instantiation of %q0 requires a template-id "
3186   "(a typedef is not permitted)">;
3187 def err_explicit_instantiation_unqualified_wrong_namespace : Error<
3188   "explicit instantiation of %q0 must occur in namespace %1">;
3189 def warn_explicit_instantiation_unqualified_wrong_namespace_0x : Warning<
3190   "explicit instantiation of %q0 must occur in namespace %1">,
3191   InGroup<CXX11Compat>, DefaultIgnore;
3192 def err_explicit_instantiation_undefined_member : Error<
3193   "explicit instantiation of undefined %select{member class|member function|"
3194   "static data member}0 %1 of class template %2">;
3195 def err_explicit_instantiation_undefined_func_template : Error<
3196   "explicit instantiation of undefined function template %0">;
3197 def err_explicit_instantiation_declaration_after_definition : Error<
3198   "explicit instantiation declaration (with 'extern') follows explicit "
3199   "instantiation definition (without 'extern')">;
3200 def note_explicit_instantiation_definition_here : Note<
3201   "explicit instantiation definition is here">;
3202   
3203 // C++ typename-specifiers
3204 def err_typename_nested_not_found : Error<"no type named %0 in %1">;
3205 def err_typename_nested_not_found_enable_if : Error<
3206   "no type named 'type' in %0; 'enable_if' cannot be used to disable "
3207   "this declaration">;
3208 def err_typename_nested_not_type : Error<
3209     "typename specifier refers to non-type member %0 in %1">;
3210 def note_typename_refers_here : Note<
3211     "referenced member %0 is declared here">;
3212 def err_typename_missing : Error<
3213   "missing 'typename' prior to dependent type name '%0%1'">;
3214 def warn_typename_missing : ExtWarn<
3215   "missing 'typename' prior to dependent type name '%0%1'">,
3216   InGroup<DiagGroup<"typename-missing">>;
3217 def ext_typename_outside_of_template : ExtWarn<
3218   "'typename' occurs outside of a template">, InGroup<CXX11>;
3219 def warn_cxx98_compat_typename_outside_of_template : Warning<
3220   "use of 'typename' outside of a template is incompatible with C++98">,
3221   InGroup<CXX98Compat>, DefaultIgnore;
3222 def err_typename_refers_to_using_value_decl : Error<
3223   "typename specifier refers to a dependent using declaration for a value "
3224   "%0 in %1">;
3225 def note_using_value_decl_missing_typename : Note<
3226   "add 'typename' to treat this using declaration as a type">;
3227
3228 def err_template_kw_refers_to_non_template : Error<
3229     "%0 following the 'template' keyword does not refer to a template">;
3230 def err_template_kw_refers_to_class_template : Error<
3231     "'%0%1' instantiated to a class template, not a function template">;
3232 def note_referenced_class_template : Error<
3233     "class template declared here">;
3234 def err_template_kw_missing : Error<
3235   "missing 'template' keyword prior to dependent template name '%0%1'">;
3236 def ext_template_outside_of_template : ExtWarn<
3237   "'template' keyword outside of a template">, InGroup<CXX11>;
3238 def warn_cxx98_compat_template_outside_of_template : Warning<
3239   "use of 'template' keyword outside of a template is incompatible with C++98">,
3240   InGroup<CXX98Compat>, DefaultIgnore;
3241
3242 def err_non_type_template_in_nested_name_specifier : Error<
3243   "qualified name refers into a specialization of function template %0">;
3244 def err_template_id_not_a_type : Error<
3245   "template name refers to non-type template %0">;
3246 def note_template_declared_here : Note<
3247   "%select{function template|class template|type alias template|template template parameter}0 "
3248   "%1 declared here">;
3249 def note_parameter_type : Note<
3250   "parameter of type %0 is declared here">;
3251
3252 // C++11 Variadic Templates
3253 def err_template_param_pack_default_arg : Error<
3254   "template parameter pack cannot have a default argument">;
3255 def err_template_param_pack_must_be_last_template_parameter : Error<
3256   "template parameter pack must be the last template parameter">;
3257
3258 def err_template_parameter_pack_non_pack : Error<
3259   "%select{template type|non-type template|template template}0 parameter"
3260   "%select{| pack}1 conflicts with previous %select{template type|"
3261   "non-type template|template template}0 parameter%select{ pack|}1">;
3262 def note_template_parameter_pack_non_pack : Note<
3263   "%select{template type|non-type template|template template}0 parameter"
3264   "%select{| pack}1 does not match %select{template type|non-type template"
3265   "|template template}0 parameter%select{ pack|}1 in template argument">;
3266 def note_template_parameter_pack_here : Note<
3267   "previous %select{template type|non-type template|template template}0 "
3268   "parameter%select{| pack}1 declared here">;
3269   
3270 def err_unexpanded_parameter_pack_0 : Error<
3271   "%select{expression|base type|declaration type|data member type|bit-field "
3272   "size|static assertion|fixed underlying type|enumerator value|"
3273   "using declaration|friend declaration|qualifier|initializer|default argument|"
3274   "non-type template parameter type|exception type|partial specialization|"
3275   "__if_exists name|__if_not_exists name|lambda|block}0 "
3276   "contains an unexpanded parameter pack">;
3277 def err_unexpanded_parameter_pack_1 : Error<
3278   "%select{expression|base type|declaration type|data member type|bit-field "
3279   "size|static assertion|fixed underlying type|enumerator value|"
3280   "using declaration|friend declaration|qualifier|initializer|default argument|"
3281   "non-type template parameter type|exception type|partial specialization|"
3282   "__if_exists name|__if_not_exists name|lambda|block}0 "
3283   "contains unexpanded parameter pack %1">;
3284 def err_unexpanded_parameter_pack_2 : Error<
3285   "%select{expression|base type|declaration type|data member type|bit-field "
3286   "size|static assertion|fixed underlying type|enumerator value|"
3287   "using declaration|friend declaration|qualifier|initializer|default argument|"
3288   "non-type template parameter type|exception type|partial specialization|"
3289   "__if_exists name|__if_not_exists name|lambda|block}0 "
3290   "contains unexpanded parameter packs %1 and %2">;
3291 def err_unexpanded_parameter_pack_3_or_more : Error<
3292   "%select{expression|base type|declaration type|data member type|bit-field "
3293   "size|static assertion|fixed underlying type|enumerator value|"
3294   "using declaration|friend declaration|qualifier|initializer|default argument|"
3295   "non-type template parameter type|exception type|partial specialization|"
3296   "__if_exists name|__if_not_exists name|lambda|block}0 "
3297   "contains unexpanded parameter packs %1, %2, ...">;
3298
3299 def err_pack_expansion_without_parameter_packs : Error<
3300   "pack expansion does not contain any unexpanded parameter packs">;
3301 def err_pack_expansion_length_conflict : Error<
3302   "pack expansion contains parameter packs %0 and %1 that have different "
3303   "lengths (%2 vs. %3)">;
3304 def err_pack_expansion_length_conflict_multilevel : Error<
3305   "pack expansion contains parameter pack %0 that has a different "
3306   "length (%1 vs. %2) from outer parameter packs">;
3307 def err_pack_expansion_member_init : Error<
3308   "pack expansion for initialization of member %0">;
3309
3310 def err_function_parameter_pack_without_parameter_packs : Error<
3311   "type %0 of function parameter pack does not contain any unexpanded "
3312   "parameter packs">;
3313 def err_ellipsis_in_declarator_not_parameter : Error<
3314   "only function and template parameters can be parameter packs">;
3315
3316 def err_sizeof_pack_no_pack_name : Error<
3317   "%0 does not refer to the name of a parameter pack">;
3318
3319 def err_unexpected_typedef : Error<
3320   "unexpected type name %0: expected expression">;
3321 def err_unexpected_namespace : Error<
3322   "unexpected namespace name %0: expected expression">;
3323 def err_undeclared_var_use : Error<"use of undeclared identifier %0">;
3324 def warn_found_via_dependent_bases_lookup : ExtWarn<"use of identifier %0 "
3325    "found via unqualified lookup into dependent bases of class templates is a "
3326    "Microsoft extension">, InGroup<Microsoft>;
3327 def note_dependent_var_use : Note<"must qualify identifier to find this "
3328     "declaration in dependent base class">;
3329 def err_not_found_by_two_phase_lookup : Error<"call to function %0 that is neither "
3330     "visible in the template definition nor found by argument-dependent lookup">;
3331 def note_not_found_by_two_phase_lookup : Note<"%0 should be declared prior to the "
3332     "call site%select{| or in %2| or in an associated namespace of one of its arguments}1">;
3333 def err_undeclared_use : Error<"use of undeclared %0">;
3334 def warn_deprecated : Warning<"%0 is deprecated">,
3335     InGroup<DeprecatedDeclarations>;
3336 def warn_deprecated_message : Warning<"%0 is deprecated: %1">,
3337     InGroup<DeprecatedDeclarations>;
3338 def warn_deprecated_fwdclass_message : Warning<
3339     "%0 maybe deprecated because receiver type is unknown">,
3340     InGroup<DeprecatedDeclarations>;
3341 def warn_deprecated_def : Warning<
3342     "Implementing deprecated %select{method|class|category}0">,
3343     InGroup<DeprecatedImplementations>, DefaultIgnore;
3344 def err_unavailable : Error<"%0 is unavailable">;
3345 def err_unavailable_message : Error<"%0 is unavailable: %1">;
3346 def warn_unavailable_fwdclass_message : Warning<
3347     "%0 maybe unavailable because receiver type is unknown">;
3348 def note_unavailable_here : Note<
3349   "%select{declaration|function}0 has been explicitly marked "
3350   "%select{unavailable|deleted|deprecated}1 here">;
3351 def note_implicitly_deleted : Note<
3352   "explicitly defaulted function was implicitly deleted here">;
3353 def warn_not_enough_argument : Warning<
3354   "not enough variable arguments in %0 declaration to fit a sentinel">,
3355   InGroup<Sentinel>;
3356 def warn_missing_sentinel : Warning <
3357   "missing sentinel in %select{function call|method dispatch|block call}0">,
3358   InGroup<Sentinel>;
3359 def note_sentinel_here : Note<
3360   "%select{function|method|block}0 has been explicitly marked sentinel here">;
3361 def warn_missing_prototype : Warning<
3362   "no previous prototype for function %0">,
3363   InGroup<DiagGroup<"missing-prototypes">>, DefaultIgnore;
3364 def note_declaration_not_a_prototype : Note<
3365   "this declaration is not a prototype; add 'void' to make it a prototype for a zero-parameter function">; 
3366 def warn_missing_variable_declarations : Warning<
3367   "no previous extern declaration for non-static variable %0">,
3368   InGroup<DiagGroup<"missing-variable-declarations">>, DefaultIgnore;
3369 def err_redefinition : Error<"redefinition of %0">;
3370 def err_definition_of_implicitly_declared_member : Error<
3371   "definition of implicitly declared %select{default constructor|copy "
3372   "constructor|move constructor|copy assignment operator|move assignment "
3373   "operator|destructor}1">;
3374 def err_definition_of_explicitly_defaulted_member : Error<
3375   "definition of explicitly defaulted %select{default constructor|copy "
3376   "constructor|move constructor|copy assignment operator|move assignment "
3377   "operator|destructor}0">;
3378 def err_redefinition_extern_inline : Error<
3379   "redefinition of a 'extern inline' function %0 is not supported in "
3380   "%select{C99 mode|C++}1">;
3381 def warn_cxx98_compat_friend_redefinition : Warning<
3382   "friend function %0 would be implicitly redefined in C++98">,
3383   InGroup<CXX98Compat>, DefaultIgnore;
3384
3385 def note_deleted_dtor_no_operator_delete : Note<
3386   "virtual destructor requires an unambiguous, accessible 'operator delete'">;
3387 def note_deleted_special_member_class_subobject : Note<
3388   "%select{default constructor|copy constructor|move constructor|"
3389   "copy assignment operator|move assignment operator|destructor}0 of "
3390   "%1 is implicitly deleted because "
3391   "%select{base class %3|%select{||||variant }4field %3}2 has "
3392   "%select{no|a deleted|multiple|an inaccessible|a non-trivial}4 "
3393   "%select{%select{default constructor|copy constructor|move constructor|copy "
3394   "assignment operator|move assignment operator|destructor}0|destructor}5"
3395   "%select{||s||}4">;
3396 def note_deleted_default_ctor_uninit_field : Note<
3397   "default constructor of %0 is implicitly deleted because field %1 of "
3398   "%select{reference|const-qualified}3 type %2 would not be initialized">;
3399 def note_deleted_default_ctor_all_const : Note<
3400   "default constructor of %0 is implicitly deleted because all "
3401   "%select{data members|data members of an anonymous union member}1"
3402   " are const-qualified">;
3403 def note_deleted_copy_ctor_rvalue_reference : Note<
3404   "copy constructor of %0 is implicitly deleted because field %1 is of "
3405   "rvalue reference type %2">;
3406 def note_deleted_copy_user_declared_move : Note<
3407   "copy %select{constructor|assignment operator}0 is implicitly deleted because"
3408   " %1 has a user-declared move %select{constructor|assignment operator}2">;
3409 def note_deleted_assign_field : Note<
3410   "%select{copy|move}0 assignment operator of %1 is implicitly deleted "
3411   "because field %2 is of %select{reference|const-qualified}4 type %3">;
3412
3413 // These should be errors.
3414 def warn_undefined_internal : Warning<
3415   "%select{function|variable}0 %q1 has internal linkage but is not defined">,
3416   InGroup<DiagGroup<"undefined-internal">>;
3417 def warn_undefined_inline : Warning<"inline function %q0 is not defined">,
3418   InGroup<DiagGroup<"undefined-inline">>;
3419 def note_used_here : Note<"used here">;
3420
3421 def warn_internal_in_extern_inline : ExtWarn<
3422   "static %select{function|variable}0 %1 is used in an inline function with "
3423   "external linkage">, InGroup<StaticInInline>;
3424 def ext_internal_in_extern_inline : Extension<
3425   "static %select{function|variable}0 %1 is used in an inline function with "
3426   "external linkage">, InGroup<StaticInInline>;
3427 def warn_static_local_in_extern_inline : Warning<
3428   "non-constant static local variable in inline function may be different "
3429   "in different files">, InGroup<StaticLocalInInline>;
3430 def note_convert_inline_to_static : Note<
3431   "use 'static' to give inline function %0 internal linkage">;
3432 def note_internal_decl_declared_here : Note<
3433   "%0 declared here">;
3434
3435 def warn_redefinition_of_typedef : ExtWarn<
3436   "redefinition of typedef %0 is a C11 feature">,
3437   InGroup<DiagGroup<"typedef-redefinition"> >;
3438 def err_redefinition_variably_modified_typedef : Error<
3439   "redefinition of %select{typedef|type alias}0 for variably-modified type %1">;
3440
3441 def err_inline_declaration_block_scope : Error<
3442   "inline declaration of %0 not allowed in block scope">;
3443 def err_static_non_static : Error<
3444   "static declaration of %0 follows non-static declaration">;
3445 def err_different_language_linkage : Error<
3446   "declaration of %0 has a different language linkage">;
3447 def warn_weak_import : Warning <
3448   "an already-declared variable is made a weak_import declaration %0">;
3449 def warn_static_non_static : ExtWarn<
3450   "static declaration of %0 follows non-static declaration">;
3451 def err_non_static_static : Error<
3452   "non-static declaration of %0 follows static declaration">;
3453 def err_extern_non_extern : Error<
3454   "extern declaration of %0 follows non-extern declaration">;
3455 def err_non_extern_extern : Error<
3456   "non-extern declaration of %0 follows extern declaration">;
3457 def err_non_thread_thread : Error<
3458   "non-thread-local declaration of %0 follows thread-local declaration">;
3459 def err_thread_non_thread : Error<
3460   "thread-local declaration of %0 follows non-thread-local declaration">;
3461 def err_thread_thread_different_kind : Error<
3462   "thread-local declaration of %0 with %select{static|dynamic}1 initialization "
3463   "follows declaration with %select{dynamic|static}1 initialization">;
3464 def err_redefinition_different_type : Error<
3465   "redefinition of %0 with a different type%diff{: $ vs $|}1,2">;
3466 def err_redefinition_different_kind : Error<
3467   "redefinition of %0 as different kind of symbol">;
3468 def warn_forward_class_redefinition : Warning<
3469   "redefinition of forward class %0 of a typedef name of an object type is ignored">,
3470   InGroup<DiagGroup<"objc-forward-class-redefinition">>;
3471 def err_redefinition_different_typedef : Error<
3472   "%select{typedef|type alias|type alias template}0 "
3473   "redefinition with different types%diff{ ($ vs $)|}1,2">;
3474 def err_tag_reference_non_tag : Error<
3475   "elaborated type refers to %select{a non-tag type|a typedef|a type alias|a template|a type alias template}0">;
3476 def err_tag_reference_conflict : Error<
3477   "implicit declaration introduced by elaborated type conflicts with "
3478   "%select{a declaration|a typedef|a type alias|a template}0 of the same name">;
3479 def err_dependent_tag_decl : Error<
3480   "%select{declaration|definition}0 of "
3481   "%select{struct|interface|union|class|enum}1 in a dependent scope">;
3482 def err_tag_definition_of_typedef : Error<
3483   "definition of type %0 conflicts with %select{typedef|type alias}1 of the same name">;
3484 def err_conflicting_types : Error<"conflicting types for %0">;
3485 def err_nested_redefinition : Error<"nested redefinition of %0">;
3486 def err_use_with_wrong_tag : Error<
3487   "use of %0 with tag type that does not match previous declaration">;
3488 def warn_struct_class_tag_mismatch : Warning<
3489     "%select{struct|interface|class}0%select{| template}1 %2 was previously "
3490     "declared as a %select{struct|interface|class}3%select{| template}1">,
3491     InGroup<MismatchedTags>, DefaultIgnore;
3492 def warn_struct_class_previous_tag_mismatch : Warning<
3493     "%2 defined as %select{a struct|an interface|a class}0%select{| template}1 "
3494     "here but previously declared as "
3495     "%select{a struct|an interface|a class}3%select{| template}1">,
3496      InGroup<MismatchedTags>, DefaultIgnore;
3497 def note_struct_class_suggestion : Note<
3498     "did you mean %select{struct|interface|class}0 here?">;
3499 def ext_forward_ref_enum : Extension<
3500   "ISO C forbids forward references to 'enum' types">;
3501 def err_forward_ref_enum : Error<
3502   "ISO C++ forbids forward references to 'enum' types">;
3503 def ext_ms_forward_ref_enum : Extension<
3504   "forward references to 'enum' types are a Microsoft extension">, InGroup<Microsoft>;
3505 def ext_forward_ref_enum_def : Extension<
3506   "redeclaration of already-defined enum %0 is a GNU extension">, InGroup<GNU>;
3507   
3508 def err_redefinition_of_enumerator : Error<"redefinition of enumerator %0">;
3509 def err_duplicate_member : Error<"duplicate member %0">;
3510 def err_misplaced_ivar : Error<
3511   "instance variables may not be placed in %select{categories|class extension}0">;
3512 def warn_ivars_in_interface : Warning<
3513   "declaration of instance variables in the interface is deprecated">,
3514   InGroup<DiagGroup<"objc-interface-ivars">>, DefaultIgnore;
3515 def ext_enum_value_not_int : Extension<
3516   "ISO C restricts enumerator values to range of 'int' (%0 is too "
3517   "%select{small|large}1)">;
3518 def warn_enum_too_large : Warning<
3519   "enumeration values exceed range of largest integer">;
3520 def warn_enumerator_too_large : Warning<
3521   "enumerator value %0 is not representable in the largest integer type">;
3522   
3523 def warn_illegal_constant_array_size : Extension<
3524   "size of static array must be an integer constant expression">;
3525 def err_vm_decl_in_file_scope : Error<
3526   "variably modified type declaration not allowed at file scope">;
3527 def err_vm_decl_has_extern_linkage : Error<
3528   "variably modified type declaration can not have 'extern' linkage">;
3529 def err_typecheck_field_variable_size : Error<
3530   "fields must have a constant size: 'variable length array in structure' "
3531   "extension will never be supported">;
3532 def err_vm_func_decl : Error<
3533   "function declaration cannot have variably modified type">;
3534 def err_array_too_large : Error<
3535   "array is too large (%0 elements)">;
3536 def warn_array_new_too_large : Warning<"array is too large (%0 elements)">,
3537   // FIXME PR11644: ", will throw std::bad_array_new_length at runtime"
3538   InGroup<BadArrayNewLength>;
3539
3540 // -Wpadded, -Wpacked
3541 def warn_padded_struct_field : Warning<
3542   "padding %select{struct|interface|class}0 %1 with %2 "
3543   "%select{byte|bit}3%select{|s}4 to align %5">,
3544   InGroup<Padded>, DefaultIgnore;
3545 def warn_padded_struct_anon_field : Warning<
3546   "padding %select{struct|interface|class}0 %1 with %2 "
3547   "%select{byte|bit}3%select{|s}4 to align anonymous bit-field">,
3548   InGroup<Padded>, DefaultIgnore;
3549 def warn_padded_struct_size : Warning<
3550   "padding size of %0 with %1 %select{byte|bit}2%select{|s}3 "
3551   "to alignment boundary">, InGroup<Padded>, DefaultIgnore;
3552 def warn_unnecessary_packed : Warning<
3553   "packed attribute is unnecessary for %0">, InGroup<Packed>, DefaultIgnore;
3554
3555 def err_typecheck_negative_array_size : Error<"array size is negative">;
3556 def warn_typecheck_negative_array_new_size : Warning<"array size is negative">,
3557   // FIXME PR11644: ", will throw std::bad_array_new_length at runtime"
3558   InGroup<BadArrayNewLength>;
3559 def warn_typecheck_function_qualifiers : Warning<
3560   "qualifier on function type %0 has unspecified behavior">;
3561 def err_typecheck_invalid_restrict_not_pointer : Error<
3562   "restrict requires a pointer or reference (%0 is invalid)">;
3563 def err_typecheck_invalid_restrict_not_pointer_noarg : Error<
3564   "restrict requires a pointer or reference">;
3565 def err_typecheck_invalid_restrict_invalid_pointee : Error<
3566   "pointer to function type %0 may not be 'restrict' qualified">;
3567 def ext_typecheck_zero_array_size : Extension<
3568   "zero size arrays are an extension">, InGroup<ZeroLengthArray>;
3569 def err_typecheck_zero_array_size : Error<
3570   "zero-length arrays are not permitted in C++">;
3571 def warn_typecheck_zero_static_array_size : Warning<
3572   "'static' has no effect on zero-length arrays">,
3573   InGroup<ArrayBounds>;
3574 def err_array_size_non_int : Error<"size of array has non-integer type %0">;
3575 def err_init_element_not_constant : Error<
3576   "initializer element is not a compile-time constant">;
3577 def err_local_cant_init : Error<
3578   "'__local' variable cannot have an initializer">;
3579 def err_block_extern_cant_init : Error<
3580   "'extern' variable cannot have an initializer">;
3581 def warn_extern_init : Warning<"'extern' variable has an initializer">,
3582   InGroup<DiagGroup<"extern-initializer">>;
3583 def err_variable_object_no_init : Error<
3584   "variable-sized object may not be initialized">;
3585 def err_excess_initializers : Error<
3586   "excess elements in %select{array|vector|scalar|union|struct}0 initializer">;
3587 def warn_excess_initializers : ExtWarn<
3588   "excess elements in %select{array|vector|scalar|union|struct}0 initializer">;
3589 def err_excess_initializers_in_char_array_initializer : Error<
3590   "excess elements in char array initializer">;
3591 def warn_excess_initializers_in_char_array_initializer : ExtWarn<
3592   "excess elements in char array initializer">;
3593 def err_initializer_string_for_char_array_too_long : Error<
3594   "initializer-string for char array is too long">;
3595 def warn_initializer_string_for_char_array_too_long : ExtWarn<
3596   "initializer-string for char array is too long">;
3597 def warn_missing_field_initializers : Warning<
3598   "missing field '%0' initializer">,
3599   InGroup<MissingFieldInitializers>, DefaultIgnore;
3600 def warn_braces_around_scalar_init : Warning<
3601   "braces around scalar initializer">;
3602 def warn_many_braces_around_scalar_init : ExtWarn<
3603   "too many braces around scalar initializer">;
3604 def ext_complex_component_init : Extension<
3605   "complex initialization specifying real and imaginary components "
3606   "is an extension">, InGroup<DiagGroup<"complex-component-init">>;
3607 def err_empty_scalar_initializer : Error<"scalar initializer cannot be empty">;
3608 def warn_cxx98_compat_empty_scalar_initializer : Warning<
3609   "scalar initialized from empty initializer list is incompatible with C++98">,
3610   InGroup<CXX98Compat>, DefaultIgnore;
3611 def warn_cxx98_compat_reference_list_init : Warning<
3612   "reference initialized from initializer list is incompatible with C++98">,
3613   InGroup<CXX98Compat>, DefaultIgnore;
3614 def warn_cxx98_compat_initializer_list_init : Warning<
3615   "initialization of initializer_list object is incompatible with C++98">,
3616   InGroup<CXX98Compat>, DefaultIgnore;
3617 def warn_cxx98_compat_ctor_list_init : Warning<
3618   "constructor call from initializer list is incompatible with C++98">,
3619   InGroup<CXX98Compat>, DefaultIgnore;
3620 def err_illegal_initializer : Error<
3621   "illegal initializer (only variables can be initialized)">;
3622 def err_illegal_initializer_type : Error<"illegal initializer type %0">;
3623 def err_init_list_type_narrowing_sfinae : Error<
3624   "type %0 cannot be narrowed to %1 in initializer list">;
3625 def err_init_list_type_narrowing : ExtWarn<
3626   "type %0 cannot be narrowed to %1 in initializer list">, 
3627   InGroup<CXX11Narrowing>, DefaultError;
3628 def err_init_list_variable_narrowing_sfinae : Error<
3629   "non-constant-expression cannot be narrowed from type %0 to %1 in "
3630   "initializer list">;
3631 def err_init_list_variable_narrowing : ExtWarn<
3632   "non-constant-expression cannot be narrowed from type %0 to %1 in "
3633   "initializer list">, InGroup<CXX11Narrowing>, DefaultError;
3634 def err_init_list_constant_narrowing_sfinae : Error<
3635   "constant expression evaluates to %0 which cannot be narrowed to type %1">;
3636 def err_init_list_constant_narrowing : ExtWarn<
3637   "constant expression evaluates to %0 which cannot be narrowed to type %1">,
3638   InGroup<CXX11Narrowing>, DefaultError;
3639 def warn_init_list_type_narrowing : Warning<
3640   "type %0 cannot be narrowed to %1 in initializer list in C++11">,
3641   InGroup<CXX11Narrowing>, DefaultIgnore;
3642 def warn_init_list_variable_narrowing : Warning<
3643   "non-constant-expression cannot be narrowed from type %0 to %1 in "
3644   "initializer list in C++11">,
3645   InGroup<CXX11Narrowing>, DefaultIgnore;
3646 def warn_init_list_constant_narrowing : Warning<
3647   "constant expression evaluates to %0 which cannot be narrowed to type %1 in "
3648   "C++11">,
3649   InGroup<CXX11Narrowing>, DefaultIgnore;
3650 def note_init_list_narrowing_override : Note<
3651   "override this message by inserting an explicit cast">;
3652 def err_init_objc_class : Error<
3653   "cannot initialize Objective-C class type %0">;
3654 def err_implicit_empty_initializer : Error<
3655   "initializer for aggregate with no elements requires explicit braces">;
3656 def err_bitfield_has_negative_width : Error<
3657   "bit-field %0 has negative width (%1)">;
3658 def err_anon_bitfield_has_negative_width : Error<
3659   "anonymous bit-field has negative width (%0)">;
3660 def err_bitfield_has_zero_width : Error<"named bit-field %0 has zero width">;
3661 def err_bitfield_width_exceeds_type_size : Error<
3662   "size of bit-field %0 (%1 bits) exceeds size of its type (%2 bits)">;
3663 def err_anon_bitfield_width_exceeds_type_size : Error<
3664   "size of anonymous bit-field (%0 bits) exceeds size of its type (%1 bits)">;
3665 def err_incorrect_number_of_vector_initializers : Error<
3666   "number of elements must be either one or match the size of the vector">;
3667
3668 // Used by C++ which allows bit-fields that are wider than the type.
3669 def warn_bitfield_width_exceeds_type_size: Warning<
3670   "size of bit-field %0 (%1 bits) exceeds the size of its type; value will be "
3671   "truncated to %2 bits">;
3672 def warn_anon_bitfield_width_exceeds_type_size : Warning<
3673   "size of anonymous bit-field (%0 bits) exceeds size of its type; value will "
3674   "be truncated to %1 bits">;
3675
3676 def warn_missing_braces : Warning<
3677   "suggest braces around initialization of subobject">,
3678   InGroup<MissingBraces>, DefaultIgnore;
3679 def err_missing_braces : Error<
3680   "cannot omit braces around initialization of subobject when using direct "
3681   "list-initialization">;
3682
3683 def err_redefinition_of_label : Error<"redefinition of label %0">;
3684 def err_undeclared_label_use : Error<"use of undeclared label %0">;
3685 def warn_unused_label : Warning<"unused label %0">,
3686   InGroup<UnusedLabel>, DefaultIgnore;
3687
3688 def err_goto_into_protected_scope : Error<"goto into protected scope">;
3689 def warn_goto_into_protected_scope : ExtWarn<"goto into protected scope">,
3690   InGroup<Microsoft>;
3691 def warn_cxx98_compat_goto_into_protected_scope : Warning<
3692   "goto would jump into protected scope in C++98">,
3693   InGroup<CXX98Compat>, DefaultIgnore;
3694 def err_switch_into_protected_scope : Error<
3695   "switch case is in protected scope">;
3696 def warn_cxx98_compat_switch_into_protected_scope : Warning<
3697   "switch case would be in a protected scope in C++98">,
3698   InGroup<CXX98Compat>, DefaultIgnore;
3699 def err_indirect_goto_without_addrlabel : Error<
3700   "indirect goto in function with no address-of-label expressions">;
3701 def err_indirect_goto_in_protected_scope : Error<
3702   "indirect goto might cross protected scopes">;
3703 def warn_cxx98_compat_indirect_goto_in_protected_scope : Warning<
3704   "indirect goto might cross protected scopes in C++98">,
3705   InGroup<CXX98Compat>, DefaultIgnore;
3706 def note_indirect_goto_target : Note<"possible target of indirect goto">;
3707 def note_protected_by_variable_init : Note<
3708   "jump bypasses variable initialization">;
3709 def note_protected_by_variable_nontriv_destructor : Note<
3710   "jump bypasses variable with a non-trivial destructor">;
3711 def note_protected_by_variable_non_pod : Note<
3712   "jump bypasses initialization of non-POD variable">;
3713 def note_protected_by_cleanup : Note<
3714   "jump bypasses initialization of variable with __attribute__((cleanup))">;
3715 def note_protected_by_vla_typedef : Note<
3716   "jump bypasses initialization of VLA typedef">;
3717 def note_protected_by_vla_type_alias : Note<
3718   "jump bypasses initialization of VLA type alias">;
3719 def note_protected_by_vla : Note<
3720   "jump bypasses initialization of variable length array">;
3721 def note_protected_by_objc_try : Note<
3722   "jump bypasses initialization of @try block">;
3723 def note_protected_by_objc_catch : Note<
3724   "jump bypasses initialization of @catch block">;
3725 def note_protected_by_objc_finally : Note<
3726   "jump bypasses initialization of @finally block">;
3727 def note_protected_by_objc_synchronized : Note<
3728   "jump bypasses initialization of @synchronized block">;
3729 def note_protected_by_objc_autoreleasepool : Note<
3730   "jump bypasses auto release push of @autoreleasepool block">;
3731 def note_protected_by_cxx_try : Note<
3732   "jump bypasses initialization of try block">;
3733 def note_protected_by_cxx_catch : Note<
3734   "jump bypasses initialization of catch block">;
3735 def note_protected_by___block : Note<
3736   "jump bypasses setup of __block variable">;
3737 def note_protected_by_objc_ownership : Note<
3738   "jump bypasses initialization of retaining variable">;
3739 def note_enters_block_captures_cxx_obj : Note<
3740   "jump enters lifetime of block which captures a destructible C++ object">;
3741 def note_enters_block_captures_strong : Note<
3742   "jump enters lifetime of block which strongly captures a variable">;
3743 def note_enters_block_captures_weak : Note<
3744   "jump enters lifetime of block which weakly captures a variable">;
3745
3746 def note_exits_cleanup : Note<
3747   "jump exits scope of variable with __attribute__((cleanup))">;
3748 def note_exits_dtor : Note<
3749   "jump exits scope of variable with non-trivial destructor">;
3750 def note_exits___block : Note<
3751   "jump exits scope of __block variable">;
3752 def note_exits_objc_try : Note<
3753   "jump exits @try block">;
3754 def note_exits_objc_catch : Note<
3755   "jump exits @catch block">;
3756 def note_exits_objc_finally : Note<
3757   "jump exits @finally block">;
3758 def note_exits_objc_synchronized : Note<
3759   "jump exits @synchronized block">;
3760 def note_exits_cxx_try : Note<
3761   "jump exits try block">;
3762 def note_exits_cxx_catch : Note<
3763   "jump exits catch block">;
3764 def note_exits_objc_autoreleasepool : Note<
3765   "jump exits autoreleasepool block">;
3766 def note_exits_objc_ownership : Note<
3767   "jump exits scope of retaining variable">;
3768 def note_exits_block_captures_cxx_obj : Note<
3769   "jump exits lifetime of block which captures a destructible C++ object">;
3770 def note_exits_block_captures_strong : Note<
3771   "jump exits lifetime of block which strongly captures a variable">;
3772 def note_exits_block_captures_weak : Note<
3773   "jump exits lifetime of block which weakly captures a variable">;
3774
3775 def err_func_returning_array_function : Error<
3776   "function cannot return %select{array|function}0 type %1">;
3777 def err_field_declared_as_function : Error<"field %0 declared as a function">;
3778 def err_field_incomplete : Error<"field has incomplete type %0">;
3779 def ext_variable_sized_type_in_struct : ExtWarn<
3780   "field %0 with variable sized type %1 not at the end of a struct or class is"
3781   " a GNU extension">, InGroup<GNU>;
3782
3783 def err_flexible_array_empty_struct : Error<
3784   "flexible array %0 not allowed in otherwise empty struct">;
3785 def err_flexible_array_has_nonpod_type : Error<
3786   "flexible array member %0 of non-POD element type %1">;
3787 def ext_flexible_array_in_struct : Extension<
3788   "%0 may not be nested in a struct due to flexible array member">,
3789   InGroup<FlexibleArrayExtensions>;
3790 def ext_flexible_array_in_array : Extension<
3791   "%0 may not be used as an array element due to flexible array member">,
3792   InGroup<FlexibleArrayExtensions>;
3793 def err_flexible_array_init : Error<
3794   "initialization of flexible array member is not allowed">;
3795 def ext_flexible_array_empty_aggregate_ms : Extension<
3796   "flexible array member %0 in otherwise empty "
3797   "%select{struct|interface|union|class|enum}1 is a Microsoft extension">,
3798   InGroup<Microsoft>;
3799 def ext_flexible_array_union_ms : Extension<
3800   "flexible array member %0 in a union is a Microsoft extension">,
3801   InGroup<Microsoft>;
3802 def ext_flexible_array_empty_aggregate_gnu : Extension<
3803   "flexible array member %0 in otherwise empty "
3804   "%select{struct|interface|union|class|enum}1 is a GNU extension">,
3805   InGroup<GNU>;
3806 def ext_flexible_array_union_gnu : Extension<
3807   "flexible array member %0 in a union is a GNU extension">, InGroup<GNU>;
3808
3809 let CategoryName = "ARC Semantic Issue" in {
3810
3811 // ARC-mode diagnostics.
3812
3813 let CategoryName = "ARC Weak References" in {
3814
3815 def err_arc_weak_no_runtime : Error<
3816   "the current deployment target does not support automated __weak references">;
3817 def err_arc_unsupported_weak_class : Error<
3818   "class is incompatible with __weak references">;
3819 def err_arc_weak_unavailable_assign : Error<
3820   "assignment of a weak-unavailable object to a __weak object">;
3821 def err_arc_weak_unavailable_property : Error<
3822   "synthesizing __weak instance variable of type %0, which does not "
3823   "support weak references">;
3824 def note_implemented_by_class : Note<
3825   "when implemented by class %0">;
3826 def err_arc_convesion_of_weak_unavailable : Error<
3827   "%select{implicit conversion|cast}0 of weak-unavailable object of type %1 to"
3828   " a __weak object of type %2">;
3829
3830 } // end "ARC Weak References" category
3831
3832 let CategoryName = "ARC Restrictions" in {
3833
3834 def err_arc_illegal_explicit_message : Error<
3835   "ARC forbids explicit message send of %0">;
3836 def err_arc_unused_init_message : Error<
3837   "the result of a delegate init call must be immediately returned "
3838   "or assigned to 'self'">;
3839 def err_arc_mismatched_cast : Error<
3840   "%select{implicit conversion|cast}0 of "
3841   "%select{%2|a non-Objective-C pointer type %2|a block pointer|"
3842   "an Objective-C pointer|an indirect pointer to an Objective-C pointer}1"
3843   " to %3 is disallowed with ARC">;
3844 def err_arc_nolifetime_behavior : Error<
3845   "explicit ownership qualifier on cast result has no effect">;
3846 def err_arc_objc_object_in_tag : Error<
3847   "ARC forbids %select{Objective-C objects|blocks}0 in "
3848   "%select{struct|interface|union|<<ERROR>>|enum}1">;
3849 def err_arc_objc_property_default_assign_on_object : Error<
3850   "ARC forbids synthesizing a property of an Objective-C object "
3851   "with unspecified ownership or storage attribute">;
3852 def err_arc_illegal_selector : Error<
3853   "ARC forbids use of %0 in a @selector">;
3854 def err_arc_illegal_method_def : Error<
3855   "ARC forbids implementation of %0">;
3856 def warn_arc_strong_pointer_objc_pointer : Warning<
3857   "method parameter of type %0 with no explicit ownership">,
3858   InGroup<DiagGroup<"explicit-ownership-type">>, DefaultIgnore;
3859   
3860 } // end "ARC Restrictions" category
3861   
3862 def err_arc_lost_method_convention : Error<
3863   "method was declared as %select{an 'alloc'|a 'copy'|an 'init'|a 'new'}0 "
3864   "method, but its implementation doesn't match because %select{"
3865   "its result type is not an object pointer|"
3866   "its result type is unrelated to its receiver type}1">;
3867 def note_arc_lost_method_convention : Note<"declaration in interface">;
3868 def err_arc_gained_method_convention : Error<
3869   "method implementation does not match its declaration">;
3870 def note_arc_gained_method_convention : Note<
3871   "declaration in interface is not in the '%select{alloc|copy|init|new}0' "
3872   "family because %select{its result type is not an object pointer|"
3873   "its result type is unrelated to its receiver type}1">;
3874 def err_typecheck_arc_assign_self : Error<
3875   "cannot assign to 'self' outside of a method in the init family">;
3876 def err_typecheck_arc_assign_self_class_method : Error<
3877   "cannot assign to 'self' in a class method">;
3878 def err_typecheck_arr_assign_enumeration : Error<
3879   "fast enumeration variables can't be modified in ARC by default; "
3880   "declare the variable __strong to allow this">;
3881 def warn_arc_retained_assign : Warning<
3882   "assigning retained object to %select{weak|unsafe_unretained}0 "
3883   "%select{property|variable}1"
3884   "; object will be released after assignment">,
3885   InGroup<ARCUnsafeRetainedAssign>;
3886 def warn_arc_retained_property_assign : Warning<
3887   "assigning retained object to unsafe property"
3888   "; object will be released after assignment">,
3889   InGroup<ARCUnsafeRetainedAssign>;
3890 def warn_arc_literal_assign : Warning<
3891   "assigning %select{array literal|dictionary literal|numeric literal|boxed expression|<should not happen>|block literal}0"
3892   " to a weak %select{property|variable}1"
3893   "; object will be released after assignment">,
3894   InGroup<ARCUnsafeRetainedAssign>;
3895 def err_arc_new_array_without_ownership : Error<
3896   "'new' cannot allocate an array of %0 with no explicit ownership">;
3897 def err_arc_autoreleasing_var : Error<
3898   "%select{__block variables|global variables|fields|instance variables}0 cannot have "
3899   "__autoreleasing ownership">;
3900 def err_arc_autoreleasing_capture : Error<
3901   "cannot capture __autoreleasing variable in a "
3902   "%select{block|lambda by copy}0">;
3903 def err_arc_thread_ownership : Error<
3904   "thread-local variable has non-trivial ownership: type is %0">;
3905 def err_arc_indirect_no_ownership : Error<
3906   "%select{pointer|reference}1 to non-const type %0 with no explicit ownership">;
3907 def err_arc_array_param_no_ownership : Error<
3908   "must explicitly describe intended ownership of an object array parameter">;
3909 def err_arc_pseudo_dtor_inconstant_quals : Error<
3910   "pseudo-destructor destroys object of type %0 with inconsistently-qualified "
3911   "type %1">;
3912 def err_arc_init_method_unrelated_result_type : Error<
3913   "init methods must return a type related to the receiver type">;
3914 def err_arc_nonlocal_writeback : Error<
3915   "passing address of %select{non-local|non-scalar}0 object to "
3916   "__autoreleasing parameter for write-back">;
3917 def err_arc_method_not_found : Error<
3918   "no known %select{instance|class}1 method for selector %0">;
3919 def err_arc_receiver_forward_class : Error<
3920   "receiver %0 for class message is a forward declaration">;
3921 def err_arc_may_not_respond : Error<
3922   "no visible @interface for %0 declares the selector %1">;
3923 def err_arc_receiver_forward_instance : Error<
3924   "receiver type %0 for instance message is a forward declaration">;
3925 def warn_receiver_forward_instance : Warning<
3926   "receiver type %0 for instance message is a forward declaration">,
3927   InGroup<ForwardClassReceiver>, DefaultIgnore;
3928 def err_arc_collection_forward : Error<
3929   "collection expression type %0 is a forward declaration">;
3930 def err_arc_multiple_method_decl : Error< 
3931   "multiple methods named %0 found with mismatched result, "
3932   "parameter type or attributes">;
3933 def warn_arc_lifetime_result_type : Warning<
3934   "ARC %select{unused|__unsafe_unretained|__strong|__weak|__autoreleasing}0 "
3935   "lifetime qualifier on return type is ignored">,
3936   InGroup<IgnoredQualifiers>;
3937
3938 let CategoryName = "ARC Retain Cycle" in {
3939
3940 def warn_arc_retain_cycle : Warning<
3941   "capturing %0 strongly in this block is likely to lead to a retain cycle">,
3942   InGroup<ARCRetainCycles>;
3943 def note_arc_retain_cycle_owner : Note<
3944   "block will be retained by %select{the captured object|an object strongly "
3945   "retained by the captured object}0">;
3946
3947 } // end "ARC Retain Cycle" category
3948
3949 def warn_arc_object_memaccess : Warning<
3950   "%select{destination for|source of}0 this %1 call is a pointer to "
3951   "ownership-qualified type %2">, InGroup<ARCNonPodMemAccess>;
3952
3953 let CategoryName = "ARC and @properties" in {
3954
3955 def err_arc_strong_property_ownership : Error<
3956   "existing instance variable %1 for strong property %0 may not be "
3957   "%select{|__unsafe_unretained||__weak}2">;
3958 def err_arc_assign_property_ownership : Error<
3959   "existing instance variable %1 for property %0 with %select{unsafe_unretained| assign}2 "
3960   "attribute must be __unsafe_unretained">;
3961 def err_arc_inconsistent_property_ownership : Error<
3962   "%select{|unsafe_unretained|strong|weak}1 property %0 may not also be "
3963   "declared %select{|__unsafe_unretained|__strong|__weak|__autoreleasing}2">;
3964
3965 } // end "ARC and @properties" category
3966
3967 def err_arc_atomic_ownership : Error<
3968   "cannot perform atomic operation on a pointer to type %0: type has "
3969   "non-trivial ownership">;
3970
3971 let CategoryName = "ARC Casting Rules" in {
3972
3973 def err_arc_bridge_cast_incompatible : Error<
3974   "incompatible types casting %0 to %1 with a %select{__bridge|"
3975   "__bridge_transfer|__bridge_retained}2 cast">;
3976 def err_arc_bridge_cast_wrong_kind : Error<
3977   "cast of %select{Objective-C|block|C}0 pointer type %1 to "
3978   "%select{Objective-C|block|C}2 pointer type %3 cannot use %select{__bridge|"
3979   "__bridge_transfer|__bridge_retained}4">;
3980 def err_arc_cast_requires_bridge : Error<
3981   "%select{cast|implicit conversion}0 of %select{Objective-C|block|C}1 "
3982   "pointer type %2 to %select{Objective-C|block|C}3 pointer type %4 "
3983   "requires a bridged cast">;
3984 def note_arc_bridge : Note<
3985   "use __bridge to convert directly (no change in ownership)">;
3986 def note_arc_cstyle_bridge : Note<
3987   "use __bridge with C-style cast to convert directly (no change in ownership)">;
3988 def note_arc_bridge_transfer : Note<
3989   "use %select{__bridge_transfer|CFBridgingRelease call}1 to transfer "
3990   "ownership of a +1 %0 into ARC">;
3991 def note_arc_cstyle_bridge_transfer : Note<
3992   "use __bridge_transfer with C-style cast to transfer "
3993   "ownership of a +1 %0 into ARC">;
3994 def note_arc_bridge_retained : Note<
3995   "use %select{__bridge_retained|CFBridgingRetain call}1 to make an "
3996   "ARC object available as a +1 %0">;
3997 def note_arc_cstyle_bridge_retained : Note<
3998   "use __bridge_retained with C-style cast to make an "
3999   "ARC object available as a +1 %0">;
4000
4001 } // ARC Casting category
4002
4003 } // ARC category name
4004
4005 def err_flexible_array_init_needs_braces : Error<
4006   "flexible array requires brace-enclosed initializer">;
4007 def err_illegal_decl_array_of_functions : Error<
4008   "'%0' declared as array of functions of type %1">;
4009 def err_illegal_decl_array_incomplete_type : Error<
4010   "array has incomplete element type %0">;
4011 def err_illegal_message_expr_incomplete_type : Error<
4012   "Objective-C message has incomplete result type %0">;
4013 def err_illegal_decl_array_of_references : Error<
4014   "'%0' declared as array of references of type %1">;
4015 def err_decl_negative_array_size : Error<
4016   "'%0' declared as an array with a negative size">;
4017 def err_array_static_outside_prototype : Error<
4018   "%0 used in array declarator outside of function prototype">;
4019 def err_array_static_not_outermost : Error<
4020   "%0 used in non-outermost array type derivation">;
4021 def err_array_star_outside_prototype : Error<
4022   "star modifier used outside of function prototype">;
4023 def err_illegal_decl_pointer_to_reference : Error<
4024   "'%0' declared as a pointer to a reference of type %1">;
4025 def err_illegal_decl_mempointer_to_reference : Error<
4026   "'%0' declared as a member pointer to a reference of type %1">;
4027 def err_illegal_decl_mempointer_to_void : Error<
4028   "'%0' declared as a member pointer to void">;
4029 def err_illegal_decl_mempointer_in_nonclass : Error<
4030   "'%0' does not point into a class">;
4031 def err_mempointer_in_nonclass_type : Error<
4032   "member pointer refers into non-class type %0">;
4033 def err_reference_to_void : Error<"cannot form a reference to 'void'">;
4034 def err_nonfunction_block_type : Error<
4035   "block pointer to non-function type is invalid">;
4036 def err_return_block_has_expr : Error<"void block should not return a value">;
4037 def err_block_return_missing_expr : Error<
4038   "non-void block should return a value">;
4039 def err_func_def_incomplete_result : Error<
4040   "incomplete result type %0 in function definition">;
4041 def err_atomic_specifier_bad_type : Error<
4042   "_Atomic cannot be applied to "
4043   "%select{incomplete |array |function |reference |atomic |qualified |}0type "
4044   "%1 %select{||||||which is not trivially copyable}0">;
4045
4046 // Expressions.
4047 def ext_sizeof_alignof_function_type : Extension<
4048   "invalid application of '%select{sizeof|alignof|vec_step}0' to a "
4049   "function type">, InGroup<PointerArith>;
4050 def ext_sizeof_alignof_void_type : Extension<
4051   "invalid application of '%select{sizeof|alignof|vec_step}0' to a void "
4052   "type">, InGroup<PointerArith>;
4053 def err_sizeof_alignof_incomplete_type : Error<
4054   "invalid application of '%select{sizeof|alignof|vec_step}0' to an "
4055   "incomplete type %1">;
4056 def err_sizeof_alignof_bitfield : Error<
4057   "invalid application of '%select{sizeof|alignof}0' to bit-field">;
4058 def err_alignof_member_of_incomplete_type : Error<
4059   "invalid application of 'alignof' to a field of a class still being defined">;
4060 def err_vecstep_non_scalar_vector_type : Error<
4061   "'vec_step' requires built-in scalar or vector type, %0 invalid">;
4062 def err_offsetof_incomplete_type : Error<
4063   "offsetof of incomplete type %0">;
4064 def err_offsetof_record_type : Error<
4065   "offsetof requires struct, union, or class type, %0 invalid">;
4066 def err_offsetof_array_type : Error<"offsetof requires array type, %0 invalid">;
4067 def ext_offsetof_extended_field_designator : Extension<
4068   "using extended field designator is an extension">,
4069   InGroup<DiagGroup<"extended-offsetof">>;
4070 def warn_offsetof_non_pod_type : ExtWarn<"offset of on non-POD type %0">,
4071   InGroup<InvalidOffsetof>;
4072 def warn_offsetof_non_standardlayout_type : ExtWarn<
4073   "offset of on non-standard-layout type %0">, InGroup<InvalidOffsetof>;
4074 def err_offsetof_bitfield : Error<"cannot compute offset of bit-field %0">;
4075
4076 def warn_floatingpoint_eq : Warning<
4077   "comparing floating point with == or != is unsafe">,
4078   InGroup<DiagGroup<"float-equal">>, DefaultIgnore;
4079
4080 def warn_division_by_zero : Warning<"division by zero is undefined">,
4081   InGroup<DivZero>;
4082 def warn_remainder_by_zero : Warning<"remainder by zero is undefined">,
4083   InGroup<DivZero>;
4084 def warn_shift_negative : Warning<"shift count is negative">,
4085   InGroup<DiagGroup<"shift-count-negative">>;
4086 def warn_shift_gt_typewidth : Warning<"shift count >= width of type">,
4087   InGroup<DiagGroup<"shift-count-overflow">>;
4088 def warn_shift_result_gt_typewidth : Warning<
4089   "signed shift result (%0) requires %1 bits to represent, but %2 only has "
4090   "%3 bits">, InGroup<DiagGroup<"shift-overflow">>;
4091 def warn_shift_result_sets_sign_bit : Warning<
4092   "signed shift result (%0) sets the sign bit of the shift expression's "
4093   "type (%1) and becomes negative">,
4094   InGroup<DiagGroup<"shift-sign-overflow">>, DefaultIgnore;
4095
4096 def warn_precedence_bitwise_rel : Warning<
4097   "%0 has lower precedence than %1; %1 will be evaluated first">,
4098   InGroup<Parentheses>;
4099 def note_precedence_bitwise_first : Note<
4100   "place parentheses around the %0 expression to evaluate it first">;
4101 def note_precedence_silence : Note<
4102   "place parentheses around the '%0' expression to silence this warning">;
4103
4104 def warn_precedence_conditional : Warning<
4105   "operator '?:' has lower precedence than '%0'; '%0' will be evaluated first">,
4106   InGroup<Parentheses>;
4107 def note_precedence_conditional_first : Note<
4108   "place parentheses around the '?:' expression to evaluate it first">;
4109
4110 def warn_logical_instead_of_bitwise : Warning<
4111   "use of logical '%0' with constant operand">,
4112   InGroup<DiagGroup<"constant-logical-operand">>;
4113 def note_logical_instead_of_bitwise_change_operator : Note<
4114   "use '%0' for a bitwise operation">;
4115 def note_logical_instead_of_bitwise_remove_constant : Note<
4116   "remove constant to silence this warning">;
4117
4118 def warn_bitwise_and_in_bitwise_or : Warning<
4119   "'&' within '|'">, InGroup<BitwiseOpParentheses>;
4120
4121 def warn_logical_and_in_logical_or : Warning<
4122   "'&&' within '||'">, InGroup<LogicalOpParentheses>;
4123
4124 def warn_overloaded_shift_in_comparison :Warning<
4125   "overloaded operator %select{>>|<<}0 has lower precedence than "
4126   "comparison operator">,
4127   InGroup<OverloadedShiftOpParentheses>;
4128 def note_evaluate_comparison_first :Note<
4129   "place parentheses around comparison expression to evaluate it first">;
4130
4131 def warn_addition_in_bitshift : Warning<
4132   "operator '%0' has lower precedence than '%1'; "
4133   "'%1' will be evaluated first">, InGroup<ShiftOpParentheses>;
4134
4135 def warn_self_assignment : Warning<
4136   "explicitly assigning a variable of type %0 to itself">,
4137   InGroup<SelfAssignment>, DefaultIgnore;
4138
4139 def warn_string_plus_int : Warning<
4140   "adding %0 to a string does not append to the string">,
4141   InGroup<StringPlusInt>;
4142 def note_string_plus_int_silence : Note<
4143   "use array indexing to silence this warning">;
4144
4145 def warn_sizeof_array_param : Warning<
4146   "sizeof on array function parameter will return size of %0 instead of %1">,
4147   InGroup<SizeofArrayArgument>;
4148
4149 def warn_sizeof_array_decay : Warning<
4150   "sizeof on pointer operation will return size of %0 instead of %1">,
4151   InGroup<SizeofArrayDecay>;
4152
4153 def err_sizeof_nonfragile_interface : Error<
4154   "application of '%select{alignof|sizeof}1' to interface %0 is "
4155   "not supported on this architecture and platform">;
4156 def err_atdef_nonfragile_interface : Error<
4157   "use of @defs is not supported on this architecture and platform">;
4158 def err_subscript_nonfragile_interface : Error<
4159   "subscript requires size of interface %0, which is not constant for "
4160   "this architecture and platform">;
4161
4162 def err_arithmetic_nonfragile_interface : Error<
4163   "arithmetic on pointer to interface %0, which is not a constant size for "
4164   "this architecture and platform">;
4165
4166
4167 def ext_subscript_non_lvalue : Extension<
4168   "ISO C90 does not allow subscripting non-lvalue array">;
4169 def err_typecheck_subscript_value : Error<
4170   "subscripted value is not an array, pointer, or vector">;
4171 def err_typecheck_subscript_not_integer : Error<
4172   "array subscript is not an integer">;
4173 def err_subscript_function_type : Error<
4174   "subscript of pointer to function type %0">;
4175 def err_subscript_incomplete_type : Error<
4176   "subscript of pointer to incomplete type %0">;
4177 def err_dereference_incomplete_type : Error<
4178   "dereference of pointer to incomplete type %0">;
4179 def ext_gnu_subscript_void_type : Extension<
4180   "subscript of a pointer to void is a GNU extension">, InGroup<PointerArith>;
4181 def err_typecheck_member_reference_struct_union : Error<
4182   "member reference base type %0 is not a structure or union">;
4183 def err_typecheck_member_reference_ivar : Error<
4184   "%0 does not have a member named %1">;
4185 def error_arc_weak_ivar_access : Error<
4186   "dereferencing a __weak pointer is not allowed due to possible "
4187   "null value caused by race condition, assign it to strong variable first">;
4188 def err_typecheck_member_reference_arrow : Error<
4189   "member reference type %0 is not a pointer">;
4190 def err_typecheck_member_reference_suggestion : Error<
4191   "member reference type %0 is %select{a|not a}1 pointer; maybe you meant to use '%select{->|.}1'?">;
4192 def err_typecheck_member_reference_type : Error<
4193   "cannot refer to type member %0 in %1 with '%select{.|->}2'">;
4194 def err_typecheck_member_reference_unknown : Error<
4195   "cannot refer to member %0 in %1 with '%select{.|->}2'">;
4196 def err_member_reference_needs_call : Error<
4197   "base of member reference is a function; perhaps you meant to call "
4198   "it%select{| with no arguments}0?">;
4199 def warn_subscript_is_char : Warning<"array subscript is of type 'char'">,
4200   InGroup<CharSubscript>, DefaultIgnore;
4201
4202 def err_typecheck_incomplete_tag : Error<"incomplete definition of type %0">;
4203 def err_no_member : Error<"no member named %0 in %1">;
4204 def err_no_member_overloaded_arrow : Error<
4205   "no member named %0 in %1; did you mean to use '->' instead of '.'?">;
4206
4207 def err_member_not_yet_instantiated : Error<
4208   "no member %0 in %1; it has not yet been instantiated">;
4209 def note_non_instantiated_member_here : Note<
4210   "not-yet-instantiated member is declared here">;
4211
4212 def err_enumerator_does_not_exist : Error<
4213   "enumerator %0 does not exist in instantiation of %1">;
4214 def note_enum_specialized_here : Note<
4215   "enum %0 was explicitly specialized here">;
4216
4217 def err_member_redeclared : Error<"class member cannot be redeclared">;
4218 def err_member_redeclared_in_instantiation : Error<
4219   "multiple overloads of %0 instantiate to the same signature %1">;
4220 def err_member_name_of_class : Error<"member %0 has the same name as its class">;
4221 def err_member_def_undefined_record : Error<
4222   "out-of-line definition of %0 from class %1 without definition">;
4223 def err_member_def_does_not_match : Error<
4224   "out-of-line definition of %0 does not match any declaration in %1">;
4225 def err_friend_decl_does_not_match : Error<
4226   "friend declaration of %0 does not match any declaration in %1">;
4227 def err_member_def_does_not_match_suggest : Error<
4228   "out-of-line definition of %0 does not match any declaration in %1; "
4229   "did you mean %2?">;
4230 def err_member_def_does_not_match_ret_type : Error<
4231   "out-of-line definition of %q0 differs from the declaration in the return type">;
4232 def err_nonstatic_member_out_of_line : Error<
4233   "non-static data member defined out-of-line">;
4234 def err_qualified_typedef_declarator : Error<
4235   "typedef declarator cannot be qualified">;
4236 def err_qualified_param_declarator : Error<
4237   "parameter declarator cannot be qualified">;
4238 def ext_out_of_line_declaration : ExtWarn<
4239   "out-of-line declaration of a member must be a definition">,
4240   InGroup<OutOfLineDeclaration>, DefaultError;
4241 def warn_member_extra_qualification : Warning<
4242   "extra qualification on member %0">, InGroup<Microsoft>;
4243 def err_member_extra_qualification : Error<
4244   "extra qualification on member %0">;
4245 def err_member_qualification : Error<
4246   "non-friend class member %0 cannot have a qualified name">;  
4247 def note_member_def_close_match : Note<"member declaration nearly matches">;
4248 def note_member_def_close_const_match : Note<
4249   "member declaration does not match because "
4250   "it %select{is|is not}0 const qualified">;
4251 def note_member_def_close_param_match : Note<
4252   "type of %ordinal0 parameter of member declaration does not match definition"
4253   "%diff{ ($ vs $)|}1,2">;
4254 def err_typecheck_ivar_variable_size : Error<
4255   "instance variables must have a constant size">;
4256 def err_ivar_reference_type : Error<
4257   "instance variables cannot be of reference type">;
4258 def err_typecheck_illegal_increment_decrement : Error<
4259   "cannot %select{decrement|increment}1 value of type %0">;
4260 def err_typecheck_arithmetic_incomplete_type : Error<
4261   "arithmetic on a pointer to an incomplete type %0">;
4262 def err_typecheck_pointer_arith_function_type : Error<
4263   "arithmetic on%select{ a|}0 pointer%select{|s}0 to%select{ the|}2 "
4264   "function type%select{|s}2 %1%select{| and %3}2">;
4265 def err_typecheck_pointer_arith_void_type : Error<
4266   "arithmetic on%select{ a|}0 pointer%select{|s}0 to void">;
4267 def err_typecheck_decl_incomplete_type : Error<
4268   "variable has incomplete type %0">;
4269 def ext_typecheck_decl_incomplete_type : ExtWarn<
4270   "tentative definition of variable with internal linkage has incomplete non-array type %0">,
4271   InGroup<DiagGroup<"tentative-definition-incomplete-type">>;
4272 def err_tentative_def_incomplete_type : Error<
4273   "tentative definition has type %0 that is never completed">;
4274 def err_tentative_def_incomplete_type_arr : Error<
4275   "tentative definition has array of type %0 that is never completed">;
4276 def warn_tentative_incomplete_array : Warning<
4277   "tentative array definition assumed to have one element">;
4278 def err_typecheck_incomplete_array_needs_initializer : Error<
4279   "definition of variable with array type needs an explicit size "
4280   "or an initializer">;
4281 def err_array_init_not_init_list : Error<
4282   "array initializer must be an initializer "
4283   "list%select{| or string literal}0">;
4284 def err_array_init_different_type : Error<
4285   "cannot initialize array %diff{of type $ with array of type $|"
4286   "with different type of array}0,1">;
4287 def err_array_init_non_constant_array : Error<
4288   "cannot initialize array %diff{of type $ with non-constant array of type $|"
4289   "with different type of array}0,1">;
4290 def ext_array_init_copy : Extension<
4291   "initialization of an array "
4292   "%diff{of type $ from a compound literal of type $|"
4293   "from a compound literal}0,1 is a GNU extension">, InGroup<GNU>;
4294 // This is intentionally not disabled by -Wno-gnu.
4295 def ext_array_init_parens : ExtWarn<
4296   "parenthesized initialization of a member array is a GNU extension">,
4297   InGroup<DiagGroup<"gnu-array-member-paren-init">>, DefaultError;
4298 def warn_deprecated_string_literal_conversion : Warning<
4299   "conversion from string literal to %0 is deprecated">, InGroup<DeprecatedWritableStr>;
4300 def err_realimag_invalid_type : Error<"invalid type %0 to %1 operator">;
4301 def err_typecheck_sclass_fscope : Error<
4302   "illegal storage class on file-scoped variable">;
4303 def err_unsupported_global_register : Error<
4304   "global register variables are not supported">;
4305 def warn_standalone_specifier : Warning<"'%0' ignored on this declaration">,
4306   InGroup<MissingDeclarations>;
4307 def ext_standalone_specifier : ExtWarn<"'%0' is not permitted on a declaration "
4308   "of a type">, InGroup<MissingDeclarations>;
4309 def err_standalone_class_nested_name_specifier : Error<
4310   "forward declaration of %select{class|struct|interface|union|enum}0 cannot "
4311   "have a nested name specifier">;
4312 def err_typecheck_sclass_func : Error<"illegal storage class on function">;
4313 def err_static_block_func : Error<
4314   "function declared in block scope cannot have 'static' storage class">;
4315 def err_typecheck_address_of : Error<"address of %select{bit-field"
4316   "|vector element|property expression|register variable}0 requested">;
4317 def ext_typecheck_addrof_void : Extension<
4318   "ISO C forbids taking the address of an expression of type 'void'">;
4319 def err_unqualified_pointer_member_function : Error<
4320   "must explicitly qualify name of member function when taking its address">;
4321 def err_invalid_form_pointer_member_function : Error<
4322   "cannot create a non-constant pointer to member function">;
4323 def err_parens_pointer_member_function : Error<
4324   "cannot parenthesize the name of a method when forming a member pointer">;
4325 def err_typecheck_invalid_lvalue_addrof_addrof_function : Error<
4326   "extra '&' taking address of overloaded function">;
4327 def err_typecheck_invalid_lvalue_addrof : Error<
4328   "cannot take the address of an rvalue of type %0">;
4329 def ext_typecheck_addrof_temporary : ExtWarn<
4330   "taking the address of a temporary object of type %0">, 
4331   InGroup<DiagGroup<"address-of-temporary">>, DefaultError;
4332 def err_typecheck_addrof_temporary : Error<
4333   "taking the address of a temporary object of type %0">;
4334 def err_typecheck_unary_expr : Error<
4335   "invalid argument type %0 to unary expression">;
4336 def err_typecheck_indirection_requires_pointer : Error<
4337   "indirection requires pointer operand (%0 invalid)">;
4338 def warn_indirection_through_null : Warning<
4339   "indirection of non-volatile null pointer will be deleted, not trap">, InGroup<NullDereference>;
4340 def note_indirection_through_null : Note<
4341   "consider using __builtin_trap() or qualifying pointer with 'volatile'">;
4342 def warn_pointer_indirection_from_incompatible_type : Warning<
4343   "dereference of type %1 that was reinterpret_cast from type %0 has undefined "
4344   "behavior">,
4345   InGroup<UndefinedReinterpretCast>, DefaultIgnore;
4346
4347 def err_objc_object_assignment : Error<
4348   "cannot assign to class object (%0 invalid)">;
4349 def err_typecheck_invalid_operands : Error<
4350   "invalid operands to binary expression (%0 and %1)">;
4351 def err_typecheck_sub_ptr_compatible : Error<
4352   "%diff{$ and $ are not pointers to compatible types|"
4353   "pointers to incompatible types}0,1">;
4354 def ext_typecheck_ordered_comparison_of_pointer_integer : ExtWarn<
4355   "ordered comparison between pointer and integer (%0 and %1)">;
4356 def ext_typecheck_ordered_comparison_of_pointer_and_zero : Extension<
4357   "ordered comparison between pointer and zero (%0 and %1) is an extension">;
4358 def ext_typecheck_ordered_comparison_of_function_pointers : ExtWarn<
4359   "ordered comparison of function pointers (%0 and %1)">;
4360 def ext_typecheck_comparison_of_fptr_to_void : Extension<
4361   "equality comparison between function pointer and void pointer (%0 and %1)">;
4362 def err_typecheck_comparison_of_fptr_to_void : Error<
4363   "equality comparison between function pointer and void pointer (%0 and %1)">;
4364 def ext_typecheck_comparison_of_pointer_integer : ExtWarn<
4365   "comparison between pointer and integer (%0 and %1)">;
4366 def err_typecheck_comparison_of_pointer_integer : Error<
4367   "comparison between pointer and integer (%0 and %1)">;
4368 def ext_typecheck_comparison_of_distinct_pointers : ExtWarn<
4369   "comparison of distinct pointer types%diff{ ($ and $)|}0,1">,
4370   InGroup<CompareDistinctPointerType>;
4371 def ext_typecheck_cond_incompatible_operands : ExtWarn<
4372   "incompatible operand types (%0 and %1)">;
4373 def err_cond_voidptr_arc : Error <
4374   "operands to conditional of types%diff{ $ and $|}0,1 are incompatible "
4375   "in ARC mode">;
4376 def err_typecheck_comparison_of_distinct_pointers : Error<
4377   "comparison of distinct pointer types%diff{ ($ and $)|}0,1">;
4378 def ext_typecheck_comparison_of_distinct_pointers_nonstandard : ExtWarn<
4379   "comparison of distinct pointer types (%0 and %1) uses non-standard "
4380   "composite pointer type %2">, InGroup<CompareDistinctPointerType>;
4381 def err_typecheck_assign_const : Error<"read-only variable is not assignable">;
4382 def err_stmtexpr_file_scope : Error<
4383   "statement expression not allowed at file scope">;
4384 def warn_mixed_sign_comparison : Warning<
4385   "comparison of integers of different signs: %0 and %1">,
4386   InGroup<SignCompare>, DefaultIgnore;
4387 def warn_lunsigned_always_true_comparison : Warning<
4388   "comparison of unsigned%select{| enum}2 expression %0 is always %1">,
4389   InGroup<TautologicalCompare>;
4390 def warn_out_of_range_compare : Warning<
4391   "comparison of constant %0 with expression of type %1 is always "
4392   "%select{false|true}2">, InGroup<TautologicalOutOfRangeCompare>;
4393 def warn_runsigned_always_true_comparison : Warning<
4394   "comparison of %0 unsigned%select{| enum}2 expression is always %1">,
4395   InGroup<TautologicalCompare>;
4396 def warn_comparison_of_mixed_enum_types : Warning<
4397   "comparison of two values with different enumeration types"
4398   "%diff{ ($ and $)|}0,1">,
4399   InGroup<DiagGroup<"enum-compare">>;
4400 def warn_null_in_arithmetic_operation : Warning<
4401   "use of NULL in arithmetic operation">,
4402   InGroup<NullArithmetic>;
4403 def warn_null_in_comparison_operation : Warning<
4404   "comparison between NULL and non-pointer "
4405   "%select{(%1 and NULL)|(NULL and %1)}0">,
4406   InGroup<NullArithmetic>;
4407
4408 def err_invalid_this_use : Error<
4409   "invalid use of 'this' outside of a non-static member function">;
4410 def err_this_static_member_func : Error<
4411   "'this' cannot be%select{| implicitly}0 used in a static member function "
4412   "declaration">;
4413 def err_invalid_member_use_in_static_method : Error<
4414   "invalid use of member %0 in static member function">;
4415 def err_invalid_qualified_function_type : Error<
4416   "%select{static |non-}0member function %select{of type %2 |}1"
4417   "cannot have '%3' qualifier">;
4418 def err_compound_qualified_function_type : Error<
4419   "%select{block pointer|pointer|reference}0 to function type %select{%2 |}1"
4420   "cannot have '%3' qualifier">;
4421
4422 def err_ref_qualifier_overload : Error<
4423   "cannot overload a member function %select{without a ref-qualifier|with "
4424   "ref-qualifier '&'|with ref-qualifier '&&'}0 with a member function %select{"
4425   "without a ref-qualifier|with ref-qualifier '&'|with ref-qualifier '&&'}1">;
4426
4427 def err_invalid_non_static_member_use : Error<
4428   "invalid use of non-static data member %0">;
4429 def err_nested_non_static_member_use : Error<
4430   "%select{call to non-static member function|use of non-static data member}0 "
4431   "%2 of %1 from nested type %3">;
4432 def warn_cxx98_compat_non_static_member_use : Warning<
4433   "use of non-static data member %0 in an unevaluated context is "
4434   "incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
4435 def err_invalid_incomplete_type_use : Error<
4436   "invalid use of incomplete type %0">;
4437 def err_builtin_func_cast_more_than_one_arg : Error<
4438   "function-style cast to a builtin type can only take one argument">;
4439 def err_value_init_for_array_type : Error<
4440   "array types cannot be value-initialized">;
4441 def warn_format_nonliteral_noargs : Warning<
4442   "format string is not a string literal (potentially insecure)">,
4443   InGroup<FormatSecurity>;
4444 def warn_format_nonliteral : Warning<
4445   "format string is not a string literal">,
4446   InGroup<FormatNonLiteral>, DefaultIgnore;
4447
4448 def err_unexpected_interface : Error<
4449   "unexpected interface name %0: expected expression">;
4450 def err_ref_non_value : Error<"%0 does not refer to a value">;
4451 def err_ref_vm_type : Error<
4452   "cannot refer to declaration with a variably modified type inside block">;
4453 def err_ref_flexarray_type : Error<
4454   "cannot refer to declaration of structure variable with flexible array member "
4455   "inside block">;
4456 def err_ref_array_type : Error<
4457   "cannot refer to declaration with an array type inside block">;
4458 def err_property_not_found : Error<
4459   "property %0 not found on object of type %1">;
4460 def err_invalid_property_name : Error<
4461   "%0 is not a valid property name (accessing an object of type %1)">;
4462 def err_getter_not_found : Error<
4463   "no getter method for read from property">;
4464 def err_objc_subscript_method_not_found : Error<
4465   "expected method to %select{read|write}1 %select{dictionary|array}2 element not "
4466   "found on object of type %0">;
4467 def err_objc_subscript_index_type : Error<
4468   "method index parameter type %0 is not integral type">;
4469 def err_objc_subscript_key_type : Error<
4470   "method key parameter type %0 is not object type">;
4471 def err_objc_subscript_dic_object_type : Error<
4472   "method object parameter type %0 is not object type">;
4473 def err_objc_subscript_object_type : Error<
4474   "cannot assign to this %select{dictionary|array}1 because assigning method's "
4475   "2nd parameter of type %0 is not an Objective-C pointer type">;
4476 def err_objc_subscript_base_type : Error<
4477   "%select{dictionary|array}1 subscript base type %0 is not an Objective-C object">;
4478 def err_objc_multiple_subscript_type_conversion : Error<
4479   "indexing expression is invalid because subscript type %0 has "
4480   "multiple type conversion functions">;
4481 def err_objc_subscript_type_conversion : Error<
4482   "indexing expression is invalid because subscript type %0 is not an integral"
4483   " or Objective-C pointer type">;
4484 def err_objc_subscript_pointer : Error<
4485   "indexing expression is invalid because subscript type %0 is not an"
4486   " Objective-C pointer">;
4487 def err_objc_indexing_method_result_type : Error<
4488   "method for accessing %select{dictionary|array}1 element must have Objective-C"
4489   " object return type instead of %0">;
4490 def err_objc_index_incomplete_class_type : Error<
4491   "Objective-C index expression has incomplete class type %0">;
4492 def err_illegal_container_subscripting_op : Error<
4493   "illegal operation on Objective-C container subscripting">;
4494 def err_property_not_found_forward_class : Error<
4495   "property %0 cannot be found in forward class object %1">;
4496 def err_property_not_as_forward_class : Error<
4497   "property %0 refers to an incomplete Objective-C class %1 "
4498   "(with no @interface available)">;
4499 def note_forward_class : Note<
4500   "forward declaration of class here">;
4501 def err_duplicate_property : Error<
4502   "property has a previous declaration">;
4503 def ext_gnu_void_ptr : Extension<
4504   "arithmetic on%select{ a|}0 pointer%select{|s}0 to void is a GNU extension">,
4505   InGroup<PointerArith>;
4506 def ext_gnu_ptr_func_arith : Extension<
4507   "arithmetic on%select{ a|}0 pointer%select{|s}0 to%select{ the|}2 function "
4508   "type%select{|s}2 %1%select{| and %3}2 is a GNU extension">,
4509   InGroup<PointerArith>;
4510 def error_readonly_message_assignment : Error<
4511   "assigning to 'readonly' return result of an Objective-C message not allowed">;
4512 def ext_integer_increment_complex : Extension<
4513   "ISO C does not support '++'/'--' on complex integer type %0">;
4514 def ext_integer_complement_complex : Extension<
4515   "ISO C does not support '~' for complex conjugation of %0">;
4516 def err_nosetter_property_assignment : Error<
4517   "%select{assignment to readonly property|"
4518   "no setter method %1 for assignment to property}0">;
4519 def err_nosetter_property_incdec : Error<
4520   "%select{%select{increment|decrement}1 of readonly property|"
4521   "no setter method %2 for %select{increment|decrement}1 of property}0">;
4522 def err_nogetter_property_compound_assignment : Error<
4523   "a getter method is needed to perform a compound assignment on a property">;
4524 def err_nogetter_property_incdec : Error<
4525   "no getter method %1 for %select{increment|decrement}0 of property">;
4526 def error_no_subobject_property_setting : Error<
4527   "expression is not assignable">;
4528 def err_qualified_objc_access : Error<
4529   "%select{property|instance variable}0 access cannot be qualified with '%1'">;
4530   
4531 def ext_freestanding_complex : Extension<
4532   "complex numbers are an extension in a freestanding C99 implementation">;
4533
4534 // FIXME: Remove when we support imaginary.
4535 def err_imaginary_not_supported : Error<"imaginary types are not supported">;
4536
4537 // Obj-c expressions
4538 def warn_root_inst_method_not_found : Warning<
4539   "instance method %0 is being used on 'Class' which is not in the root class">,
4540   InGroup<MethodAccess>;
4541 def warn_class_method_not_found : Warning<
4542   "class method %objcclass0 not found (return type defaults to 'id')">,
4543   InGroup<MethodAccess>;
4544 def warn_instance_method_on_class_found : Warning<
4545   "instance method %0 found instead of class method %1">,
4546   InGroup<MethodAccess>;
4547 def warn_inst_method_not_found : Warning<
4548   "instance method %objcinstance0 not found (return type defaults to 'id')">,
4549   InGroup<MethodAccess>;
4550 def error_no_super_class_message : Error<
4551   "no @interface declaration found in class messaging of %0">;
4552 def error_root_class_cannot_use_super : Error<
4553   "%0 cannot use 'super' because it is a root class">;
4554 def err_invalid_receiver_to_message_super : Error<
4555   "'super' is only valid in a method body">;
4556 def err_invalid_receiver_class_message : Error<
4557   "receiver type %0 is not an Objective-C class">;
4558 def err_missing_open_square_message_send : Error<
4559   "missing '[' at start of message send expression">;
4560 def warn_bad_receiver_type : Warning<
4561   "receiver type %0 is not 'id' or interface pointer, consider "
4562   "casting it to 'id'">,InGroup<ObjCReceiver>;
4563 def err_bad_receiver_type : Error<"bad receiver type %0">;
4564 def err_unknown_receiver_suggest : Error<
4565   "unknown receiver %0; did you mean %1?">;
4566 def error_objc_throw_expects_object : Error<
4567   "@throw requires an Objective-C object type (%0 invalid)">;
4568 def error_objc_synchronized_expects_object : Error<
4569   "@synchronized requires an Objective-C object type (%0 invalid)">;
4570 def error_rethrow_used_outside_catch : Error<
4571   "@throw (rethrow) used outside of a @catch block">;
4572 def err_attribute_multiple_objc_gc : Error<
4573   "multiple garbage collection attributes specified for type">;
4574 def err_catch_param_not_objc_type : Error<
4575   "@catch parameter is not a pointer to an interface type">;
4576 def err_illegal_qualifiers_on_catch_parm : Error<
4577   "illegal qualifiers on @catch parameter">;
4578 def err_storage_spec_on_catch_parm : Error<
4579   "@catch parameter cannot have storage specifier '%0'">;
4580 def warn_register_objc_catch_parm : Warning<
4581   "'register' storage specifier on @catch parameter will be ignored">;
4582 def err_qualified_objc_catch_parm : Error<
4583   "@catch parameter declarator cannot be qualified">;
4584 def warn_objc_pointer_cxx_catch_fragile : Warning<
4585   "can not catch an exception thrown with @throw in C++ in the non-unified "
4586   "exception model">, InGroup<ObjCNonUnifiedException>;
4587 def err_objc_object_catch : Error<
4588   "can't catch an Objective-C object by value">;
4589 def err_incomplete_type_objc_at_encode : Error<
4590   "'@encode' of incomplete type %0">;
4591
4592 def warn_setter_getter_impl_required : Warning<
4593   "property %0 requires method %1 to be defined - "
4594   "use @synthesize, @dynamic or provide a method implementation "
4595   "in this class implementation">,
4596   InGroup<ObjCPropertyImpl>;
4597 def warn_setter_getter_impl_required_in_category : Warning<
4598   "property %0 requires method %1 to be defined - "
4599   "use @dynamic or provide a method implementation in this category">,
4600   InGroup<ObjCPropertyImpl>;
4601 def note_parameter_named_here : Note<
4602   "passing argument to parameter %0 here">;
4603 def note_parameter_here : Note<
4604   "passing argument to parameter here">;
4605
4606 // C++ casts
4607 // These messages adhere to the TryCast pattern: %0 is an int specifying the
4608 // cast type, %1 is the source type, %2 is the destination type.
4609 def err_bad_reinterpret_cast_overload : Error<
4610   "reinterpret_cast cannot resolve overloaded function %0 to type %1">;
4611
4612 def warn_reinterpret_different_from_static : Warning<
4613   "'reinterpret_cast' %select{from|to}3 class %0 %select{to|from}3 its "
4614   "%select{virtual base|base at non-zero offset}2 %1 behaves differently from "
4615   "'static_cast'">, InGroup<ReinterpretBaseClass>;
4616 def note_reinterpret_updowncast_use_static: Note<
4617   "use 'static_cast' to adjust the pointer correctly while "
4618   "%select{upcasting|downcasting}0">;
4619
4620 def err_bad_static_cast_overload : Error<
4621   "address of overloaded function %0 cannot be static_cast to type %1">;
4622
4623 def err_bad_cstyle_cast_overload : Error<
4624   "address of overloaded function %0 cannot be cast to type %1">;
4625
4626
4627 def err_bad_cxx_cast_generic : Error<
4628   "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
4629   "functional-style cast}0 from %1 to %2 is not allowed">;
4630 def err_bad_cxx_cast_rvalue : Error<
4631   "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
4632   "functional-style cast}0 from rvalue to reference type %2">;
4633 def err_bad_cxx_cast_bitfield : Error<
4634   "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
4635   "functional-style cast}0 from bit-field lvalue to reference type %2">;
4636 def err_bad_cxx_cast_qualifiers_away : Error<
4637   "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
4638   "functional-style cast}0 from %1 to %2 casts away qualifiers">;
4639 def err_bad_const_cast_dest : Error<
4640   "%select{const_cast||||C-style cast|functional-style cast}0 to %2, "
4641   "which is not a reference, pointer-to-object, or pointer-to-data-member">;
4642 def ext_cast_fn_obj : Extension<
4643   "cast between pointer-to-function and pointer-to-object is an extension">;
4644 def warn_cxx98_compat_cast_fn_obj : Warning<
4645   "cast between pointer-to-function and pointer-to-object is incompatible with C++98">,
4646   InGroup<CXX98CompatPedantic>, DefaultIgnore;
4647 def err_bad_reinterpret_cast_small_int : Error<
4648   "cast from pointer to smaller type %2 loses information">;
4649 def err_bad_cxx_cast_vector_to_scalar_different_size : Error<
4650   "%select{||reinterpret_cast||C-style cast|}0 from vector %1 " 
4651   "to scalar %2 of different size">;
4652 def err_bad_cxx_cast_scalar_to_vector_different_size : Error<
4653   "%select{||reinterpret_cast||C-style cast|}0 from scalar %1 " 
4654   "to vector %2 of different size">;
4655 def err_bad_cxx_cast_vector_to_vector_different_size : Error<
4656   "%select{||reinterpret_cast||C-style cast|}0 from vector %1 " 
4657   "to vector %2 of different size">;
4658 def err_bad_lvalue_to_rvalue_cast : Error<
4659   "cannot cast from lvalue of type %1 to rvalue reference type %2; types are "
4660   "not compatible">;
4661 def err_bad_static_cast_pointer_nonpointer : Error<
4662   "cannot cast from type %1 to pointer type %2">;
4663 def err_bad_static_cast_member_pointer_nonmp : Error<
4664   "cannot cast from type %1 to member pointer type %2">;
4665 def err_bad_cxx_cast_member_pointer_size : Error<
4666   "cannot %select{||reinterpret_cast||C-style cast|}0 from member pointer "
4667   "type %1 to member pointer type %2 of different size">;
4668 def err_bad_reinterpret_cast_reference : Error<
4669   "reinterpret_cast of a %0 to %1 needs its address which is not allowed">;
4670 def warn_undefined_reinterpret_cast : Warning<
4671   "reinterpret_cast from %0 to %1 has undefined behavior">,
4672   InGroup<UndefinedReinterpretCast>, DefaultIgnore;
4673
4674 // These messages don't adhere to the pattern.
4675 // FIXME: Display the path somehow better.
4676 def err_ambiguous_base_to_derived_cast : Error<
4677   "ambiguous cast from base %0 to derived %1:%2">;
4678 def err_static_downcast_via_virtual : Error<
4679   "cannot cast %0 to %1 via virtual base %2">;
4680 def err_downcast_from_inaccessible_base : Error<
4681   "cannot cast %select{private|protected}2 base class %1 to %0">;
4682 def err_upcast_to_inaccessible_base : Error<
4683   "cannot cast %0 to its %select{private|protected}2 base class %1">;
4684 def err_bad_dynamic_cast_not_ref_or_ptr : Error<
4685   "%0 is not a reference or pointer">;
4686 def err_bad_dynamic_cast_not_class : Error<"%0 is not a class">;
4687 def err_bad_dynamic_cast_incomplete : Error<"%0 is an incomplete type">;
4688 def err_bad_dynamic_cast_not_ptr : Error<"%0 is not a pointer">;
4689 def err_bad_dynamic_cast_not_polymorphic : Error<"%0 is not polymorphic">;
4690
4691 // Other C++ expressions
4692 def err_need_header_before_typeid : Error<
4693   "you need to include <typeinfo> before using the 'typeid' operator">;
4694 def err_need_header_before_ms_uuidof : Error<
4695   "you need to include <guiddef.h> before using the '__uuidof' operator">;
4696 def err_uuidof_without_guid : Error<
4697   "cannot call operator __uuidof on a type with no GUID">;
4698 def err_incomplete_typeid : Error<"'typeid' of incomplete type %0">;
4699 def err_static_illegal_in_new : Error<
4700   "the 'static' modifier for the array size is not legal in new expressions">;
4701 def err_array_new_needs_size : Error<
4702   "array size must be specified in new expressions">;
4703 def err_bad_new_type : Error<
4704   "cannot allocate %select{function|reference}1 type %0 with new">;
4705 def err_new_incomplete_type : Error<
4706   "allocation of incomplete type %0">;
4707 def err_new_array_nonconst : Error<
4708   "only the first dimension of an allocated array may have dynamic size">;
4709 def err_new_array_init_args : Error<
4710   "array 'new' cannot have initialization arguments">;
4711 def ext_new_paren_array_nonconst : ExtWarn<
4712   "when type is in parentheses, array cannot have dynamic size">;
4713 def err_placement_new_non_placement_delete : Error<
4714   "'new' expression with placement arguments refers to non-placement "
4715   "'operator delete'">;
4716 def err_array_size_not_integral : Error<
4717   "array size expression must have integral or %select{|unscoped }0"
4718   "enumeration type, not %1">;
4719 def err_array_size_incomplete_type : Error<
4720   "array size expression has incomplete class type %0">;
4721 def err_array_size_explicit_conversion : Error<
4722   "array size expression of type %0 requires explicit conversion to type %1">;
4723 def note_array_size_conversion : Note<
4724   "conversion to %select{integral|enumeration}0 type %1 declared here">;
4725 def err_array_size_ambiguous_conversion : Error<
4726   "ambiguous conversion of array size expression of type %0 to an integral or "
4727   "enumeration type">;
4728 def ext_array_size_conversion : Extension<
4729   "implicit conversion from array size expression of type %0 to "
4730   "%select{integral|enumeration}1 type %2 is a C++11 extension">,
4731   InGroup<CXX11>;
4732 def warn_cxx98_compat_array_size_conversion : Warning<
4733   "implicit conversion from array size expression of type %0 to "
4734   "%select{integral|enumeration}1 type %2 is incompatible with C++98">,
4735   InGroup<CXX98CompatPedantic>, DefaultIgnore;
4736 def err_address_space_qualified_new : Error<
4737   "'new' cannot allocate objects of type %0 in address space '%1'">;
4738 def err_address_space_qualified_delete : Error<
4739   "'delete' cannot delete objects of type %0 in address space '%1'">;
4740
4741 def err_default_init_const : Error<
4742   "default initialization of an object of const type %0"
4743   "%select{| requires a user-provided default constructor}1">;
4744 def err_delete_operand : Error<"cannot delete expression of type %0">;
4745 def ext_delete_void_ptr_operand : ExtWarn<
4746   "cannot delete expression with pointer-to-'void' type %0">;
4747 def err_ambiguous_delete_operand : Error<"ambiguous conversion of delete "
4748                                          "expression of type %0 to a pointer">;
4749 def warn_delete_incomplete : Warning<
4750   "deleting pointer to incomplete type %0 may cause undefined behavior">,
4751   InGroup<DiagGroup<"delete-incomplete">>;
4752 def err_delete_incomplete_class_type : Error<
4753   "deleting incomplete class type %0; no conversions to pointer type">;
4754 def warn_delete_array_type : Warning<
4755   "'delete' applied to a pointer-to-array type %0 treated as delete[]">;
4756 def err_no_suitable_delete_member_function_found : Error<
4757   "no suitable member %0 in %1">;
4758 def err_ambiguous_suitable_delete_member_function_found : Error<
4759   "multiple suitable %0 functions in %1">;
4760 def note_member_declared_here : Note<
4761   "member %0 declared here">;
4762 def err_decrement_bool : Error<"cannot decrement expression of type bool">;
4763 def warn_increment_bool : Warning<
4764   "incrementing expression of type bool is deprecated">, InGroup<Deprecated>;
4765 def err_catch_incomplete_ptr : Error<
4766   "cannot catch pointer to incomplete type %0">;
4767 def err_catch_incomplete_ref : Error<
4768   "cannot catch reference to incomplete type %0">;
4769 def err_catch_incomplete : Error<"cannot catch incomplete type %0">;
4770 def err_catch_rvalue_ref : Error<"cannot catch exceptions by rvalue reference">;
4771 def err_qualified_catch_declarator : Error<
4772   "exception declarator cannot be qualified">;
4773 def err_early_catch_all : Error<"catch-all handler must come last">;
4774 def err_bad_memptr_rhs : Error<
4775   "right hand operand to %0 has non pointer-to-member type %1">;
4776 def err_bad_memptr_lhs : Error<
4777   "left hand operand to %0 must be a %select{|pointer to }1class "
4778   "compatible with the right hand operand, but is %2">;
4779 def warn_exception_caught_by_earlier_handler : Warning<
4780   "exception of type %0 will be caught by earlier handler">;
4781 def note_previous_exception_handler : Note<"for type %0">;
4782 def err_exceptions_disabled : Error<
4783   "cannot use '%0' with exceptions disabled">;
4784 def err_objc_exceptions_disabled : Error<
4785   "cannot use '%0' with Objective-C exceptions disabled">;
4786 def warn_non_virtual_dtor : Warning<
4787   "%0 has virtual functions but non-virtual destructor">,
4788   InGroup<NonVirtualDtor>, DefaultIgnore;
4789 def warn_delete_non_virtual_dtor : Warning<
4790   "delete called on %0 that has virtual functions but non-virtual destructor">,
4791   InGroup<DeleteNonVirtualDtor>, DefaultIgnore;
4792 def warn_delete_abstract_non_virtual_dtor : Warning<
4793   "delete called on %0 that is abstract but has non-virtual destructor">,
4794   InGroup<DeleteNonVirtualDtor>;
4795 def warn_overloaded_virtual : Warning<
4796   "%q0 hides overloaded virtual %select{function|functions}1">,
4797   InGroup<OverloadedVirtual>, DefaultIgnore;
4798 def note_hidden_overloaded_virtual_declared_here : Note<
4799   "hidden overloaded virtual function %q0 declared here"
4800   "%select{|: different classes%diff{ ($ vs $)|}2,3"
4801   "|: different number of parameters (%2 vs %3)"
4802   "|: type mismatch at %ordinal2 parameter%diff{ ($ vs $)|}3,4"
4803   "|: different return type%diff{ ($ vs $)|}2,3"
4804   "|: different qualifiers ("
4805   "%select{none|const|restrict|const and restrict|volatile|const and volatile|"
4806   "volatile and restrict|const, volatile, and restrict}2 vs "
4807   "%select{none|const|restrict|const and restrict|volatile|const and volatile|"
4808   "volatile and restrict|const, volatile, and restrict}3)}1">;
4809 def warn_using_directive_in_header : Warning<
4810   "using namespace directive in global context in header">,
4811   InGroup<HeaderHygiene>, DefaultIgnore;
4812 def warn_overaligned_type : Warning<
4813   "type %0 requires %1 bytes of alignment and the default allocator only "
4814   "guarantees %2 bytes">,
4815   InGroup<OveralignedType>, DefaultIgnore;
4816
4817 def err_conditional_void_nonvoid : Error<
4818   "%select{left|right}1 operand to ? is void, but %select{right|left}1 operand "
4819   "is of type %0">;
4820 def err_conditional_ambiguous : Error<
4821   "conditional expression is ambiguous; "
4822   "%diff{$ can be converted to $ and vice versa|"
4823   "types can be convert to each other}0,1">;
4824 def err_conditional_ambiguous_ovl : Error<
4825   "conditional expression is ambiguous; %diff{$ and $|types}0,1 "
4826   "can be converted to several common types">;
4827
4828 def err_throw_incomplete : Error<
4829   "cannot throw object of incomplete type %0">;
4830 def err_throw_incomplete_ptr : Error<
4831   "cannot throw pointer to object of incomplete type %0">;
4832 def err_return_in_constructor_handler : Error<
4833   "return in the catch of a function try block of a constructor is illegal">;
4834
4835 let CategoryName = "Lambda Issue" in {
4836   def err_capture_more_than_once : Error<
4837     "%0 can appear only once in a capture list">;
4838   def err_reference_capture_with_reference_default : Error<
4839     "'&' cannot precede a capture when the capture default is '&'">;
4840   def err_this_capture_with_copy_default : Error<
4841     "'this' cannot be explicitly captured when the capture default is '='">;
4842   def err_copy_capture_with_copy_default : Error<
4843     "'&' must precede a capture when the capture default is '='">;
4844   def err_capture_does_not_name_variable : Error<
4845     "%0 in capture list does not name a variable">;
4846   def err_capture_non_automatic_variable : Error<
4847     "%0 cannot be captured because it does not have automatic storage "
4848     "duration">;
4849   def err_this_capture : Error<
4850     "'this' cannot be %select{implicitly |}0captured in this context">;
4851   def err_lambda_capture_block : Error<
4852     "__block variable %0 cannot be captured in a lambda expression">;
4853   def err_lambda_capture_anonymous_var : Error<
4854     "unnamed variable cannot be implicitly captured in a lambda expression">;
4855   def err_lambda_capture_vm_type : Error<
4856     "variable %0 with variably modified type cannot be captured in "
4857     "a lambda expression">;
4858   def err_lambda_capture_flexarray_type : Error<
4859     "variable %0 with flexible array member cannot be captured in "
4860     "a lambda expression">;
4861   def err_lambda_impcap : Error<
4862     "variable %0 cannot be implicitly captured in a lambda with no "
4863     "capture-default specified">;
4864   def note_lambda_decl : Note<"lambda expression begins here">;
4865   def err_lambda_unevaluated_operand : Error<
4866     "lambda expression in an unevaluated operand">;
4867   def err_lambda_return_init_list : Error<
4868     "cannot deduce lambda return type from initializer list">;
4869   def err_lambda_capture_default_arg : Error<
4870     "lambda expression in default argument cannot capture any entity">;
4871   def err_lambda_incomplete_result : Error<
4872     "incomplete result type %0 in lambda expression">;
4873   def err_lambda_objc_object_result : Error<
4874     "non-pointer Objective-C class type %0 in lambda expression result">;
4875   def err_noreturn_lambda_has_return_expr : Error<
4876     "lambda declared 'noreturn' should not return">;
4877   def warn_maybe_falloff_nonvoid_lambda : Warning<
4878     "control may reach end of non-void lambda">,
4879     InGroup<ReturnType>;
4880   def warn_falloff_nonvoid_lambda : Warning<
4881     "control reaches end of non-void lambda">,
4882     InGroup<ReturnType>;
4883   def err_access_lambda_capture : Error<
4884     // The ERRORs represent other special members that aren't constructors, in
4885     // hopes that someone will bother noticing and reporting if they appear
4886     "capture of variable '%0' as type %1 calls %select{private|protected}3 "
4887     "%select{default |copy |move |*ERROR* |*ERROR* |*ERROR* |}2constructor">,
4888     AccessControl;
4889   def note_lambda_to_block_conv : Note<
4890     "implicit capture of lambda object due to conversion to block pointer "
4891     "here">;
4892 }
4893
4894 def err_return_in_captured_stmt : Error<
4895   "cannot return from %0">;
4896
4897 def err_operator_arrow_circular : Error<
4898   "circular pointer delegation detected">;
4899 def err_pseudo_dtor_base_not_scalar : Error<
4900   "object expression of non-scalar type %0 cannot be used in a "
4901   "pseudo-destructor expression">;
4902 def ext_pseudo_dtor_on_void : ExtWarn<
4903   "pseudo-destructors on type void are a Microsoft extension">,
4904   InGroup<Microsoft>;
4905 def err_pseudo_dtor_type_mismatch : Error<
4906   "the type of object expression "
4907   "%diff{($) does not match the type being destroyed ($)|"
4908   "does not match the type being destroyed}0,1 "
4909   "in pseudo-destructor expression">;
4910 def err_pseudo_dtor_call_with_args : Error<
4911   "call to pseudo-destructor cannot have any arguments">;
4912 def err_dtor_expr_without_call : Error<
4913   "%select{destructor reference|pseudo-destructor expression}0 must be "
4914   "called immediately with '()'">;
4915 def err_pseudo_dtor_destructor_non_type : Error<
4916   "%0 does not refer to a type name in pseudo-destructor expression; expected "
4917   "the name of type %1">;
4918 def err_invalid_use_of_function_type : Error<
4919   "a function type is not allowed here">;
4920 def err_invalid_use_of_array_type : Error<"an array type is not allowed here">;
4921 def err_type_defined_in_condition : Error<
4922   "types may not be defined in conditions">;
4923 def err_typecheck_bool_condition : Error<
4924   "value of type %0 is not contextually convertible to 'bool'">;
4925 def err_typecheck_ambiguous_condition : Error<
4926   "conversion %diff{from $ to $|between types}0,1 is ambiguous">;
4927 def err_typecheck_nonviable_condition : Error<
4928   "no viable conversion%diff{ from $ to $|}0,1">;
4929 def err_typecheck_deleted_function : Error<
4930   "conversion function %diff{from $ to $|between types}0,1 "
4931   "invokes a deleted function">;
4932   
4933 def err_expected_class_or_namespace : Error<"expected a class or namespace">;
4934 def err_expected_class : Error<"%0 is not a class%select{ or namespace|, "
4935   "namespace, or scoped enumeration}1">;
4936 def err_invalid_declarator_scope : Error<"cannot define or redeclare %0 here "
4937   "because namespace %1 does not enclose namespace %2">;
4938 def err_invalid_declarator_global_scope : Error<
4939   "definition or redeclaration of %0 cannot name the global scope">;
4940 def err_invalid_declarator_in_function : Error<
4941   "definition or redeclaration of %0 not allowed inside a function">;
4942 def err_not_tag_in_scope : Error<
4943   "no %select{struct|interface|union|class|enum}0 named %1 in %2">;
4944
4945 def err_no_typeid_with_fno_rtti : Error<
4946   "cannot use typeid with -fno-rtti">;
4947
4948 def err_cannot_form_pointer_to_member_of_reference_type : Error<
4949   "cannot form a pointer-to-member to member %0 of reference type %1">;
4950 def err_incomplete_object_call : Error<
4951   "incomplete type in call to object of type %0">;
4952
4953 def warn_condition_is_assignment : Warning<"using the result of an "
4954   "assignment as a condition without parentheses">,
4955   InGroup<Parentheses>;
4956 // Completely identical except off by default.
4957 def warn_condition_is_idiomatic_assignment : Warning<"using the result "
4958   "of an assignment as a condition without parentheses">,
4959   InGroup<DiagGroup<"idiomatic-parentheses">>, DefaultIgnore;
4960 def note_condition_assign_to_comparison : Note<
4961   "use '==' to turn this assignment into an equality comparison">;
4962 def note_condition_or_assign_to_comparison : Note<
4963   "use '!=' to turn this compound assignment into an inequality comparison">;
4964 def note_condition_assign_silence : Note<
4965   "place parentheses around the assignment to silence this warning">;
4966
4967 def warn_equality_with_extra_parens : Warning<"equality comparison with "
4968   "extraneous parentheses">, InGroup<ParenthesesOnEquality>;
4969 def note_equality_comparison_to_assign : Note<
4970   "use '=' to turn this equality comparison into an assignment">;
4971 def note_equality_comparison_silence : Note<
4972   "remove extraneous parentheses around the comparison to silence this warning">;
4973
4974 // assignment related diagnostics (also for argument passing, returning, etc).
4975 // In most of these diagnostics the %2 is a value from the
4976 // Sema::AssignmentAction enumeration
4977 def err_typecheck_convert_incompatible : Error<
4978   "%select{%diff{assigning to $ from incompatible type $|"
4979   "assigning to type from incompatible type}0,1"
4980   "|%diff{passing $ to parameter of incompatible type $|"
4981   "passing type to parameter of incompatible type}0,1"
4982   "|%diff{returning $ from a function with incompatible result type $|"
4983   "returning type from a function with incompatible result type}0,1"
4984   "|%diff{converting $ to incompatible type $|"
4985   "converting type to incompatible type}0,1"
4986   "|%diff{initializing $ with an expression of incompatible type $|"
4987   "initializing type with an expression of incompatible type}0,1"
4988   "|%diff{sending $ to parameter of incompatible type $|"
4989   "sending type to parameter of incompatible type}0,1"
4990   "|%diff{casting $ to incompatible type $|"
4991   "casting type to incompatible type}0,1}2"
4992   "%select{|; dereference with *|"
4993   "; take the address with &|"
4994   "; remove *|"
4995   "; remove &}3"
4996   "%select{|: different classes%diff{ ($ vs $)|}5,6"
4997   "|: different number of parameters (%5 vs %6)"
4998   "|: type mismatch at %ordinal5 parameter%diff{ ($ vs $)|}6,7"
4999   "|: different return type%diff{ ($ vs $)|}5,6"
5000   "|: different qualifiers ("
5001   "%select{none|const|restrict|const and restrict|volatile|const and volatile|"
5002   "volatile and restrict|const, volatile, and restrict}5 vs "
5003   "%select{none|const|restrict|const and restrict|volatile|const and volatile|"
5004   "volatile and restrict|const, volatile, and restrict}6)}4">;
5005 def err_typecheck_missing_return_type_incompatible : Error<
5006   "%diff{return type $ must match previous return type $|"
5007   "return type must match previous return type}0,1 when %select{block "
5008   "literal|lambda expression}2 has unspecified explicit return type">;
5009
5010 def warn_incompatible_qualified_id : Warning<
5011   "%select{%diff{assigning to $ from incompatible type $|"
5012   "assigning to type from incompatible type}0,1"
5013   "|%diff{passing $ to parameter of incompatible type $|"
5014   "passing type to parameter of incompatible type}0,1"
5015   "|%diff{returning $ from a function with incompatible result type $|"
5016   "returning type from a function with incompatible result type}0,1"
5017   "|%diff{converting $ to incompatible type $|"
5018   "converting type to incompatible type}0,1"
5019   "|%diff{initializing $ with an expression of incompatible type $|"
5020   "initializing type with an expression of incompatible type}0,1"
5021   "|%diff{sending $ to parameter of incompatible type $|"
5022   "sending type to parameter of incompatible type}0,1"
5023   "|%diff{casting $ to incompatible type $|"
5024   "casting type to incompatible type}0,1}2">;
5025 def ext_typecheck_convert_pointer_int : ExtWarn<
5026   "incompatible pointer to integer conversion "
5027   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
5028   "|%diff{passing $ to parameter of type $|"
5029   "passing to parameter of different type}0,1"
5030   "|%diff{returning $ from a function with result type $|"
5031   "returning from function with different return type}0,1"
5032   "|%diff{converting $ to type $|converting between types}0,1"
5033   "|%diff{initializing $ with an expression of type $|"
5034   "initializing with expression of different type}0,1"
5035   "|%diff{sending $ to parameter of type $|"
5036   "sending to parameter of different type}0,1"
5037   "|%diff{casting $ to type $|casting between types}0,1}2"
5038   "%select{|; dereference with *|"
5039   "; take the address with &|"
5040   "; remove *|"
5041   "; remove &}3">,
5042   InGroup<IntConversion>;
5043 def ext_typecheck_convert_int_pointer : ExtWarn<
5044   "incompatible integer to pointer conversion "
5045   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
5046   "|%diff{passing $ to parameter of type $|"
5047   "passing to parameter of different type}0,1"
5048   "|%diff{returning $ from a function with result type $|"
5049   "returning from function with different return type}0,1"
5050   "|%diff{converting $ to type $|converting between types}0,1"
5051   "|%diff{initializing $ with an expression of type $|"
5052   "initializing with expression of different type}0,1"
5053   "|%diff{sending $ to parameter of type $|"
5054   "sending to parameter of different type}0,1"
5055   "|%diff{casting $ to type $|casting between types}0,1}2"
5056   "%select{|; dereference with *|"
5057   "; take the address with &|"
5058   "; remove *|"
5059   "; remove &}3">,
5060   InGroup<IntConversion>;
5061 def ext_typecheck_convert_pointer_void_func : Extension<
5062   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
5063   "|%diff{passing $ to parameter of type $|"
5064   "passing to parameter of different type}0,1"
5065   "|%diff{returning $ from a function with result type $|"
5066   "returning from function with different return type}0,1"
5067   "|%diff{converting $ to type $|converting between types}0,1"
5068   "|%diff{initializing $ with an expression of type $|"
5069   "initializing with expression of different type}0,1"
5070   "|%diff{sending $ to parameter of type $|"
5071   "sending to parameter of different type}0,1"
5072   "|%diff{casting $ to type $|casting between types}0,1}2"
5073   " converts between void pointer and function pointer">;
5074 def ext_typecheck_convert_incompatible_pointer_sign : ExtWarn<
5075   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
5076   "|%diff{passing $ to parameter of type $|"
5077   "passing to parameter of different type}0,1"
5078   "|%diff{returning $ from a function with result type $|"
5079   "returning from function with different return type}0,1"
5080   "|%diff{converting $ to type $|converting between types}0,1"
5081   "|%diff{initializing $ with an expression of type $|"
5082   "initializing with expression of different type}0,1"
5083   "|%diff{sending $ to parameter of type $|"
5084   "sending to parameter of different type}0,1"
5085   "|%diff{casting $ to type $|casting between types}0,1}2"
5086   " converts between pointers to integer types with different sign">,
5087   InGroup<DiagGroup<"pointer-sign">>;
5088 def ext_typecheck_convert_incompatible_pointer : ExtWarn<
5089   "incompatible pointer types "
5090   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
5091   "|%diff{passing $ to parameter of type $|"
5092   "passing to parameter of different type}0,1"
5093   "|%diff{returning $ from a function with result type $|"
5094   "returning from function with different return type}0,1"
5095   "|%diff{converting $ to type $|converting between types}0,1"
5096   "|%diff{initializing $ with an expression of type $|"
5097   "initializing with expression of different type}0,1"
5098   "|%diff{sending $ to parameter of type $|"
5099   "sending to parameter of different type}0,1"
5100   "|%diff{casting $ to type $|casting between types}0,1}2"
5101   "%select{|; dereference with *|"
5102   "; take the address with &|"
5103   "; remove *|"
5104   "; remove &}3">,
5105   InGroup<IncompatiblePointerTypes>;
5106 def ext_typecheck_convert_discards_qualifiers : ExtWarn<
5107   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
5108   "|%diff{passing $ to parameter of type $|"
5109   "passing to parameter of different type}0,1"
5110   "|%diff{returning $ from a function with result type $|"
5111   "returning from function with different return type}0,1"
5112   "|%diff{converting $ to type $|converting between types}0,1"
5113   "|%diff{initializing $ with an expression of type $|"
5114   "initializing with expression of different type}0,1"
5115   "|%diff{sending $ to parameter of type $|"
5116   "sending to parameter of different type}0,1"
5117   "|%diff{casting $ to type $|casting between types}0,1}2"
5118   " discards qualifiers">,
5119   InGroup<IncompatiblePointerTypesDiscardsQualifiers>;
5120 def ext_nested_pointer_qualifier_mismatch : ExtWarn<
5121   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
5122   "|%diff{passing $ to parameter of type $|"
5123   "passing to parameter of different type}0,1"
5124   "|%diff{returning $ from a function with result type $|"
5125   "returning from function with different return type}0,1"
5126   "|%diff{converting $ to type $|converting between types}0,1"
5127   "|%diff{initializing $ with an expression of type $|"
5128   "initializing with expression of different type}0,1"
5129   "|%diff{sending $ to parameter of type $|"
5130   "sending to parameter of different type}0,1"
5131   "|%diff{casting $ to type $|casting between types}0,1}2"
5132   " discards qualifiers in nested pointer types">,
5133   InGroup<IncompatiblePointerTypesDiscardsQualifiers>;
5134 def warn_incompatible_vectors : Warning<
5135   "incompatible vector types "
5136   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
5137   "|%diff{passing $ to parameter of type $|"
5138   "passing to parameter of different type}0,1"
5139   "|%diff{returning $ from a function with result type $|"
5140   "returning from function with different return type}0,1"
5141   "|%diff{converting $ to type $|converting between types}0,1"
5142   "|%diff{initializing $ with an expression of type $|"
5143   "initializing with expression of different type}0,1"
5144   "|%diff{sending $ to parameter of type $|"
5145   "sending to parameter of different type}0,1"
5146   "|%diff{casting $ to type $|casting between types}0,1}2">,
5147   InGroup<VectorConversion>, DefaultIgnore;
5148 def err_int_to_block_pointer : Error<
5149   "invalid block pointer conversion "
5150   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
5151   "|%diff{passing $ to parameter of type $|"
5152   "passing to parameter of different type}0,1"
5153   "|%diff{returning $ from a function with result type $|"
5154   "returning from function with different return type}0,1"
5155   "|%diff{converting $ to type $|converting between types}0,1"
5156   "|%diff{initializing $ with an expression of type $|"
5157   "initializing with expression of different type}0,1"
5158   "|%diff{sending $ to parameter of type $|"
5159   "sending to parameter of different type}0,1"
5160   "|%diff{casting $ to type $|casting between types}0,1}2">;
5161 def err_typecheck_convert_incompatible_block_pointer : Error<
5162   "incompatible block pointer types "
5163   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
5164   "|%diff{passing $ to parameter of type $|"
5165   "passing to parameter of different type}0,1"
5166   "|%diff{returning $ from a function with result type $|"
5167   "returning from function with different return type}0,1"
5168   "|%diff{converting $ to type $|converting between types}0,1"
5169   "|%diff{initializing $ with an expression of type $|"
5170   "initializing with expression of different type}0,1"
5171   "|%diff{sending $ to parameter of type $|"
5172   "sending to parameter of different type}0,1"
5173   "|%diff{casting $ to type $|casting between types}0,1}2">;
5174 def err_typecheck_incompatible_address_space : Error<
5175   "%select{%diff{assigning $ to $|assigning to different types}1,0"
5176   "|%diff{passing $ to parameter of type $|"
5177   "passing to parameter of different type}0,1"
5178   "|%diff{returning $ from a function with result type $|"
5179   "returning from function with different return type}0,1"
5180   "|%diff{converting $ to type $|converting between types}0,1"
5181   "|%diff{initializing $ with an expression of type $|"
5182   "initializing with expression of different type}0,1"
5183   "|%diff{sending $ to parameter of type $|"
5184   "sending to parameter of different type}0,1"
5185   "|%diff{casting $ to type $|casting between types}0,1}2"
5186   " changes address space of pointer">;
5187 def err_typecheck_incompatible_ownership : Error<
5188   "%select{%diff{assigning $ to $|assigning to different types}1,0"
5189   "|%diff{passing $ to parameter of type $|"
5190   "passing to parameter of different type}0,1"
5191   "|%diff{returning $ from a function with result type $|"
5192   "returning from function with different return type}0,1"
5193   "|%diff{converting $ to type $|converting between types}0,1"
5194   "|%diff{initializing $ with an expression of type $|"
5195   "initializing with expression of different type}0,1"
5196   "|%diff{sending $ to parameter of type $|"
5197   "sending to parameter of different type}0,1"
5198   "|%diff{casting $ to type $|casting between types}0,1}2"
5199   " changes retain/release properties of pointer">;
5200 def err_typecheck_comparison_of_distinct_blocks : Error<
5201   "comparison of distinct block types%diff{ ($ and $)|}0,1">;
5202
5203 def err_typecheck_array_not_modifiable_lvalue : Error<
5204   "array type %0 is not assignable">;
5205 def err_typecheck_non_object_not_modifiable_lvalue : Error<
5206   "non-object type %0 is not assignable">;
5207 def err_typecheck_expression_not_modifiable_lvalue : Error<
5208   "expression is not assignable">;
5209 def err_typecheck_incomplete_type_not_modifiable_lvalue : Error<
5210   "incomplete type %0 is not assignable">;
5211 def err_typecheck_lvalue_casts_not_supported : Error<
5212   "assignment to cast is illegal, lvalue casts are not supported">;
5213
5214 def err_typecheck_duplicate_vector_components_not_mlvalue : Error<
5215   "vector is not assignable (contains duplicate components)">;
5216 def err_block_decl_ref_not_modifiable_lvalue : Error<
5217   "variable is not assignable (missing __block type specifier)">;
5218 def err_lambda_decl_ref_not_modifiable_lvalue : Error<
5219   "cannot assign to a variable captured by copy in a non-mutable lambda">;
5220 def err_typecheck_call_not_function : Error<
5221   "called object type %0 is not a function or function pointer">;
5222 def err_call_incomplete_return : Error<
5223   "calling function with incomplete return type %0">;
5224 def err_call_function_incomplete_return : Error<
5225   "calling %0 with incomplete return type %1">;
5226 def note_function_with_incomplete_return_type_declared_here : Note<
5227   "%0 declared here">;
5228 def err_call_incomplete_argument : Error<
5229   "argument type %0 is incomplete">;
5230 def err_typecheck_call_too_few_args : Error<
5231   "too few %select{|||execution configuration }0arguments to "
5232   "%select{function|block|method|kernel function}0 call, "
5233   "expected %1, have %2">;
5234 def err_typecheck_call_too_few_args_one : Error<
5235   "too few %select{|||execution configuration }0arguments to "
5236   "%select{function|block|method|kernel function}0 call, "
5237   "single argument %1 was not specified">;
5238 def err_typecheck_call_too_few_args_at_least : Error<
5239   "too few %select{|||execution configuration }0arguments to "
5240   "%select{function|block|method|kernel function}0 call, "
5241   "expected at least %1, have %2">;
5242 def err_typecheck_call_too_few_args_at_least_one : Error<
5243   "too few %select{|||execution configuration }0arguments to "
5244   "%select{function|block|method|kernel function}0 call, "
5245   "at least argument %1 must be specified">;
5246 def err_typecheck_call_too_many_args : Error<
5247   "too many %select{|||execution configuration }0arguments to "
5248   "%select{function|block|method|kernel function}0 call, "
5249   "expected %1, have %2">;
5250 def err_typecheck_call_too_many_args_one : Error<
5251   "too many %select{|||execution configuration }0arguments to "
5252   "%select{function|block|method|kernel function}0 call, "
5253   "expected single argument %1, have %2 arguments">;
5254 def err_typecheck_call_too_many_args_at_most : Error<
5255   "too many %select{|||execution configuration }0arguments to "
5256   "%select{function|block|method|kernel function}0 call, "
5257   "expected at most %1, have %2">;
5258 def err_typecheck_call_too_many_args_at_most_one : Error<
5259   "too many %select{|||execution configuration }0arguments to "
5260   "%select{function|block|method|kernel function}0 call, "
5261   "expected at most single argument %1, have %2 arguments">;
5262 def note_callee_decl : Note<
5263   "%0 declared here">;
5264 def note_defined_here : Note<"%0 defined here">;
5265
5266 def err_builtin_fn_use : Error<"builtin functions must be directly called">;
5267
5268 def warn_call_wrong_number_of_arguments : Warning<
5269   "too %select{few|many}0 arguments in call to %1">;
5270 def err_atomic_builtin_must_be_pointer : Error<
5271   "first argument to atomic builtin must be a pointer (%0 invalid)">;
5272 def err_atomic_builtin_must_be_pointer_intptr : Error<
5273   "first argument to atomic builtin must be a pointer to integer or pointer"
5274   " (%0 invalid)">;
5275 def err_atomic_builtin_pointer_size : Error<
5276   "first argument to atomic builtin must be a pointer to 1,2,4,8 or 16 byte "
5277   "type (%0 invalid)">;
5278 def err_atomic_op_needs_atomic : Error<
5279   "first argument to atomic operation must be a pointer to _Atomic "
5280   "type (%0 invalid)">;
5281 def err_atomic_op_needs_non_const_atomic : Error<
5282   "first argument to atomic operation must be a pointer to non-const _Atomic "
5283   "type (%0 invalid)">;
5284 def err_atomic_op_needs_trivial_copy : Error<
5285   "first argument to atomic operation must be a pointer to a trivially-copyable"
5286   " type (%0 invalid)">;
5287 def err_atomic_op_needs_atomic_int_or_ptr : Error<
5288   "first argument to atomic operation must be a pointer to %select{|atomic }0"
5289   "integer or pointer (%1 invalid)">;
5290 def err_atomic_op_bitwise_needs_atomic_int : Error<
5291   "first argument to bitwise atomic operation must be a pointer to "
5292   "%select{|atomic }0integer (%1 invalid)">;
5293
5294 def err_deleted_function_use : Error<"attempt to use a deleted function">;
5295
5296 def err_kern_type_not_void_return : Error<
5297   "kernel function type %0 must have void return type">;
5298 def err_config_scalar_return : Error<
5299   "CUDA special function 'cudaConfigureCall' must have scalar return type">;
5300 def err_kern_call_not_global_function : Error<
5301   "kernel call to non-global function %0">;
5302 def err_global_call_not_config : Error<
5303   "call to global function %0 not configured">;
5304 def err_ref_bad_target : Error<
5305   "reference to %select{__device__|__global__|__host__|__host__ __device__}0 "
5306   "function %1 in %select{__device__|__global__|__host__|__host__ __device__}2 function">;
5307
5308 def warn_non_pod_vararg_with_format_string : Warning<
5309   "cannot pass %select{non-POD|non-trivial}0 object of type %1 to variadic "
5310   "%select{function|block|method|constructor}2; expected type from format "
5311   "string was %3">, InGroup<NonPODVarargs>, DefaultError;
5312 // The arguments to this diagnostic should match the warning above.
5313 def err_cannot_pass_objc_interface_to_vararg_format : Error<
5314   "cannot pass object with interface type %1 by value to variadic "
5315   "%select{function|block|method|constructor}2; expected type from format "
5316   "string was %3">;
5317
5318 def err_cannot_pass_objc_interface_to_vararg : Error<
5319   "cannot pass object with interface type %0 by value through variadic "
5320   "%select{function|block|method|constructor}1">;
5321 def warn_cannot_pass_non_pod_arg_to_vararg : Warning<
5322   "cannot pass object of %select{non-POD|non-trivial}0 type %1 through variadic"
5323   " %select{function|block|method|constructor}2; call will abort at runtime">,
5324   InGroup<NonPODVarargs>, DefaultError;
5325 def warn_cxx98_compat_pass_non_pod_arg_to_vararg : Warning<
5326   "passing object of trivial but non-POD type %0 through variadic"
5327   " %select{function|block|method|constructor}1 is incompatible with C++98">,
5328   InGroup<CXX98Compat>, DefaultIgnore;
5329
5330 def err_typecheck_call_invalid_ordered_compare : Error<
5331   "ordered compare requires two args of floating point type"
5332   "%diff{ ($ and $)|}0,1">;
5333 def err_typecheck_call_invalid_unary_fp : Error<
5334   "floating point classification requires argument of floating point type "
5335   "(passed in %0)">;
5336 def err_typecheck_cond_expect_scalar : Error<
5337   "used type %0 where arithmetic or pointer type is required">;
5338 def ext_typecheck_cond_one_void : Extension<
5339   "C99 forbids conditional expressions with only one void side">;
5340 def err_typecheck_cond_expect_scalar_or_vector : Error<
5341   "used type %0 where arithmetic, pointer, or vector type is required">;
5342 def err_typecheck_cast_to_incomplete : Error<
5343   "cast to incomplete type %0">;
5344 def ext_typecheck_cast_nonscalar : Extension<
5345   "C99 forbids casting nonscalar type %0 to the same type">;
5346 def ext_typecheck_cast_to_union : Extension<
5347   "cast to union type is a GNU extension">,
5348   InGroup<GNU>;
5349 def err_typecheck_cast_to_union_no_type : Error<
5350   "cast to union type from type %0 not present in union">;
5351 def err_cast_pointer_from_non_pointer_int : Error<
5352   "operand of type %0 cannot be cast to a pointer type">;
5353 def warn_cast_pointer_from_sel : Warning<
5354   "cast of type %0 to %1 is deprecated; use sel_getName instead">,
5355   InGroup<SelTypeCast>;
5356 def warn_bad_function_cast : Warning<
5357   "cast from function call of type %0 to non-matching type %1">,
5358   InGroup<BadFunctionCast>, DefaultIgnore;
5359 def err_cast_pointer_to_non_pointer_int : Error<
5360   "pointer cannot be cast to type %0">;
5361 def err_typecheck_expect_scalar_operand : Error<
5362   "operand of type %0 where arithmetic or pointer type is required">;
5363 def err_typecheck_cond_incompatible_operands : Error<
5364   "incompatible operand types%diff{ ($ and $)|}0,1">;
5365 def ext_typecheck_cond_incompatible_operands_nonstandard : ExtWarn<
5366   "incompatible operand types%diff{ ($ and $)|}0,1 use non-standard composite "
5367   "pointer type %2">;
5368 def err_cast_selector_expr : Error<
5369   "cannot type cast @selector expression">;
5370 def warn_typecheck_cond_incompatible_pointers : ExtWarn<
5371   "pointer type mismatch%diff{ ($ and $)|}0,1">,
5372   InGroup<DiagGroup<"pointer-type-mismatch">>;
5373 def warn_typecheck_cond_pointer_integer_mismatch : ExtWarn<
5374   "pointer/integer type mismatch in conditional expression"
5375   "%diff{ ($ and $)|}0,1">,
5376   InGroup<DiagGroup<"conditional-type-mismatch">>;
5377 def err_typecheck_choose_expr_requires_constant : Error<
5378   "'__builtin_choose_expr' requires a constant expression">;
5379 def warn_unused_expr : Warning<"expression result unused">,
5380   InGroup<UnusedValue>;
5381 def warn_unused_voidptr : Warning<
5382   "expression result unused; should this cast be to 'void'?">,
5383   InGroup<UnusedValue>;
5384 def warn_unused_property_expr : Warning<
5385  "property access result unused - getters should not be used for side effects">,
5386   InGroup<UnusedValue>;
5387 def warn_unused_container_subscript_expr : Warning<
5388  "container access result unused - container access should not be used for side effects">,
5389   InGroup<UnusedValue>;
5390 def warn_unused_call : Warning<
5391   "ignoring return value of function declared with %0 attribute">,
5392   InGroup<UnusedValue>;
5393 def warn_unused_result : Warning<
5394   "ignoring return value of function declared with warn_unused_result "
5395   "attribute">, InGroup<DiagGroup<"unused-result">>;
5396 def warn_unused_volatile : Warning<
5397   "expression result unused; assign into a variable to force a volatile load">,
5398   InGroup<DiagGroup<"unused-volatile-lvalue">>;
5399
5400 def warn_unused_comparison : Warning<
5401   "%select{equality|inequality}0 comparison result unused">,
5402   InGroup<UnusedComparison>;
5403 def note_inequality_comparison_to_or_assign : Note<
5404   "use '|=' to turn this inequality comparison into an or-assignment">;
5405
5406 def err_incomplete_type_used_in_type_trait_expr : Error<
5407   "incomplete type %0 used in type trait expression">;
5408 def err_type_trait_arity : Error<
5409   "type trait requires %0%select{| or more}1 argument%select{|s}2; have "
5410   "%3 argument%s3">;
5411   
5412 def err_dimension_expr_not_constant_integer : Error<
5413   "dimension expression does not evaluate to a constant unsigned int">;
5414 def err_expected_ident_or_lparen : Error<"expected identifier or '('">;
5415
5416 def err_typecheck_cond_incompatible_operands_null : Error<
5417   "non-pointer operand type %0 incompatible with %select{NULL|nullptr}1">;
5418 } // End of general sema category.
5419
5420 // inline asm.
5421 let CategoryName = "Inline Assembly Issue" in {
5422   def err_asm_wide_character : Error<"wide string is invalid in 'asm'">;
5423   def err_asm_invalid_lvalue_in_output : Error<"invalid lvalue in asm output">;
5424   def err_asm_invalid_output_constraint : Error<
5425     "invalid output constraint '%0' in asm">;
5426   def err_asm_invalid_lvalue_in_input : Error<
5427     "invalid lvalue in asm input for constraint '%0'">;
5428   def err_asm_invalid_input_constraint : Error<
5429     "invalid input constraint '%0' in asm">;
5430   def err_asm_invalid_type_in_input : Error<
5431     "invalid type %0 in asm input for constraint '%1'">;
5432   def err_asm_tying_incompatible_types : Error<
5433     "unsupported inline asm: input with type "
5434     "%diff{$ matching output with type $|}0,1">;
5435   def err_asm_incomplete_type : Error<"asm operand has incomplete type %0">;
5436   def err_asm_unknown_register_name : Error<"unknown register name '%0' in asm">;
5437   def err_asm_invalid_input_size : Error<
5438     "invalid input size for constraint '%0'">;
5439   def err_invalid_asm_cast_lvalue : Error<
5440     "invalid use of a cast in a inline asm context requiring an l-value: "
5441     "remove the cast or build with -fheinous-gnu-extensions">;
5442
5443   def warn_asm_label_on_auto_decl : Warning<
5444     "ignored asm label '%0' on automatic variable">;
5445   def warn_invalid_asm_cast_lvalue : Warning<
5446     "invalid use of a cast in an inline asm context requiring an l-value: "
5447     "accepted due to -fheinous-gnu-extensions, but clang may remove support "
5448     "for this in the future">;
5449   def warn_asm_mismatched_size_modifier : Warning<
5450     "the value is truncated when put into register, "
5451     "use a modifier to specify the size">,
5452     InGroup<ASMOperandWidths>;
5453 }
5454
5455 let CategoryName = "Semantic Issue" in {
5456
5457 def err_invalid_conversion_between_vectors : Error<
5458   "invalid conversion between vector type%diff{ $ and $|}0,1 of different "
5459   "size">;
5460 def err_invalid_conversion_between_vector_and_integer : Error<
5461   "invalid conversion between vector type %0 and integer type %1 "
5462   "of different size">;
5463
5464 def err_invalid_conversion_between_vector_and_scalar : Error<
5465   "invalid conversion between vector type %0 and scalar type %1">;
5466
5467 // C++ member initializers.
5468 def err_only_constructors_take_base_inits : Error<
5469   "only constructors take base initializers">;
5470
5471 def err_multiple_mem_initialization : Error <
5472   "multiple initializations given for non-static member %0">;
5473 def err_multiple_mem_union_initialization : Error <
5474   "initializing multiple members of union">;
5475 def err_multiple_base_initialization : Error <
5476   "multiple initializations given for base %0">;
5477
5478 def err_mem_init_not_member_or_class : Error<
5479   "member initializer %0 does not name a non-static data member or base "
5480   "class">;
5481
5482 def warn_initializer_out_of_order : Warning<
5483   "%select{field|base class}0 %1 will be initialized after "
5484   "%select{field|base}2 %3">,
5485   InGroup<Reorder>, DefaultIgnore;
5486
5487 def err_base_init_does_not_name_class : Error<
5488   "constructor initializer %0 does not name a class">;
5489 def err_base_init_direct_and_virtual : Error<
5490   "base class initializer %0 names both a direct base class and an "
5491   "inherited virtual base class">;
5492 def err_not_direct_base_or_virtual : Error<
5493   "type %0 is not a direct or virtual base of %1">;
5494
5495 def err_in_class_initializer_non_const : Error<
5496   "non-const static data member must be initialized out of line">;
5497 def err_in_class_initializer_volatile : Error<
5498   "static const volatile data member must be initialized out of line">;
5499 def err_in_class_initializer_bad_type : Error<
5500   "static data member of type %0 must be initialized out of line">;
5501 def ext_in_class_initializer_float_type : ExtWarn<
5502   "in-class initializer for static data member of type %0 is a GNU extension">,
5503   InGroup<GNUStaticFloatInit>;
5504 def ext_in_class_initializer_float_type_cxx11 : ExtWarn<
5505   "in-class initializer for static data member of type %0 requires "
5506   "'constexpr' specifier">, InGroup<StaticFloatInit>, DefaultError;
5507 def note_in_class_initializer_float_type_cxx11 : Note<"add 'constexpr'">;
5508 def err_in_class_initializer_literal_type : Error<
5509   "in-class initializer for static data member of type %0 requires "
5510   "'constexpr' specifier">;
5511 def err_in_class_initializer_non_constant : Error<
5512   "in-class initializer for static data member is not a constant expression">;
5513 def err_in_class_initializer_references_def_ctor : Error<
5514   "defaulted default constructor of %0 cannot be used by non-static data "
5515   "member initializer which appears before end of class definition">;
5516
5517 def ext_in_class_initializer_non_constant : Extension<
5518   "in-class initializer for static data member is not a constant expression; "
5519   "folding it to a constant is a GNU extension">, InGroup<GNU>;
5520
5521 def err_thread_dynamic_init : Error<
5522   "initializer for thread-local variable must be a constant expression">;
5523 def err_thread_nontrivial_dtor : Error<
5524   "type of thread-local variable has non-trivial destruction">;
5525 def note_use_thread_local : Note<
5526   "use 'thread_local' to allow this">;
5527
5528 // C++ anonymous unions and GNU anonymous structs/unions
5529 def ext_anonymous_union : Extension<
5530   "anonymous unions are a C11 extension">, InGroup<C11>;
5531 def ext_gnu_anonymous_struct : Extension<
5532   "anonymous structs are a GNU extension">, InGroup<GNU>;
5533 def ext_c11_anonymous_struct : Extension<
5534   "anonymous structs are a C11 extension">, InGroup<C11>;
5535 def err_anonymous_union_not_static : Error<
5536   "anonymous unions at namespace or global scope must be declared 'static'">;
5537 def err_anonymous_union_with_storage_spec : Error<
5538   "anonymous union at class scope must not have a storage specifier">;
5539 def err_anonymous_struct_not_member : Error<
5540   "anonymous %select{structs|structs and classes}0 must be "
5541   "%select{struct or union|class}0 members">;
5542 def err_anonymous_union_member_redecl : Error<
5543   "member of anonymous union redeclares %0">;
5544 def err_anonymous_struct_member_redecl : Error<
5545   "member of anonymous struct redeclares %0">;
5546 def err_anonymous_record_with_type : Error<
5547   "types cannot be declared in an anonymous %select{struct|union}0">;
5548 def ext_anonymous_record_with_type : Extension<
5549   "types declared in an anonymous %select{struct|union}0 are a Microsoft "
5550   "extension">, InGroup<Microsoft>;
5551 def ext_anonymous_record_with_anonymous_type : Extension<
5552   "anonymous types declared in an anonymous %select{struct|union}0 "
5553   "are an extension">, InGroup<DiagGroup<"nested-anon-types">>;
5554 def err_anonymous_record_with_function : Error<
5555   "functions cannot be declared in an anonymous %select{struct|union}0">;
5556 def err_anonymous_record_with_static : Error<
5557   "static members cannot be declared in an anonymous %select{struct|union}0">;
5558 def err_anonymous_record_bad_member : Error<
5559   "anonymous %select{struct|union}0 can only contain non-static data members">;
5560 def err_anonymous_record_nonpublic_member : Error<
5561   "anonymous %select{struct|union}0 cannot contain a "
5562   "%select{private|protected}1 data member">;
5563 def ext_ms_anonymous_struct : ExtWarn<
5564   "anonymous structs are a Microsoft extension">, InGroup<Microsoft>;
5565
5566 // C++ local classes
5567 def err_reference_to_local_var_in_enclosing_function : Error<
5568   "reference to local variable %0 declared in enclosing function %1">;
5569 def err_reference_to_local_var_in_enclosing_block : Error<
5570   "reference to local variable %0 declared in enclosing block literal">;
5571 def err_reference_to_local_var_in_enclosing_lambda : Error<
5572   "reference to local variable %0 declared in enclosing lambda expression">;
5573 def err_reference_to_local_var_in_enclosing_context : Error<
5574   "reference to local variable %0 declared in enclosing context">;
5575
5576 def note_local_variable_declared_here : Note<
5577   "%0 declared here">;
5578 def err_static_data_member_not_allowed_in_local_class : Error<
5579   "static data member %0 not allowed in local class %1">; 
5580   
5581 // C++ derived classes
5582 def err_base_clause_on_union : Error<"unions cannot have base classes">;
5583 def err_base_must_be_class : Error<"base specifier must name a class">;
5584 def err_union_as_base_class : Error<"unions cannot be base classes">;
5585 def err_circular_inheritance : Error<
5586   "circular inheritance between %0 and %1">;
5587 def err_incomplete_base_class : Error<"base class has incomplete type">;
5588 def err_duplicate_base_class : Error<
5589   "base class %0 specified more than once as a direct base class">;
5590 // FIXME: better way to display derivation?  Pass entire thing into diagclient?
5591 def err_ambiguous_derived_to_base_conv : Error<
5592   "ambiguous conversion from derived class %0 to base class %1:%2">;
5593 def err_ambiguous_memptr_conv : Error<
5594   "ambiguous conversion from pointer to member of %select{base|derived}0 "
5595   "class %1 to pointer to member of %select{derived|base}0 class %2:%3">;
5596
5597 def err_memptr_conv_via_virtual : Error<
5598   "conversion from pointer to member of class %0 to pointer to member "
5599   "of class %1 via virtual base %2 is not allowed">;
5600
5601 // C++ member name lookup
5602 def err_ambiguous_member_multiple_subobjects : Error<
5603   "non-static member %0 found in multiple base-class subobjects of type %1:%2">;
5604 def err_ambiguous_member_multiple_subobject_types : Error<
5605   "member %0 found in multiple base classes of different types">;
5606 def note_ambiguous_member_found : Note<"member found by ambiguous name lookup">;
5607 def err_ambiguous_reference : Error<"reference to %0 is ambiguous">;
5608 def note_ambiguous_candidate : Note<"candidate found by name lookup is %q0">;
5609 def err_ambiguous_tag_hiding : Error<"a type named %0 is hidden by a "
5610   "declaration in a different namespace">;
5611 def note_hidden_tag : Note<"type declaration hidden">;
5612 def note_hiding_object : Note<"declaration hides type">;
5613
5614 // C++ operator overloading
5615 def err_operator_overload_needs_class_or_enum : Error<
5616   "overloaded %0 must have at least one parameter of class "
5617   "or enumeration type">;
5618
5619 def err_operator_overload_variadic : Error<"overloaded %0 cannot be variadic">;
5620 def err_operator_overload_static : Error<
5621   "overloaded %0 cannot be a static member function">;
5622 def err_operator_overload_default_arg : Error<
5623   "parameter of overloaded %0 cannot have a default argument">;
5624 def err_operator_overload_must_be : Error<
5625   "overloaded %0 must be a %select{unary|binary|unary or binary}2 operator "
5626   "(has %1 parameter%s1)">;
5627
5628 def err_operator_overload_must_be_member : Error<
5629   "overloaded %0 must be a non-static member function">;
5630 def err_operator_overload_post_incdec_must_be_int : Error<
5631   "parameter of overloaded post-%select{increment|decrement}1 operator must "
5632   "have type 'int' (not %0)">;
5633
5634 // C++ allocation and deallocation functions.
5635 def err_operator_new_delete_declared_in_namespace : Error<
5636   "%0 cannot be declared inside a namespace">;
5637 def err_operator_new_delete_declared_static : Error<
5638   "%0 cannot be declared static in global scope">;
5639 def err_operator_new_delete_invalid_result_type : Error<
5640   "%0 must return type %1">;
5641 def err_operator_new_delete_dependent_result_type : Error<
5642   "%0 cannot have a dependent return type; use %1 instead">;
5643 def err_operator_new_delete_too_few_parameters : Error<
5644   "%0 must have at least one parameter">;
5645 def err_operator_new_delete_template_too_few_parameters : Error<
5646   "%0 template must have at least two parameters">;
5647
5648 def err_operator_new_dependent_param_type : Error<
5649   "%0 cannot take a dependent type as first parameter; "
5650   "use size_t (%1) instead">;
5651 def err_operator_new_param_type : Error<
5652   "%0 takes type size_t (%1) as first parameter">;
5653 def err_operator_new_default_arg: Error<
5654   "parameter of %0 cannot have a default argument">;
5655 def err_operator_delete_dependent_param_type : Error<
5656   "%0 cannot take a dependent type as first parameter; use %1 instead">;
5657 def err_operator_delete_param_type : Error<
5658   "first parameter of %0 must have type %1">;
5659
5660 // C++ literal operators
5661 def err_literal_operator_outside_namespace : Error<
5662   "literal operator %0 must be in a namespace or global scope">;
5663 def err_literal_operator_default_argument : Error<
5664   "literal operator cannot have a default argument">;
5665 // FIXME: This diagnostic sucks
5666 def err_literal_operator_params : Error<
5667   "parameter declaration for literal operator %0 is not valid">;
5668 def err_literal_operator_extern_c : Error<
5669   "literal operator must have C++ linkage">;
5670 def warn_user_literal_reserved : Warning<
5671   "user-defined literal suffixes not starting with '_' are reserved; "
5672   "no literal will invoke this operator">,
5673   InGroup<UserDefinedLiterals>;
5674
5675 // C++ conversion functions
5676 def err_conv_function_not_member : Error<
5677   "conversion function must be a non-static member function">;
5678 def err_conv_function_return_type : Error<
5679   "conversion function cannot have a return type">;
5680 def err_conv_function_with_params : Error<
5681   "conversion function cannot have any parameters">;
5682 def err_conv_function_variadic : Error<
5683   "conversion function cannot be variadic">;
5684 def err_conv_function_to_array : Error<
5685   "conversion function cannot convert to an array type">;
5686 def err_conv_function_to_function : Error<
5687   "conversion function cannot convert to a function type">;
5688 def err_conv_function_with_complex_decl : Error<
5689   "must use a typedef to declare a conversion to %0">;
5690 def err_conv_function_redeclared : Error<
5691   "conversion function cannot be redeclared">;
5692 def warn_conv_to_self_not_used : Warning<
5693   "conversion function converting %0 to itself will never be used">;
5694 def warn_conv_to_base_not_used : Warning<
5695   "conversion function converting %0 to its base class %1 will never be used">;
5696 def warn_conv_to_void_not_used : Warning<
5697   "conversion function converting %0 to %1 will never be used">;
5698
5699 def warn_not_compound_assign : Warning<
5700   "use of unary operator that may be intended as compound assignment (%0=)">;
5701
5702 // C++11 explicit conversion operators
5703 def ext_explicit_conversion_functions : ExtWarn<
5704   "explicit conversion functions are a C++11 extension">, InGroup<CXX11>;
5705 def warn_cxx98_compat_explicit_conversion_functions : Warning<
5706   "explicit conversion functions are incompatible with C++98">,
5707   InGroup<CXX98Compat>, DefaultIgnore;
5708
5709 // C++11 defaulted functions
5710 def err_defaulted_special_member_params : Error<
5711   "an explicitly-defaulted %select{|copy |move }0constructor cannot "
5712   "have default arguments">;
5713 def err_defaulted_special_member_variadic : Error<
5714   "an explicitly-defaulted %select{|copy |move }0constructor cannot "
5715   "be variadic">;
5716 def err_defaulted_special_member_return_type : Error<
5717   "explicitly-defaulted %select{copy|move}0 assignment operator must "
5718   "return %1">;
5719 def err_defaulted_special_member_quals : Error<
5720   "an explicitly-defaulted %select{copy|move}0 assignment operator may not "
5721   "have 'const', 'constexpr' or 'volatile' qualifiers">;
5722 def err_defaulted_special_member_volatile_param : Error<
5723   "the parameter for an explicitly-defaulted %select{<<ERROR>>|"
5724   "copy constructor|move constructor|copy assignment operator|"
5725   "move assignment operator|<<ERROR>>}0 may not be volatile">;
5726 def err_defaulted_special_member_move_const_param : Error<
5727   "the parameter for an explicitly-defaulted move "
5728   "%select{constructor|assignment operator}0 may not be const">;
5729 def err_defaulted_special_member_copy_const_param : Error<
5730   "the parameter for this explicitly-defaulted copy "
5731   "%select{constructor|assignment operator}0 is const, but a member or base "
5732   "requires it to be non-const">;
5733 def err_defaulted_copy_assign_not_ref : Error<
5734   "the parameter for an explicitly-defaulted copy assignment operator must be an "
5735   "lvalue reference type">;
5736 def err_incorrect_defaulted_exception_spec : Error<
5737   "exception specification of explicitly defaulted %select{default constructor|"
5738   "copy constructor|move constructor|copy assignment operator|move assignment "
5739   "operator|destructor}0 does not match the "
5740   "calculated one">;
5741 def err_incorrect_defaulted_constexpr : Error<
5742   "defaulted definition of %select{default constructor|copy constructor|"
5743   "move constructor}0 is not constexpr">;
5744 def err_out_of_line_default_deletes : Error<
5745   "defaulting this %select{default constructor|copy constructor|move "
5746   "constructor|copy assignment operator|move assignment operator|destructor}0 "
5747   "would delete it after its first declaration">;
5748 def ext_implicit_exception_spec_mismatch : ExtWarn<
5749   "function previously declared with an %select{explicit|implicit}0 exception "
5750   "specification redeclared with an %select{implicit|explicit}0 exception "
5751   "specification">, InGroup<DiagGroup<"implicit-exception-spec-mismatch">>;
5752
5753 def warn_ptr_arith_precedes_bounds : Warning<
5754   "the pointer decremented by %0 refers before the beginning of the array">,
5755   InGroup<ArrayBoundsPointerArithmetic>, DefaultIgnore;
5756 def warn_ptr_arith_exceeds_bounds : Warning<
5757   "the pointer incremented by %0 refers past the end of the array (that "
5758   "contains %1 element%s2)">,
5759   InGroup<ArrayBoundsPointerArithmetic>, DefaultIgnore;
5760 def warn_array_index_precedes_bounds : Warning<
5761   "array index %0 is before the beginning of the array">,
5762   InGroup<ArrayBounds>;
5763 def warn_array_index_exceeds_bounds : Warning<
5764   "array index %0 is past the end of the array (which contains %1 "
5765   "element%s2)">, InGroup<ArrayBounds>;
5766 def note_array_index_out_of_bounds : Note<
5767   "array %0 declared here">;
5768
5769 def warn_printf_insufficient_data_args : Warning<
5770   "more '%%' conversions than data arguments">, InGroup<Format>;
5771 def warn_printf_data_arg_not_used : Warning<
5772   "data argument not used by format string">, InGroup<FormatExtraArgs>;
5773 def warn_format_invalid_conversion : Warning<
5774   "invalid conversion specifier '%0'">, InGroup<FormatInvalidSpecifier>;
5775 def warn_printf_incomplete_specifier : Warning<
5776   "incomplete format specifier">, InGroup<Format>;
5777 def warn_missing_format_string : Warning<
5778   "format string missing">, InGroup<Format>;
5779 def warn_scanf_nonzero_width : Warning<
5780   "zero field width in scanf format string is unused">,
5781   InGroup<Format>;
5782 def warn_printf_conversion_argument_type_mismatch : Warning<
5783   "format specifies type %0 but the argument has type %1">,
5784   InGroup<Format>;
5785 def warn_format_argument_needs_cast : Warning<
5786   "values of type '%0' should not be used as format arguments; add an explicit "
5787   "cast to %1 instead">,
5788   InGroup<Format>;
5789 def warn_printf_positional_arg_exceeds_data_args : Warning <
5790   "data argument position '%0' exceeds the number of data arguments (%1)">,
5791   InGroup<Format>;
5792 def warn_format_zero_positional_specifier : Warning<
5793   "position arguments in format strings start counting at 1 (not 0)">,
5794   InGroup<Format>;
5795 def warn_format_invalid_positional_specifier : Warning<
5796   "invalid position specified for %select{field width|field precision}0">,
5797   InGroup<Format>;
5798 def warn_format_mix_positional_nonpositional_args : Warning<
5799   "cannot mix positional and non-positional arguments in format string">,
5800   InGroup<Format>;
5801 def warn_static_array_too_small : Warning<
5802   "array argument is too small; contains %0 elements, callee requires at least %1">,
5803   InGroup<ArrayBounds>;
5804 def note_callee_static_array : Note<
5805   "callee declares array parameter as static here">;
5806 def warn_empty_format_string : Warning<
5807   "format string is empty">, InGroup<FormatZeroLength>;
5808 def warn_format_string_is_wide_literal : Warning<
5809   "format string should not be a wide string">, InGroup<Format>;
5810 def warn_printf_format_string_contains_null_char : Warning<
5811   "format string contains '\\0' within the string body">, InGroup<Format>;
5812 def warn_printf_asterisk_missing_arg : Warning<
5813   "'%select{*|.*}0' specified field %select{width|precision}0 is missing a matching 'int' argument">,
5814   InGroup<Format>;
5815 def warn_printf_asterisk_wrong_type : Warning<
5816   "field %select{width|precision}0 should have type %1, but argument has type %2">,
5817   InGroup<Format>;
5818 def warn_printf_nonsensical_optional_amount: Warning<
5819   "%select{field width|precision}0 used with '%1' conversion specifier, resulting in undefined behavior">,
5820   InGroup<Format>;
5821 def warn_printf_nonsensical_flag: Warning<
5822   "flag '%0' results in undefined behavior with '%1' conversion specifier">,
5823   InGroup<Format>;
5824 def warn_format_nonsensical_length: Warning<
5825   "length modifier '%0' results in undefined behavior or no effect with '%1' conversion specifier">,
5826   InGroup<Format>;
5827 def warn_format_non_standard_positional_arg: ExtWarn<
5828   "positional arguments are not supported by ISO C">, InGroup<FormatNonStandard>, DefaultIgnore;
5829 def warn_format_non_standard: ExtWarn<
5830   "'%0' %select{length modifier|conversion specifier}1 is not supported by ISO C">,
5831   InGroup<FormatNonStandard>, DefaultIgnore;
5832 def warn_format_non_standard_conversion_spec: ExtWarn<
5833   "using length modifier '%0' with conversion specifier '%1' is not supported by ISO C">,
5834   InGroup<FormatNonStandard>, DefaultIgnore;
5835 def warn_printf_ignored_flag: Warning<
5836   "flag '%0' is ignored when flag '%1' is present">,
5837   InGroup<Format>;
5838 def warn_scanf_scanlist_incomplete : Warning<
5839   "no closing ']' for '%%[' in scanf format string">,
5840   InGroup<Format>;
5841 def note_format_string_defined : Note<"format string is defined here">;
5842 def note_format_fix_specifier : Note<"did you mean to use '%0'?">;
5843 def note_printf_c_str: Note<"did you mean to call the %0 method?">;
5844
5845 def warn_null_arg : Warning<
5846   "null passed to a callee which requires a non-null argument">,
5847   InGroup<NonNull>;
5848
5849 // CHECK: returning address/reference of stack memory
5850 def warn_ret_stack_addr : Warning<
5851   "address of stack memory associated with local variable %0 returned">,
5852   InGroup<ReturnStackAddress>;
5853 def warn_ret_stack_ref : Warning<
5854   "reference to stack memory associated with local variable %0 returned">,
5855   InGroup<ReturnStackAddress>;
5856 def warn_ret_local_temp_addr : Warning<
5857   "returning address of local temporary object">,
5858   InGroup<ReturnStackAddress>;
5859 def warn_ret_local_temp_ref : Warning<
5860   "returning reference to local temporary object">,
5861   InGroup<ReturnStackAddress>;
5862 def warn_ret_addr_label : Warning<
5863   "returning address of label, which is local">,
5864   InGroup<ReturnStackAddress>;
5865 def err_ret_local_block : Error<
5866   "returning block that lives on the local stack">;
5867 def note_ref_var_local_bind : Note<
5868   "binding reference variable %0 here">;
5869
5870 // Check for initializing a member variable with the address or a reference to
5871 // a constructor parameter.
5872 def warn_bind_ref_member_to_parameter : Warning<
5873   "binding reference member %0 to stack allocated parameter %1">,
5874   InGroup<DanglingField>;
5875 def warn_init_ptr_member_to_parameter_addr : Warning<
5876   "initializing pointer member %0 with the stack address of parameter %1">,
5877   InGroup<DanglingField>;
5878 def warn_bind_ref_member_to_temporary : Warning<
5879   "binding reference member %0 to a temporary value">,
5880   InGroup<DanglingField>;
5881 def note_ref_or_ptr_member_declared_here : Note<
5882   "%select{reference|pointer}0 member declared here">;
5883
5884 // For non-floating point, expressions of the form x == x or x != x
5885 // should result in a warning, since these always evaluate to a constant.
5886 // Array comparisons have similar warnings
5887 def warn_comparison_always : Warning<
5888   "%select{self-|array }0comparison always evaluates to %select{false|true|a constant}1">,
5889   InGroup<TautologicalCompare>;
5890
5891 def warn_stringcompare : Warning<
5892   "result of comparison against %select{a string literal|@encode}0 is "
5893   "unspecified (use strncmp instead)">,
5894   InGroup<DiagGroup<"string-compare">>;
5895
5896 def warn_identity_field_assign : Warning<
5897   "assigning %select{field|instance variable}0 to itself">,
5898   InGroup<SelfAssignmentField>;
5899
5900 // Type safety attributes
5901 def err_type_tag_for_datatype_not_ice : Error<
5902   "'type_tag_for_datatype' attribute requires the initializer to be "
5903   "an %select{integer|integral}0 constant expression">;
5904 def err_type_tag_for_datatype_too_large : Error<
5905   "'type_tag_for_datatype' attribute requires the initializer to be "
5906   "an %select{integer|integral}0 constant expression "
5907   "that can be represented by a 64 bit integer">;
5908 def warn_type_tag_for_datatype_wrong_kind : Warning<
5909   "this type tag was not designed to be used with this function">,
5910   InGroup<TypeSafety>;
5911 def warn_type_safety_type_mismatch : Warning<
5912   "argument type %0 doesn't match specified '%1' type tag "
5913   "%select{that requires %3|}2">, InGroup<TypeSafety>;
5914 def warn_type_safety_null_pointer_required : Warning<
5915   "specified %0 type tag requires a null pointer">, InGroup<TypeSafety>;
5916
5917 // Generic selections.
5918 def err_assoc_type_incomplete : Error<
5919   "type %0 in generic association incomplete">;
5920 def err_assoc_type_nonobject : Error<
5921   "type %0 in generic association not an object type">;
5922 def err_assoc_type_variably_modified : Error<
5923   "type %0 in generic association is a variably modified type">;
5924 def err_assoc_compatible_types : Error<
5925   "type %0 in generic association compatible with previously specified type %1">;
5926 def note_compat_assoc : Note<
5927   "compatible type %0 specified here">;
5928 def err_generic_sel_no_match : Error<
5929   "controlling expression type %0 not compatible with any generic association type">;
5930 def err_generic_sel_multi_match : Error<
5931   "controlling expression type %0 compatible with %1 generic association types">;
5932
5933
5934 // Blocks
5935 def err_blocks_disable : Error<"blocks support disabled - compile with -fblocks"
5936   " or pick a deployment target that supports them">;
5937 def err_block_returning_array_function : Error<
5938   "block cannot return %select{array|function}0 type %1">;
5939
5940 // Builtin annotation
5941 def err_builtin_annotation_first_arg : Error<
5942   "first argument to __builtin_annotation must be an integer">;
5943 def err_builtin_annotation_second_arg : Error<
5944   "second argument to __builtin_annotation must be a non-wide string constant">;
5945
5946 // CFString checking
5947 def err_cfstring_literal_not_string_constant : Error<
5948   "CFString literal is not a string constant">;
5949 def warn_cfstring_truncated : Warning<
5950   "input conversion stopped due to an input byte that does not "
5951   "belong to the input codeset UTF-8">,
5952   InGroup<DiagGroup<"CFString-literal">>;
5953
5954 // Statements.
5955 def err_continue_not_in_loop : Error<
5956   "'continue' statement not in loop statement">;
5957 def err_break_not_in_loop_or_switch : Error<
5958   "'break' statement not in loop or switch statement">;
5959 def err_default_not_in_switch : Error<
5960   "'default' statement not in switch statement">;
5961 def err_case_not_in_switch : Error<"'case' statement not in switch statement">;
5962 def warn_bool_switch_condition : Warning<
5963   "switch condition has boolean value">;
5964 def warn_case_value_overflow : Warning<
5965   "overflow converting case value to switch condition type (%0 to %1)">,
5966   InGroup<Switch>;
5967 def err_duplicate_case : Error<"duplicate case value '%0'">;
5968 def err_duplicate_case_differing_expr : Error<
5969   "duplicate case value: '%0' and '%1' both equal '%2'">;
5970 def warn_case_empty_range : Warning<"empty case range specified">;
5971 def warn_missing_case_for_condition :
5972   Warning<"no case matching constant switch condition '%0'">;
5973
5974 def warn_def_missing_case1 : Warning<
5975   "enumeration value %0 not explicitly handled in switch">,
5976   InGroup<SwitchEnum>, DefaultIgnore;
5977 def warn_def_missing_case2 : Warning<
5978   "enumeration values %0 and %1 not explicitly handled in switch">,
5979   InGroup<SwitchEnum>, DefaultIgnore;
5980 def warn_def_missing_case3 : Warning<
5981   "enumeration values %0, %1, and %2 not explicitly handled in switch">,
5982   InGroup<SwitchEnum>, DefaultIgnore;
5983 def warn_def_missing_cases : Warning<
5984   "%0 enumeration values not explicitly handled in switch: %1, %2, %3...">,
5985   InGroup<SwitchEnum>, DefaultIgnore;
5986
5987 def warn_missing_case1 : Warning<"enumeration value %0 not handled in switch">,
5988   InGroup<Switch>;
5989 def warn_missing_case2 : Warning<
5990   "enumeration values %0 and %1 not handled in switch">,
5991   InGroup<Switch>;
5992 def warn_missing_case3 : Warning<
5993   "enumeration values %0, %1, and %2 not handled in switch">,
5994   InGroup<Switch>;
5995 def warn_missing_cases : Warning<
5996   "%0 enumeration values not handled in switch: %1, %2, %3...">,
5997   InGroup<Switch>;
5998
5999 def warn_unannotated_fallthrough : Warning<
6000   "unannotated fall-through between switch labels">,
6001   InGroup<ImplicitFallthrough>, DefaultIgnore;
6002 def warn_unannotated_fallthrough_per_function : Warning<
6003   "unannotated fall-through between switch labels in partly-annotated "
6004   "function">, InGroup<ImplicitFallthroughPerFunction>, DefaultIgnore;
6005 def note_insert_fallthrough_fixit : Note<
6006   "insert '%0;' to silence this warning">;
6007 def note_insert_break_fixit : Note<
6008   "insert 'break;' to avoid fall-through">;
6009 def err_fallthrough_attr_wrong_target : Error<
6010   "clang::fallthrough attribute is only allowed on empty statements">;
6011 def note_fallthrough_insert_semi_fixit : Note<"did you forget ';'?">;
6012 def err_fallthrough_attr_outside_switch : Error<
6013   "fallthrough annotation is outside switch statement">;
6014 def warn_fallthrough_attr_invalid_placement : Warning<
6015   "fallthrough annotation does not directly precede switch label">,
6016   InGroup<ImplicitFallthrough>;
6017 def warn_fallthrough_attr_unreachable : Warning<
6018   "fallthrough annotation in unreachable code">,
6019   InGroup<ImplicitFallthrough>;
6020
6021 def warn_unreachable_default : Warning<
6022   "default label in switch which covers all enumeration values">,
6023   InGroup<CoveredSwitchDefault>, DefaultIgnore;
6024 def warn_not_in_enum : Warning<"case value not in enumerated type %0">,
6025   InGroup<Switch>;
6026 def warn_not_in_enum_assignement : Warning<"integer constant not in range "
6027   "of enumerated type %0">, InGroup<DiagGroup<"assign-enum">>, DefaultIgnore;
6028 def err_typecheck_statement_requires_scalar : Error<
6029   "statement requires expression of scalar type (%0 invalid)">;
6030 def err_typecheck_statement_requires_integer : Error<
6031   "statement requires expression of integer type (%0 invalid)">;
6032 def err_multiple_default_labels_defined : Error<
6033   "multiple default labels in one switch">;
6034 def err_switch_multiple_conversions : Error<
6035   "multiple conversions from switch condition type %0 to an integral or "
6036   "enumeration type">;
6037 def note_switch_conversion : Note<
6038   "conversion to %select{integral|enumeration}0 type %1">;
6039 def err_switch_explicit_conversion : Error<
6040   "switch condition type %0 requires explicit conversion to %1">;
6041 def err_switch_incomplete_class_type : Error<
6042   "switch condition has incomplete class type %0">;
6043
6044 def warn_empty_if_body : Warning<
6045   "if statement has empty body">, InGroup<EmptyBody>;
6046 def warn_empty_for_body : Warning<
6047   "for loop has empty body">, InGroup<EmptyBody>;
6048 def warn_empty_range_based_for_body : Warning<
6049   "range-based for loop has empty body">, InGroup<EmptyBody>;
6050 def warn_empty_while_body : Warning<
6051   "while loop has empty body">, InGroup<EmptyBody>;
6052 def warn_empty_switch_body : Warning<
6053   "switch statement has empty body">, InGroup<EmptyBody>;
6054 def note_empty_body_on_separate_line : Note<
6055   "put the semicolon on a separate line to silence this warning">;
6056
6057 def err_va_start_used_in_non_variadic_function : Error<
6058   "'va_start' used in function with fixed args">;
6059 def warn_second_parameter_of_va_start_not_last_named_argument : Warning<
6060   "second parameter of 'va_start' not last named argument">;
6061 def err_first_argument_to_va_arg_not_of_type_va_list : Error<
6062   "first argument to 'va_arg' is of type %0 and not 'va_list'">;
6063 def err_second_parameter_to_va_arg_incomplete: Error<
6064   "second argument to 'va_arg' is of incomplete type %0">;
6065 def err_second_parameter_to_va_arg_abstract: Error<
6066   "second argument to 'va_arg' is of abstract type %0">;
6067 def warn_second_parameter_to_va_arg_not_pod : Warning<
6068   "second argument to 'va_arg' is of non-POD type %0">,
6069   InGroup<NonPODVarargs>, DefaultError;
6070 def warn_second_parameter_to_va_arg_ownership_qualified : Warning<
6071   "second argument to 'va_arg' is of ARC ownership-qualified type %0">,
6072   InGroup<NonPODVarargs>, DefaultError;
6073 def warn_second_parameter_to_va_arg_never_compatible : Warning<
6074   "second argument to 'va_arg' is of promotable type %0; this va_arg has "
6075   "undefined behavior because arguments will be promoted to %1">;
6076
6077 def warn_return_missing_expr : Warning<
6078   "non-void %select{function|method}1 %0 should return a value">, DefaultError,
6079   InGroup<ReturnType>;
6080 def ext_return_missing_expr : ExtWarn<
6081   "non-void %select{function|method}1 %0 should return a value">, DefaultError,
6082   InGroup<ReturnType>;
6083 def ext_return_has_expr : ExtWarn<
6084   "%select{void function|void method|constructor|destructor}1 %0 "
6085   "should not return a value">,
6086   DefaultError, InGroup<ReturnType>;
6087 def ext_return_has_void_expr : Extension<
6088   "void %select{function|method|block}1 %0 should not return void expression">;
6089 def err_return_init_list : Error<
6090   "%select{void function|void method|constructor|destructor}1 %0 "
6091   "must not return a value">;
6092 def warn_noreturn_function_has_return_expr : Warning<
6093   "function %0 declared 'noreturn' should not return">,
6094   InGroup<InvalidNoreturn>;
6095 def warn_falloff_noreturn_function : Warning<
6096   "function declared 'noreturn' should not return">,
6097   InGroup<InvalidNoreturn>;
6098 def err_noreturn_block_has_return_expr : Error<
6099   "block declared 'noreturn' should not return">;
6100 def err_noreturn_missing_on_first_decl : Error<
6101   "function declared '[[noreturn]]' after its first declaration">;
6102 def note_noreturn_missing_first_decl : Note<
6103   "declaration missing '[[noreturn]]' attribute is here">;
6104 def err_carries_dependency_missing_on_first_decl : Error<
6105   "%select{function|parameter}0 declared '[[carries_dependency]]' "
6106   "after its first declaration">;
6107 def note_carries_dependency_missing_first_decl : Note<
6108   "declaration missing '[[carries_dependency]]' attribute is here">;
6109 def err_carries_dependency_param_not_function_decl : Error<
6110   "'[[carries_dependency]]' attribute only allowed on parameter in a function "
6111   "declaration or lambda">;
6112 def err_block_on_nonlocal : Error<
6113   "__block attribute not allowed, only allowed on local variables">;
6114 def err_block_on_vm : Error<
6115   "__block attribute not allowed on declaration with a variably modified type">;
6116
6117 def err_shufflevector_non_vector : Error<
6118   "first two arguments to __builtin_shufflevector must be vectors">;
6119 def err_shufflevector_incompatible_vector : Error<
6120   "first two arguments to __builtin_shufflevector must have the same type">;
6121 def err_shufflevector_nonconstant_argument : Error<
6122   "index for __builtin_shufflevector must be a constant integer">;
6123 def err_shufflevector_argument_too_large : Error<
6124   "index for __builtin_shufflevector must be less than the total number "
6125   "of vector elements">;
6126
6127 def err_vector_incorrect_num_initializers : Error<
6128   "%select{too many|too few}0 elements in vector initialization (expected %1 elements, have %2)">;
6129 def err_altivec_empty_initializer : Error<"expected initializer">;
6130
6131 def err_invalid_neon_type_code : Error<
6132   "incompatible constant for this __builtin_neon function">; 
6133 def err_argument_invalid_range : Error<
6134   "argument should be a value from %0 to %1">;
6135
6136 def err_builtin_longjmp_invalid_val : Error<
6137   "argument to __builtin_longjmp must be a constant 1">;
6138
6139 def err_constant_integer_arg_type : Error<
6140   "argument to %0 must be a constant integer">;
6141
6142 def ext_mixed_decls_code : Extension<
6143   "ISO C90 forbids mixing declarations and code">,
6144   InGroup<DiagGroup<"declaration-after-statement">>;
6145   
6146 def err_non_local_variable_decl_in_for : Error<
6147   "declaration of non-local variable in 'for' loop">;
6148 def err_non_variable_decl_in_for : Error<
6149   "non-variable declaration in 'for' loop">;
6150 def err_toomany_element_decls : Error<
6151   "only one element declaration is allowed">;
6152 def err_selector_element_not_lvalue : Error<
6153   "selector element is not a valid lvalue">;
6154 def err_selector_element_type : Error<
6155   "selector element type %0 is not a valid object">;
6156 def err_collection_expr_type : Error<
6157   "the type %0 is not a pointer to a fast-enumerable object">;
6158 def warn_collection_expr_type : Warning<
6159   "collection expression type %0 may not respond to %1">;
6160
6161 def err_invalid_conversion_between_ext_vectors : Error<
6162   "invalid conversion between ext-vector type %0 and %1">;
6163
6164 def warn_duplicate_attribute : Warning<
6165   "attribute %0 is already applied with different parameters">,
6166   InGroup<IgnoredAttributes>;
6167
6168 // Type
6169 def ext_invalid_sign_spec : Extension<"'%0' cannot be signed or unsigned">;
6170 def warn_receiver_forward_class : Warning<
6171     "receiver %0 is a forward class and corresponding @interface may not exist">,
6172     InGroup<ForwardClassReceiver>;
6173 def note_method_sent_forward_class : Note<"method %0 is used for the forward class">;
6174 def ext_missing_declspec : ExtWarn<
6175   "declaration specifier missing, defaulting to 'int'">;
6176 def ext_missing_type_specifier : ExtWarn<
6177   "type specifier missing, defaults to 'int'">,
6178   InGroup<ImplicitInt>;
6179 def err_decimal_unsupported : Error<
6180   "GNU decimal type extension not supported">;
6181 def err_missing_type_specifier : Error<
6182   "C++ requires a type specifier for all declarations">;
6183 def err_objc_array_of_interfaces : Error<
6184   "array of interface %0 is invalid (probably should be an array of pointers)">;
6185 def ext_c99_array_usage : Extension<
6186   "%select{qualifier in |static |}0array size %select{||'[*] '}0is a C99 "
6187   "feature">, InGroup<C99>;
6188 def err_c99_array_usage_cxx : Error<
6189   "%select{qualifier in |static |}0array size %select{||'[*] '}0is a C99 "
6190   "feature, not permitted in C++">;
6191 def err_double_requires_fp64 : Error<
6192   "use of type 'double' requires cl_khr_fp64 extension to be enabled">;
6193 def err_int128_unsupported : Error<
6194   "__int128 is not supported on this target">;
6195 def err_nsconsumed_attribute_mismatch : Error<
6196   "overriding method has mismatched ns_consumed attribute on its"
6197   " parameter">;
6198 def err_nsreturns_retained_attribute_mismatch : Error<
6199   "overriding method has mismatched ns_returns_%select{not_retained|retained}0"
6200   " attributes">;
6201   
6202 def note_getter_unavailable : Note<
6203   "or because setter is declared here, but no getter method %0 is found">;
6204 def err_invalid_protocol_qualifiers : Error<
6205   "invalid protocol qualifiers on non-ObjC type">;
6206 def warn_ivar_use_hidden : Warning<
6207   "local declaration of %0 hides instance variable">,
6208    InGroup<DiagGroup<"shadow-ivar">>;
6209 def error_ivar_use_in_class_method : Error<
6210   "instance variable %0 accessed in class method">;
6211 def error_implicit_ivar_access : Error<
6212   "instance variable %0 cannot be accessed because 'self' has been redeclared">;
6213 def error_private_ivar_access : Error<"instance variable %0 is private">,
6214   AccessControl;
6215 def error_protected_ivar_access : Error<"instance variable %0 is protected">,
6216   AccessControl;
6217 def warn_maynot_respond : Warning<"%0 may not respond to %1">;
6218 def warn_attribute_method_def : Warning<
6219   "attributes on method implementation and its declaration must match">,
6220   InGroup<DiagGroup<"mismatched-method-attributes">>;
6221 def ext_typecheck_base_super : Warning<
6222   "method parameter type "
6223   "%diff{$ does not match super class method parameter type $|"
6224   "does not match super class method parameter type}0,1">,
6225    InGroup<SuperSubClassMismatch>, DefaultIgnore;
6226 def warn_missing_method_return_type : Warning<
6227   "method has no return type specified; defaults to 'id'">,
6228   InGroup<MissingMethodReturnType>, DefaultIgnore;
6229 def warn_direct_ivar_access : Warning<"instance variable %0 is being "
6230   "directly accessed">, InGroup<DiagGroup<"direct-ivar-access">>, DefaultIgnore;
6231
6232 // Spell-checking diagnostics
6233 def err_unknown_type_or_class_name_suggest : Error<
6234   "unknown %select{type|class}2 name %0; did you mean %1?">;
6235 def err_unknown_typename_suggest : Error<
6236   "unknown type name %0; did you mean %1?">;
6237 def err_unknown_nested_typename_suggest : Error<
6238   "no type named %0 in %1; did you mean %2?">;
6239 def err_no_member_suggest : Error<"no member named %0 in %1; did you mean %2?">;
6240 def err_undeclared_use_suggest : Error<
6241   "use of undeclared %0; did you mean %1?">;
6242 def err_undeclared_var_use_suggest : Error<
6243   "use of undeclared identifier %0; did you mean %1?">;
6244 def err_no_template_suggest : Error<"no template named %0; did you mean %1?">;
6245 def err_no_member_template_suggest : Error<
6246   "no template named %0 in %1; did you mean %2?">;
6247 def err_mem_init_not_member_or_class_suggest : Error<
6248   "initializer %0 does not name a non-static data member or base "
6249   "class; did you mean the %select{base class|member}1 %2?">;
6250 def err_field_designator_unknown_suggest : Error<
6251   "field designator %0 does not refer to any field in type %1; did you mean "
6252   "%2?">;
6253 def err_typecheck_member_reference_ivar_suggest : Error<
6254   "%0 does not have a member named %1; did you mean %2?">;
6255 def err_property_not_found_suggest : Error<
6256   "property %0 not found on object of type %1; did you mean %2?">;
6257 def err_ivar_access_using_property_syntax_suggest : Error<
6258   "property %0 not found on object of type %1; did you mean to access instance variable %2?">;
6259 def err_property_found_suggest : Error<
6260   "property %0 found on object of type %1; did you mean to access "
6261   "it with the \".\" operator?">;
6262 def err_undef_interface_suggest : Error<
6263   "cannot find interface declaration for %0; did you mean %1?">;
6264 def warn_undef_interface_suggest : Warning<
6265   "cannot find interface declaration for %0; did you mean %1?">;
6266 def err_undef_superclass_suggest : Error<
6267   "cannot find interface declaration for %0, superclass of %1; did you mean "
6268   "%2?">;
6269 def err_undeclared_protocol_suggest : Error<
6270   "cannot find protocol declaration for %0; did you mean %1?">;
6271 def note_base_class_specified_here : Note<
6272   "base class %0 specified here">;
6273 def err_using_directive_suggest : Error<
6274   "no namespace named %0; did you mean %1?">;
6275 def err_using_directive_member_suggest : Error<
6276   "no namespace named %0 in %1; did you mean %2?">;
6277 def note_namespace_defined_here : Note<"namespace %0 defined here">;
6278 def err_sizeof_pack_no_pack_name_suggest : Error<
6279   "%0 does not refer to the name of a parameter pack; did you mean %1?">;
6280 def note_parameter_pack_here : Note<"parameter pack %0 declared here">;
6281
6282 def err_uncasted_use_of_unknown_any : Error<
6283   "%0 has unknown type; cast it to its declared type to use it">;
6284 def err_uncasted_call_of_unknown_any : Error<
6285   "%0 has unknown return type; cast the call to its declared return type">;
6286 def err_uncasted_send_to_unknown_any_method : Error<
6287   "no known method %select{%objcinstance1|%objcclass1}0; cast the "
6288   "message send to the method's return type">;
6289 def err_unsupported_unknown_any_decl : Error<
6290   "%0 has unknown type, which is unsupported for this kind of declaration">;
6291 def err_unsupported_unknown_any_expr : Error<
6292   "unsupported expression with unknown type">;
6293 def err_unsupported_unknown_any_call : Error<
6294   "call to unsupported expression with unknown type">;
6295 def err_unknown_any_addrof : Error<
6296   "the address of a declaration with unknown type "
6297   "can only be cast to a pointer type">;
6298 def err_unknown_any_var_function_type : Error<
6299   "variable %0 with unknown type cannot be given a function type">;
6300 def err_unknown_any_function : Error<
6301   "function %0 with unknown type must be given a function type">;
6302
6303 def err_filter_expression_integral : Error<
6304   "filter expression type should be an integral value not %0">;
6305
6306 // OpenCL warnings and errors.
6307 def err_invalid_astype_of_different_size : Error<
6308   "invalid reinterpretation: sizes of %0 and %1 must match">;
6309 def err_static_kernel : Error<
6310   "kernel functions cannot be declared static">;
6311 def err_opencl_ptrptr_kernel_arg : Error<
6312   "kernel argument cannot be declared as a pointer to a pointer">;
6313 def err_static_function_scope : Error<
6314   "variables in function scope cannot be declared static">;
6315 def err_opencl_bitfields : Error<
6316   "bitfields are not supported in OpenCL">;
6317 def err_opencl_vla : Error<
6318   "variable length arrays are not supported in OpenCL">;
6319 def err_event_t_kernel_arg : Error<
6320   "the event_t type cannot be used to declare a kernel function argument">;
6321 def err_event_t_global_var : Error<
6322   "the event_t type cannot be used to declare a program scope variable">;
6323 def err_event_t_struct_field : Error<
6324   "the event_t type cannot be used to declare a structure or union field">;
6325 def err_event_t_addr_space_qual : Error<
6326   "the event_t type can only be used with __private address space qualifier">;
6327 def err_expected_kernel_void_return_type : Error<
6328   "kernel must have void return type">;
6329 def err_sampler_argument_required : Error<
6330   "sampler_t variable required - got %0">;
6331 def err_wrong_sampler_addressspace: Error<
6332   "sampler type cannot be used with the __local and __global address space qualifiers">;
6333 def err_opencl_global_invalid_addr_space : Error<
6334   "global variables must have a constant address space qualifier">;
6335   
6336 // OpenMP support.
6337 def err_omp_expected_var_arg_suggest : Error<
6338   "%0 is not a global variable, static local variable or static data member%select{|; did you mean %2?}1">;
6339 def err_omp_global_var_arg : Error<
6340   "arguments of '#pragma omp %0' must have %select{global storage|static storage duration}1">;
6341 def err_omp_ref_type_arg : Error<
6342   "arguments of '#pragma omp %0' cannot be of reference type %1">;
6343 def err_omp_var_scope : Error<
6344   "'#pragma omp %0' must appear in the scope of the %1 variable declaration">;
6345 def err_omp_var_used : Error<
6346   "'#pragma omp %0' must precede all references to variable %1">;
6347 def err_omp_var_thread_local : Error<
6348   "variable %0 cannot be threadprivate because it is thread-local">;
6349 def err_omp_incomplete_type : Error<
6350   "a threadprivate variable must not have incomplete type %0">;
6351
6352 } // end of sema category
6353
6354 let CategoryName = "Related Result Type Issue" in {
6355 // Objective-C related result type compatibility
6356 def warn_related_result_type_compatibility_class : Warning<
6357   "method is expected to return an instance of its class type "
6358   "%diff{$, but is declared to return $|"
6359   ", but is declared to return different type}0,1">;
6360 def warn_related_result_type_compatibility_protocol : Warning<
6361   "protocol method is expected to return an instance of the implementing "
6362   "class, but is declared to return %0">;
6363 def note_related_result_type_family : Note<
6364   "%select{overridden|current}0 method is part of the '%select{|alloc|copy|init|"
6365   "mutableCopy|new|autorelease|dealloc|finalize|release|retain|retainCount|"
6366   "self}1' method family%select{| and is expected to return an instance of its "
6367   "class type}0">;
6368 def note_related_result_type_overridden : Note<
6369   "overridden method returns an instance of its class type">;
6370 def note_related_result_type_inferred : Note<
6371   "%select{class|instance}0 method %1 is assumed to return an instance of "
6372   "its receiver type (%2)">;
6373 def note_related_result_type_explicit : Note<
6374   "%select{overridden|current}0 method is explicitly declared 'instancetype'"
6375   "%select{| and is expected to return an instance of its class type}0">;
6376
6377 }
6378
6379 let CategoryName = "Modules Issue" in {
6380 def err_module_private_specialization : Error<
6381   "%select{template|partial|member}0 specialization cannot be "
6382   "declared __module_private__">;
6383 def err_module_private_local : Error<
6384   "%select{local variable|parameter|typedef}0 %1 cannot be declared "
6385   "__module_private__">;
6386 def err_module_private_local_class : Error<
6387   "local %select{struct|interface|union|class|enum}0 cannot be declared "
6388   "__module_private__">;
6389 def err_module_private_definition : Error<
6390   "definition of %0 must be imported from module '%1' before it is required">;
6391 }
6392
6393 let CategoryName = "Documentation Issue" in {
6394 def warn_not_a_doxygen_trailing_member_comment : Warning<
6395   "not a Doxygen trailing comment">, InGroup<Documentation>, DefaultIgnore;
6396 } // end of documentation issue category
6397
6398 } // end of sema component.