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