]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td
Merge llvm, clang, lld, lldb, compiler-rt and libc++ r301441, and update
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / clang / include / clang / Basic / DiagnosticSemaKinds.td
1 //==--- DiagnosticSemaKinds.td - libsema diagnostics ----------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 //===----------------------------------------------------------------------===//
11 // Semantic Analysis
12 //===----------------------------------------------------------------------===//
13
14 let Component = "Sema" in {
15 let CategoryName = "Semantic Issue" in {
16
17 def note_previous_decl : Note<"%0 declared here">;
18 def note_entity_declared_at : Note<"%0 declared here">;
19 def note_callee_decl : Note<"%0 declared here">;
20 def note_defined_here : Note<"%0 defined here">;
21
22 // For loop analysis
23 def warn_variables_not_in_loop_body : Warning<
24   "variable%select{s| %1|s %1 and %2|s %1, %2, and %3|s %1, %2, %3, and %4}0 "
25   "used in loop condition not modified in loop body">,
26   InGroup<ForLoopAnalysis>, DefaultIgnore;
27 def warn_redundant_loop_iteration : Warning<
28   "variable %0 is %select{decremented|incremented}1 both in the loop header "
29   "and in the loop body">,
30   InGroup<ForLoopAnalysis>, DefaultIgnore;
31 def note_loop_iteration_here : Note<"%select{decremented|incremented}0 here">;
32
33 def warn_duplicate_enum_values : Warning<
34   "element %0 has been implicitly assigned %1 which another element has "
35   "been assigned">, InGroup<DiagGroup<"duplicate-enum">>, DefaultIgnore;
36 def note_duplicate_element : Note<"element %0 also has value %1">;
37
38 // Absolute value functions
39 def warn_unsigned_abs : Warning<
40   "taking the absolute value of unsigned type %0 has no effect">,
41   InGroup<AbsoluteValue>;
42 def note_remove_abs : Note<
43   "remove the call to '%0' since unsigned values cannot be negative">;
44 def warn_abs_too_small : Warning<
45   "absolute value function %0 given an argument of type %1 but has parameter "
46   "of type %2 which may cause truncation of value">, InGroup<AbsoluteValue>;
47 def warn_wrong_absolute_value_type : Warning<
48   "using %select{integer|floating point|complex}1 absolute value function %0 "
49   "when argument is of %select{integer|floating point|complex}2 type">,
50   InGroup<AbsoluteValue>;
51 def note_replace_abs_function : Note<"use function '%0' instead">;
52 def warn_pointer_abs : Warning<
53   "taking the absolute value of %select{pointer|function|array}0 type %1 is suspicious">,
54   InGroup<AbsoluteValue>;
55
56 def warn_max_unsigned_zero : Warning<
57   "taking the max of "
58   "%select{a value and unsigned zero|unsigned zero and a value}0 "
59   "is always equal to the other value">,
60   InGroup<MaxUnsignedZero>;
61 def note_remove_max_call : Note<
62   "remove call to max function and unsigned zero argument">;
63
64 def warn_infinite_recursive_function : Warning<
65   "all paths through this function will call itself">,
66   InGroup<InfiniteRecursion>, DefaultIgnore;
67
68 def warn_comma_operator : Warning<"possible misuse of comma operator here">,
69   InGroup<DiagGroup<"comma">>, DefaultIgnore;
70 def note_cast_to_void : Note<"cast expression to void to silence warning">;
71
72 // Constant expressions
73 def err_expr_not_ice : Error<
74   "expression is not an %select{integer|integral}0 constant expression">;
75 def ext_expr_not_ice : Extension<
76   "expression is not an %select{integer|integral}0 constant expression; "
77   "folding it to a constant is a GNU extension">, InGroup<GNUFoldingConstant>;
78 def err_typecheck_converted_constant_expression : Error<
79   "value of type %0 is not implicitly convertible to %1">;
80 def err_typecheck_converted_constant_expression_disallowed : Error<
81   "conversion from %0 to %1 is not allowed in a converted constant expression">;
82 def err_typecheck_converted_constant_expression_indirect : Error<
83   "conversion from %0 to %1 in converted constant expression would "
84   "bind reference to a temporary">;
85 def err_expr_not_cce : Error<
86   "%select{case value|enumerator value|non-type template argument|"
87   "array size|constexpr if condition}0 "
88   "is not a constant expression">;
89 def ext_cce_narrowing : ExtWarn<
90   "%select{case value|enumerator value|non-type template argument|"
91   "array size|constexpr if condition}0 "
92   "%select{cannot be narrowed from type %2 to %3|"
93   "evaluates to %2, which cannot be narrowed to type %3}1">,
94   InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
95 def err_ice_not_integral : Error<
96   "integral constant expression must have integral or unscoped enumeration "
97   "type, not %0">;
98 def err_ice_incomplete_type : Error<
99   "integral constant expression has incomplete class type %0">;
100 def err_ice_explicit_conversion : Error<
101   "integral constant expression requires explicit conversion from %0 to %1">;
102 def note_ice_conversion_here : Note<
103   "conversion to %select{integral|enumeration}0 type %1 declared here">;
104 def err_ice_ambiguous_conversion : Error<
105   "ambiguous conversion from type %0 to an integral or unscoped "
106   "enumeration type">;
107 def err_ice_too_large : Error<
108   "integer constant expression evaluates to value %0 that cannot be "
109   "represented in a %1-bit %select{signed|unsigned}2 integer type">;
110 def err_expr_not_string_literal : Error<"expression is not a string literal">;
111
112 // Semantic analysis of constant literals.
113 def ext_predef_outside_function : Warning<
114   "predefined identifier is only valid inside function">,
115   InGroup<DiagGroup<"predefined-identifier-outside-function">>;
116 def warn_float_overflow : Warning<
117   "magnitude of floating-point constant too large for type %0; maximum is %1">,
118    InGroup<LiteralRange>;
119 def warn_float_underflow : Warning<
120   "magnitude of floating-point constant too small for type %0; minimum is %1">,
121   InGroup<LiteralRange>;
122 def warn_double_const_requires_fp64 : Warning<
123   "double precision constant requires cl_khr_fp64, casting to single precision">;
124 def err_half_const_requires_fp16 : Error<
125   "half precision constant requires cl_khr_fp16">;
126
127 // C99 variable-length arrays
128 def ext_vla : Extension<"variable length arrays are a C99 feature">,
129   InGroup<VLAExtension>;
130 def warn_vla_used : Warning<"variable length array used">,
131   InGroup<VLA>, DefaultIgnore;
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 ext_duplicate_declspec : ExtWarn<"duplicate '%0' declaration specifier">,
192   InGroup<DuplicateDeclSpecifier>;
193 def warn_duplicate_declspec : Warning<"duplicate '%0' declaration specifier">,
194   InGroup<DuplicateDeclSpecifier>;
195 def ext_plain_complex : ExtWarn<
196   "plain '_Complex' requires a type specifier; assuming '_Complex double'">;
197 def ext_integer_complex : Extension<
198   "complex integer types are a GNU extension">, InGroup<GNUComplexInteger>;
199
200 def err_invalid_sign_spec : Error<"'%0' cannot be signed or unsigned">;
201 def err_invalid_width_spec : Error<
202   "'%select{|short|long|long long}0 %1' is invalid">;
203 def err_invalid_complex_spec : Error<"'_Complex %0' is invalid">;
204 def err_friend_decl_spec : Error<"'%0' is invalid in friend declarations">;
205
206 def ext_auto_type_specifier : ExtWarn<
207   "'auto' type specifier is a C++11 extension">, InGroup<CXX11>;
208 def warn_auto_storage_class : Warning<
209   "'auto' storage class specifier is redundant and incompatible with C++11">,
210   InGroup<CXX11Compat>, DefaultIgnore;
211
212 def warn_deprecated_register : Warning<
213   "'register' storage class specifier is deprecated "
214   "and incompatible with C++1z">, InGroup<DeprecatedRegister>;
215 def ext_register_storage_class : ExtWarn<
216   "ISO C++1z does not allow 'register' storage class specifier">,
217   DefaultError, InGroup<Register>;
218
219 def err_invalid_decl_spec_combination : Error<
220   "cannot combine with previous '%0' declaration specifier">;
221 def err_invalid_vector_decl_spec_combination : Error<
222   "cannot combine with previous '%0' declaration specifier. "
223   "'__vector' must be first">;
224 def err_invalid_pixel_decl_spec_combination : Error<
225   "'__pixel' must be preceded by '__vector'.  "
226   "'%0' declaration specifier not allowed here">;
227 def err_invalid_vector_bool_decl_spec : Error<
228   "cannot use '%0' with '__vector bool'">;
229 def err_invalid_vector_long_decl_spec : Error<
230   "cannot use 'long' with '__vector'">;
231 def err_invalid_vector_float_decl_spec : Error<
232   "cannot use 'float' with '__vector'">;
233 def err_invalid_vector_double_decl_spec : Error <
234   "use of 'double' with '__vector' requires VSX support to be enabled "
235   "(available on POWER7 or later)">;
236 def err_invalid_vector_long_long_decl_spec : Error <
237   "use of 'long long' with '__vector bool' requires VSX support (available on "
238   "POWER7 or later) or extended Altivec support (available on POWER8 or later) " 
239   "to be enabled">;
240 def err_invalid_vector_long_double_decl_spec : Error<
241   "cannot use 'long double' with '__vector'">;
242 def warn_vector_long_decl_spec_combination : Warning<
243   "Use of 'long' with '__vector' is deprecated">, InGroup<Deprecated>;
244
245 def err_use_of_tag_name_without_tag : Error<
246   "must use '%1' tag to refer to type %0%select{| in this scope}2">;
247
248 def err_redeclaration_different_type : Error<
249   "redeclaration of %0 with a different type%diff{: $ vs $|}1,2">;
250 def err_bad_variable_name : Error<
251   "%0 cannot be the name of a variable or data member">;
252 def err_bad_parameter_name : Error<
253   "%0 cannot be the name of a parameter">;
254 def err_parameter_name_omitted : Error<"parameter name omitted">;
255 def err_anyx86_interrupt_attribute : Error<
256   "%select{x86|x86-64}0 'interrupt' attribute only applies to functions that "
257   "have %select{a 'void' return type|"
258   "only a pointer parameter optionally followed by an integer parameter|"
259   "a pointer as the first parameter|a %2 type as the second parameter}1">;
260 def err_anyx86_interrupt_called : Error<
261   "interrupt service routine cannot be called directly">;
262 def warn_arm_interrupt_calling_convention : Warning<
263    "call to function without interrupt attribute could clobber interruptee's VFP registers">,
264    InGroup<Extra>;
265 def warn_mips_interrupt_attribute : Warning<
266    "MIPS 'interrupt' attribute only applies to functions that have "
267    "%select{no parameters|a 'void' return type}0">,
268    InGroup<IgnoredAttributes>;
269 def warn_unused_parameter : Warning<"unused parameter %0">,
270   InGroup<UnusedParameter>, DefaultIgnore;
271 def warn_unused_variable : Warning<"unused variable %0">,
272   InGroup<UnusedVariable>, DefaultIgnore;
273 def warn_unused_local_typedef : Warning<
274   "unused %select{typedef|type alias}0 %1">,
275   InGroup<UnusedLocalTypedef>, DefaultIgnore;
276 def warn_unused_property_backing_ivar : 
277   Warning<"ivar %0 which backs the property is not "
278   "referenced in this property's accessor">,
279   InGroup<UnusedPropertyIvar>, DefaultIgnore;
280 def warn_unused_const_variable : Warning<"unused variable %0">,
281   InGroup<UnusedConstVariable>, DefaultIgnore;
282 def warn_unused_exception_param : Warning<"unused exception parameter %0">,
283   InGroup<UnusedExceptionParameter>, DefaultIgnore;
284 def warn_decl_in_param_list : Warning<
285   "declaration of %0 will not be visible outside of this function">,
286   InGroup<Visibility>;
287 def warn_redefinition_in_param_list : Warning<
288   "redefinition of %0 will not be visible outside of this function">,
289   InGroup<Visibility>;
290 def warn_empty_parens_are_function_decl : Warning<
291   "empty parentheses interpreted as a function declaration">,
292   InGroup<VexingParse>;
293 def warn_parens_disambiguated_as_function_declaration : Warning<
294   "parentheses were disambiguated as a function declaration">,
295   InGroup<VexingParse>;
296 def note_additional_parens_for_variable_declaration : Note<
297   "add a pair of parentheses to declare a variable">;
298 def note_empty_parens_function_call : Note<
299   "change this ',' to a ';' to call %0">;
300 def note_empty_parens_default_ctor : Note<
301   "remove parentheses to declare a variable">;
302 def note_empty_parens_zero_initialize : Note<
303   "replace parentheses with an initializer to declare a variable">;
304 def warn_unused_function : Warning<"unused function %0">,
305   InGroup<UnusedFunction>, DefaultIgnore;
306 def warn_unused_member_function : Warning<"unused member function %0">,
307   InGroup<UnusedMemberFunction>, DefaultIgnore;
308 def warn_used_but_marked_unused: Warning<"%0 was marked unused but was used">,
309   InGroup<UsedButMarkedUnused>, DefaultIgnore;
310 def warn_unneeded_internal_decl : Warning<
311   "%select{function|variable}0 %1 is not needed and will not be emitted">,
312   InGroup<UnneededInternalDecl>, DefaultIgnore;
313 def warn_unneeded_static_internal_decl : Warning<
314   "'static' function %0 declared in header file "
315   "should be declared 'static inline'">,
316   InGroup<UnneededInternalDecl>, DefaultIgnore;
317 def warn_unneeded_member_function : Warning<
318   "member function %0 is not needed and will not be emitted">,
319   InGroup<UnneededMemberFunction>, DefaultIgnore;
320 def warn_unused_private_field: Warning<"private field %0 is not used">,
321   InGroup<UnusedPrivateField>, DefaultIgnore;
322 def warn_unused_lambda_capture: Warning<"lambda capture %0 is not "
323   "%select{used|required to be captured for this use}1">,
324   InGroup<UnusedLambdaCapture>, DefaultIgnore;
325
326 def warn_parameter_size: Warning<
327   "%0 is a large (%1 bytes) pass-by-value argument; "
328   "pass it by reference instead ?">, InGroup<LargeByValueCopy>;
329 def warn_return_value_size: Warning<
330   "return value of %0 is a large (%1 bytes) pass-by-value object; "
331   "pass it by reference instead ?">, InGroup<LargeByValueCopy>;
332 def warn_return_value_udt: Warning<
333   "%0 has C-linkage specified, but returns user-defined type %1 which is "
334   "incompatible with C">, InGroup<ReturnTypeCLinkage>;
335 def warn_return_value_udt_incomplete: Warning<
336   "%0 has C-linkage specified, but returns incomplete type %1 which could be "
337   "incompatible with C">, InGroup<ReturnTypeCLinkage>;
338 def warn_implicit_function_decl : Warning<
339   "implicit declaration of function %0">,
340   InGroup<ImplicitFunctionDeclare>, DefaultIgnore;
341 def ext_implicit_function_decl : ExtWarn<
342   "implicit declaration of function %0 is invalid in C99">,
343   InGroup<ImplicitFunctionDeclare>;
344 def note_function_suggestion : Note<"did you mean %0?">;
345
346 def err_ellipsis_first_param : Error<
347   "ISO C requires a named parameter before '...'">;
348 def err_declarator_need_ident : Error<"declarator requires an identifier">;
349 def err_language_linkage_spec_unknown : Error<"unknown linkage language">;
350 def err_language_linkage_spec_not_ascii : Error<
351   "string literal in language linkage specifier cannot have an "
352   "encoding-prefix">;
353 def warn_use_out_of_scope_declaration : Warning<
354   "use of out-of-scope declaration of %0">;
355 def err_inline_non_function : Error<
356   "'inline' can only appear on functions%select{| and non-local variables}0">;
357 def err_noreturn_non_function : Error<
358   "'_Noreturn' can only appear on functions">;
359 def warn_qual_return_type : Warning< 
360   "'%0' type qualifier%s1 on return type %plural{1:has|:have}1 no effect">,
361   InGroup<IgnoredQualifiers>, DefaultIgnore;
362 def warn_deprecated_redundant_constexpr_static_def : Warning<
363   "out-of-line definition of constexpr static data member is redundant "
364   "in C++17 and is deprecated">,
365   InGroup<Deprecated>, DefaultIgnore;
366
367 def warn_decl_shadow :
368   Warning<"declaration shadows a %select{"
369           "local variable|"
370           "variable in %2|"
371           "static data member of %2|"
372           "field of %2|"
373           "typedef in %2|"
374           "type alias in %2}1">,
375   InGroup<Shadow>, DefaultIgnore;
376 def warn_decl_shadow_uncaptured_local :
377   Warning<warn_decl_shadow.Text>,
378   InGroup<ShadowUncapturedLocal>, DefaultIgnore;
379 def warn_ctor_parm_shadows_field:
380   Warning<"constructor parameter %0 shadows the field %1 of %2">,
381   InGroup<ShadowFieldInConstructor>, DefaultIgnore;
382 def warn_modifying_shadowing_decl :
383   Warning<"modifying constructor parameter %0 that shadows a "
384           "field of %1">,
385   InGroup<ShadowFieldInConstructorModified>, DefaultIgnore;
386
387 // C++ decomposition declarations
388 def err_decomp_decl_context : Error<
389   "decomposition declaration not permitted in this context">;
390 def warn_cxx14_compat_decomp_decl : Warning<
391   "decomposition declarations are incompatible with "
392   "C++ standards before C++1z">, DefaultIgnore, InGroup<CXXPre1zCompat>;
393 def ext_decomp_decl : ExtWarn<
394   "decomposition declarations are a C++1z extension">, InGroup<CXX1z>;
395 def err_decomp_decl_spec : Error<
396   "decomposition declaration cannot be declared "
397   "%plural{1:'%1'|:with '%1' specifiers}0">;
398 def err_decomp_decl_type : Error<
399   "decomposition declaration cannot be declared with type %0; "
400   "declared type must be 'auto' or reference to 'auto'">;
401 def err_decomp_decl_parens : Error<
402   "decomposition declaration cannot be declared with parentheses">;
403 def err_decomp_decl_template : Error<
404   "decomposition declaration template not supported">;
405 def err_decomp_decl_not_alone : Error<
406   "decomposition declaration must be the only declaration in its group">;
407 def err_decomp_decl_requires_init : Error<
408   "decomposition declaration %0 requires an initializer">;
409 def err_decomp_decl_wrong_number_bindings : Error<
410   "type %0 decomposes into %2 elements, but %select{only |}3%1 "
411   "names were provided">;
412 def err_decomp_decl_unbindable_type : Error<
413   "cannot decompose %select{union|non-class, non-array}1 type %2">;
414 def err_decomp_decl_multiple_bases_with_members : Error<
415   "cannot decompose class type %1: "
416   "%select{its base classes %2 and|both it and its base class}0 %3 "
417   "have non-static data members">;
418 def err_decomp_decl_ambiguous_base : Error<
419   "cannot decompose members of ambiguous base class %1 of %0:%2">;
420 def err_decomp_decl_non_public_base : Error<
421   "cannot decompose members of non-public base class %1 of %0">;
422 def err_decomp_decl_non_public_member : Error<
423   "cannot decompose non-public member %0 of %1">;
424 def err_decomp_decl_anon_union_member : Error<
425   "cannot decompose class type %0 because it has an anonymous "
426   "%select{struct|union}1 member">;
427 def err_decomp_decl_std_tuple_element_not_specialized : Error<
428   "cannot decompose this type; 'std::tuple_element<%0>::type' "
429   "does not name a type">;
430 def err_decomp_decl_std_tuple_size_not_constant : Error<
431   "cannot decompose this type; 'std::tuple_size<%0>::value' "
432   "is not a valid integral constant expression">;
433 def note_in_binding_decl_init : Note<
434   "in implicit initialization of binding declaration %0">;
435
436 def err_std_type_trait_not_class_template : Error<
437   "unsupported standard library implementation: "
438   "'std::%0' is not a class template">;
439
440 // C++ using declarations
441 def err_using_requires_qualname : Error<
442   "using declaration requires a qualified name">;
443 def err_using_typename_non_type : Error<
444   "'typename' keyword used on a non-type">;
445 def err_using_dependent_value_is_type : Error<
446   "dependent using declaration resolved to type without 'typename'">;
447 def err_using_decl_nested_name_specifier_is_not_class : Error<
448   "using declaration in class refers into '%0', which is not a class">;
449 def err_using_decl_nested_name_specifier_is_current_class : Error<
450   "using declaration refers to its own class">;
451 def err_using_decl_nested_name_specifier_is_not_base_class : Error<
452   "using declaration refers into '%0', which is not a base class of %1">;
453 def err_using_decl_constructor_not_in_direct_base : Error<
454   "%0 is not a direct base of %1, cannot inherit constructors">;
455 def err_using_decl_can_not_refer_to_class_member : Error<
456   "using declaration cannot refer to class member">;
457 def err_ambiguous_inherited_constructor : Error<
458   "constructor of %0 inherited from multiple base class subobjects">;
459 def note_ambiguous_inherited_constructor_using : Note<
460   "inherited from base class %0 here">;
461 def note_using_decl_class_member_workaround : Note<
462   "use %select{an alias declaration|a typedef declaration|a reference|"
463   "a const variable|a constexpr variable}0 instead">;
464 def err_using_decl_can_not_refer_to_namespace : Error<
465   "using declaration cannot refer to a namespace">;
466 def err_using_decl_can_not_refer_to_scoped_enum : Error<
467   "using declaration cannot refer to a scoped enumerator">;
468 def err_using_decl_constructor : Error<
469   "using declaration cannot refer to a constructor">;
470 def warn_cxx98_compat_using_decl_constructor : Warning<
471   "inheriting constructors are incompatible with C++98">,
472   InGroup<CXX98Compat>, DefaultIgnore;
473 def err_using_decl_destructor : Error<
474   "using declaration cannot refer to a destructor">;
475 def err_using_decl_template_id : Error<
476   "using declaration cannot refer to a template specialization">;
477 def note_using_decl_target : Note<"target of using declaration">;
478 def note_using_decl_conflict : Note<"conflicting declaration">;
479 def err_using_decl_redeclaration : Error<"redeclaration of using declaration">;
480 def err_using_decl_conflict : Error<
481   "target of using declaration conflicts with declaration already in scope">;
482 def err_using_decl_conflict_reverse : Error<
483   "declaration conflicts with target of using declaration already in scope">;
484 def note_using_decl : Note<"%select{|previous }0using declaration">;
485 def err_using_decl_redeclaration_expansion : Error<
486   "using declaration pack expansion at block scope produces multiple values">;
487
488 def warn_access_decl_deprecated : Warning<
489   "access declarations are deprecated; use using declarations instead">,
490   InGroup<Deprecated>;
491 def err_access_decl : Error<
492   "ISO C++11 does not allow access declarations; "
493   "use using declarations instead">;
494 def ext_dynamic_exception_spec : ExtWarn<
495   "ISO C++1z does not allow dynamic exception specifications">,
496   InGroup<DynamicExceptionSpec>, DefaultError;
497 def warn_exception_spec_deprecated : Warning<
498   "dynamic exception specifications are deprecated">,
499   InGroup<DeprecatedDynamicExceptionSpec>, DefaultIgnore;
500 def note_exception_spec_deprecated : Note<"use '%0' instead">;
501 def warn_deprecated_copy_operation : Warning<
502   "definition of implicit copy %select{constructor|assignment operator}1 "
503   "for %0 is deprecated because it has a user-declared "
504   "%select{copy %select{assignment operator|constructor}1|destructor}2">,
505   InGroup<Deprecated>, DefaultIgnore;
506 def warn_cxx1z_compat_exception_spec_in_signature : Warning<
507   "mangled name of %0 will change in C++17 due to non-throwing exception "
508   "specification in function signature">, InGroup<CXX1zCompat>;
509
510 def warn_global_constructor : Warning<
511   "declaration requires a global constructor">,
512   InGroup<GlobalConstructors>, DefaultIgnore;
513 def warn_global_destructor : Warning<
514   "declaration requires a global destructor">,
515    InGroup<GlobalConstructors>, DefaultIgnore;
516 def warn_exit_time_destructor : Warning<
517   "declaration requires an exit-time destructor">,
518   InGroup<ExitTimeDestructors>, DefaultIgnore;
519
520 def err_invalid_thread : Error<
521   "'%0' is only allowed on variable declarations">;
522 def err_thread_non_global : Error<
523   "'%0' variables must have global storage">;
524 def err_thread_unsupported : Error<
525   "thread-local storage is not supported for the current target">;
526
527 def warn_maybe_falloff_nonvoid_function : Warning<
528   "control may reach end of non-void function">,
529   InGroup<ReturnType>;
530 def warn_falloff_nonvoid_function : Warning<
531   "control reaches end of non-void function">,
532   InGroup<ReturnType>;
533 def err_maybe_falloff_nonvoid_block : Error<
534   "control may reach end of non-void block">;
535 def err_falloff_nonvoid_block : Error<
536   "control reaches end of non-void block">;
537 def warn_maybe_falloff_nonvoid_coroutine : Warning<
538   "control may reach end of non-void coroutine">,
539   InGroup<ReturnType>;
540 def warn_falloff_nonvoid_coroutine : Warning<
541   "control reaches end of non-void coroutine">,
542   InGroup<ReturnType>;
543 def warn_suggest_noreturn_function : Warning<
544   "%select{function|method}0 %1 could be declared with attribute 'noreturn'">,
545   InGroup<MissingNoreturn>, DefaultIgnore;
546 def warn_suggest_noreturn_block : Warning<
547   "block could be declared with attribute 'noreturn'">,
548   InGroup<MissingNoreturn>, DefaultIgnore;
549
550 // Unreachable code.
551 def warn_unreachable : Warning<
552   "code will never be executed">,
553   InGroup<UnreachableCode>, DefaultIgnore;
554 def warn_unreachable_break : Warning<
555   "'break' will never be executed">,
556   InGroup<UnreachableCodeBreak>, DefaultIgnore;
557 def warn_unreachable_return : Warning<
558   "'return' will never be executed">,
559   InGroup<UnreachableCodeReturn>, DefaultIgnore;
560 def warn_unreachable_loop_increment : Warning<
561   "loop will run at most once (loop increment never executed)">,
562   InGroup<UnreachableCodeLoopIncrement>, DefaultIgnore;
563 def note_unreachable_silence : Note<
564   "silence by adding parentheses to mark code as explicitly dead">;
565
566 /// Built-in functions.
567 def ext_implicit_lib_function_decl : ExtWarn<
568   "implicitly declaring library function '%0' with type %1">,
569   InGroup<ImplicitFunctionDeclare>;
570 def note_include_header_or_declare : Note<
571   "include the header <%0> or explicitly provide a declaration for '%1'">;
572 def note_previous_builtin_declaration : Note<"%0 is a builtin with type %1">;
573 def warn_implicit_decl_requires_sysheader : Warning<
574   "declaration of built-in function '%1' requires inclusion of the header <%0>">,
575   InGroup<BuiltinRequiresHeader>;
576 def warn_redecl_library_builtin : Warning<
577   "incompatible redeclaration of library function %0">,
578   InGroup<DiagGroup<"incompatible-library-redeclaration">>;
579 def err_builtin_definition : Error<"definition of builtin function %0">;
580 def err_arm_invalid_specialreg : Error<"invalid special register for builtin">;
581 def err_invalid_cpu_supports : Error<"invalid cpu feature string for builtin">;
582 def err_builtin_needs_feature : Error<"%0 needs target feature %1">;
583 def err_function_needs_feature
584     : Error<"always_inline function %1 requires target feature '%2', but would "
585             "be inlined into function %0 that is compiled without support for "
586             "'%2'">;
587 def warn_builtin_unknown : Warning<"use of unknown builtin %0">,
588   InGroup<ImplicitFunctionDeclare>, DefaultError;
589 def warn_dyn_class_memaccess : Warning<
590   "%select{destination for|source of|first operand of|second operand of}0 this "
591   "%1 call is a pointer to %select{|class containing a }2dynamic class %3; "
592   "vtable pointer will be %select{overwritten|copied|moved|compared}4">,
593   InGroup<DiagGroup<"dynamic-class-memaccess">>;
594 def note_bad_memaccess_silence : Note<
595   "explicitly cast the pointer to silence this warning">;
596 def warn_sizeof_pointer_expr_memaccess : Warning<
597   "'%0' call operates on objects of type %1 while the size is based on a " 
598   "different type %2">, 
599   InGroup<SizeofPointerMemaccess>;
600 def warn_sizeof_pointer_expr_memaccess_note : Note<
601   "did you mean to %select{dereference the argument to 'sizeof' (and multiply "
602   "it by the number of elements)|remove the addressof in the argument to "
603   "'sizeof' (and multiply it by the number of elements)|provide an explicit "
604   "length}0?">;
605 def warn_sizeof_pointer_type_memaccess : Warning<
606   "argument to 'sizeof' in %0 call is the same pointer type %1 as the "
607   "%select{destination|source}2; expected %3 or an explicit length">,
608   InGroup<SizeofPointerMemaccess>;
609 def warn_strlcpycat_wrong_size : Warning<
610   "size argument in %0 call appears to be size of the source; "
611   "expected the size of the destination">,
612   InGroup<DiagGroup<"strlcpy-strlcat-size">>;
613 def note_strlcpycat_wrong_size : Note<
614   "change size argument to be the size of the destination">;
615 def warn_memsize_comparison : Warning<
616   "size argument in %0 call is a comparison">,
617   InGroup<DiagGroup<"memsize-comparison">>;
618 def note_memsize_comparison_paren : Note<
619   "did you mean to compare the result of %0 instead?">;
620 def note_memsize_comparison_cast_silence : Note<
621   "explicitly cast the argument to size_t to silence this warning">;
622   
623 def warn_strncat_large_size : Warning<
624   "the value of the size argument in 'strncat' is too large, might lead to a " 
625   "buffer overflow">, InGroup<StrncatSize>;
626 def warn_strncat_src_size : Warning<"size argument in 'strncat' call appears " 
627   "to be size of the source">, InGroup<StrncatSize>;
628 def warn_strncat_wrong_size : Warning<
629   "the value of the size argument to 'strncat' is wrong">, InGroup<StrncatSize>;
630 def note_strncat_wrong_size : Note<
631   "change the argument to be the free space in the destination buffer minus " 
632   "the terminating null byte">;
633
634 def warn_assume_side_effects : Warning<
635   "the argument to %0 has side effects that will be discarded">,
636   InGroup<DiagGroup<"assume">>;
637
638 def warn_memcpy_chk_overflow : Warning<
639   "%0 will always overflow destination buffer">,
640   InGroup<DiagGroup<"builtin-memcpy-chk-size">>;
641
642 /// main()
643 // static main() is not an error in C, just in C++.
644 def warn_static_main : Warning<"'main' should not be declared static">,
645     InGroup<Main>;
646 def err_static_main : Error<"'main' is not allowed to be declared static">;
647 def err_inline_main : Error<"'main' is not allowed to be declared inline">;
648 def ext_variadic_main : ExtWarn<
649   "'main' is not allowed to be declared variadic">, InGroup<Main>;
650 def ext_noreturn_main : ExtWarn<
651   "'main' is not allowed to be declared _Noreturn">, InGroup<Main>;
652 def note_main_remove_noreturn : Note<"remove '_Noreturn'">;
653 def err_constexpr_main : Error<
654   "'main' is not allowed to be declared constexpr">;
655 def err_deleted_main : Error<"'main' is not allowed to be deleted">;
656 def err_mainlike_template_decl : Error<"%0 cannot be a template">;
657 def err_main_returns_nonint : Error<"'main' must return 'int'">;
658 def ext_main_returns_nonint : ExtWarn<"return type of 'main' is not 'int'">,
659     InGroup<MainReturnType>;
660 def note_main_change_return_type : Note<"change return type to 'int'">;
661 def err_main_surplus_args : Error<"too many parameters (%0) for 'main': "
662     "must be 0, 2, or 3">;
663 def warn_main_one_arg : Warning<"only one parameter on 'main' declaration">,
664     InGroup<Main>;
665 def err_main_arg_wrong : Error<"%select{first|second|third|fourth}0 "
666     "parameter of 'main' (%select{argument count|argument array|environment|"
667     "platform-specific data}0) must be of type %1">;
668 def warn_main_returns_bool_literal : Warning<"bool literal returned from "
669     "'main'">, InGroup<Main>;
670 def err_main_global_variable :
671     Error<"main cannot be declared as global variable">;
672 def warn_main_redefined : Warning<"variable named 'main' with external linkage "
673     "has undefined behavior">, InGroup<Main>;
674 def ext_main_used : Extension<
675   "ISO C++ does not allow 'main' to be used by a program">, InGroup<Main>;
676
677 /// parser diagnostics
678 def ext_no_declarators : ExtWarn<"declaration does not declare anything">,
679   InGroup<MissingDeclarations>;
680 def ext_typedef_without_a_name : ExtWarn<"typedef requires a name">,
681   InGroup<MissingDeclarations>;
682 def err_typedef_not_identifier : Error<"typedef name must be an identifier">;
683 def err_typedef_changes_linkage : Error<"unsupported: typedef changes linkage"
684   " of anonymous type, but linkage was already computed">;
685 def note_typedef_changes_linkage : Note<"use a tag name here to establish "
686   "linkage prior to definition">;
687 def err_statically_allocated_object : Error<
688   "interface type cannot be statically allocated">;
689 def err_object_cannot_be_passed_returned_by_value : Error<
690   "interface type %1 cannot be %select{returned|passed}0 by value"
691   "; did you forget * in %1?">;
692 def err_parameters_retval_cannot_have_fp16_type : Error<
693   "%select{parameters|function return value}0 cannot have __fp16 type; did you forget * ?">;
694 def err_opencl_half_load_store : Error<
695   "%select{loading directly from|assigning directly to}0 pointer to type %1 requires "
696   "cl_khr_fp16. Use vector data %select{load|store}0 builtin functions instead">;
697 def err_opencl_cast_to_half : Error<"casting to type %0 is not allowed">;
698 def err_opencl_half_declaration : Error<
699   "declaring variable of type %0 is not allowed">;
700 def err_opencl_half_param : Error<
701   "declaring function parameter of type %0 is not allowed; did you forget * ?">;
702 def err_opencl_invalid_return : Error<
703   "declaring function return value of type %0 is not allowed %select{; did you forget * ?|}1">;
704 def warn_enum_value_overflow : Warning<"overflow in enumeration value">;
705 def warn_pragma_options_align_reset_failed : Warning<
706   "#pragma options align=reset failed: %0">,
707   InGroup<IgnoredPragmas>;
708 def err_pragma_options_align_mac68k_target_unsupported : Error<
709   "mac68k alignment pragma is not supported on this target">;
710 def warn_pragma_pack_invalid_alignment : Warning<
711   "expected #pragma pack parameter to be '1', '2', '4', '8', or '16'">,
712   InGroup<IgnoredPragmas>;
713 // Follow the Microsoft implementation.
714 def warn_pragma_pack_show : Warning<"value of #pragma pack(show) == %0">;
715 def warn_pragma_pack_pop_identifer_and_alignment : Warning<
716   "specifying both a name and alignment to 'pop' is undefined">;
717 def warn_pragma_pop_failed : Warning<"#pragma %0(pop, ...) failed: %1">,
718   InGroup<IgnoredPragmas>;
719 def warn_cxx_ms_struct :
720   Warning<"ms_struct may not produce Microsoft-compatible layouts for classes "
721           "with base classes or virtual functions">,
722   DefaultError, InGroup<IncompatibleMSStruct>;
723 def err_section_conflict : Error<"%0 causes a section type conflict with %1">;
724 def err_no_base_classes : Error<"invalid use of '__super', %0 has no base classes">;
725 def err_invalid_super_scope : Error<"invalid use of '__super', "
726   "this keyword can only be used inside class or member function scope">;
727 def err_super_in_lambda_unsupported : Error<
728   "use of '__super' inside a lambda is unsupported">;
729
730 def warn_pragma_unused_undeclared_var : Warning<
731   "undeclared variable %0 used as an argument for '#pragma unused'">,
732   InGroup<IgnoredPragmas>;
733 def warn_pragma_unused_expected_var_arg : Warning<
734   "only variables can be arguments to '#pragma unused'">,
735   InGroup<IgnoredPragmas>;
736 def err_pragma_push_visibility_mismatch : Error<
737   "#pragma visibility push with no matching #pragma visibility pop">;
738 def note_surrounding_namespace_ends_here : Note<
739   "surrounding namespace with visibility attribute ends here">;
740 def err_pragma_pop_visibility_mismatch : Error<
741   "#pragma visibility pop with no matching #pragma visibility push">;
742 def note_surrounding_namespace_starts_here : Note<
743   "surrounding namespace with visibility attribute starts here">;
744 def err_pragma_loop_invalid_argument_type : Error<
745   "invalid argument of type %0; expected an integer type">;
746 def err_pragma_loop_invalid_argument_value : Error<
747   "%select{invalid value '%0'; must be positive|value '%0' is too large}1">;
748 def err_pragma_loop_compatibility : Error<
749   "%select{incompatible|duplicate}0 directives '%1' and '%2'">;
750 def err_pragma_loop_precedes_nonloop : Error<
751   "expected a for, while, or do-while loop to follow '%0'">;
752
753 def err_pragma_attribute_matcher_subrule_contradicts_rule : Error<
754   "redundant attribute subject matcher sub-rule '%0'; '%1' already matches "
755   "those declarations">;
756 def err_pragma_attribute_matcher_negated_subrule_contradicts_subrule : Error<
757   "negated attribute subject matcher sub-rule '%0' contradicts sub-rule '%1'">;
758 def err_pragma_attribute_invalid_matchers : Error<
759   "attribute %0 can't be applied to %1">;
760 def err_pragma_attribute_stack_mismatch : Error<
761   "'#pragma clang attribute pop' with no matching '#pragma clang attribute push'">;
762 def warn_pragma_attribute_unused : Warning<
763   "unused attribute %0 in '#pragma clang attribute push' region">,
764   InGroup<PragmaClangAttribute>;
765 def note_pragma_attribute_region_ends_here : Note<
766   "'#pragma clang attribute push' regions ends here">;
767 def err_pragma_attribute_no_pop_eof : Error<"unterminated "
768   "'#pragma clang attribute push' at end of file">;
769 def note_pragma_attribute_applied_decl_here : Note<
770   "when applied to this declaration">;
771
772 /// Objective-C parser diagnostics
773 def err_duplicate_class_def : Error<
774   "duplicate interface definition for class %0">;
775 def err_undef_superclass : Error<
776   "cannot find interface declaration for %0, superclass of %1">;
777 def err_forward_superclass : Error<
778   "attempting to use the forward class %0 as superclass of %1">;
779 def err_no_nsconstant_string_class : Error<
780   "cannot find interface declaration for %0">;
781 def err_recursive_superclass : Error<
782   "trying to recursively use %0 as superclass of %1">;
783 def err_conflicting_aliasing_type : Error<"conflicting types for alias %0">;
784 def warn_undef_interface : Warning<"cannot find interface declaration for %0">;
785 def warn_duplicate_protocol_def : Warning<
786   "duplicate protocol definition of %0 is ignored">,
787   InGroup<DiagGroup<"duplicate-protocol">>;
788 def err_protocol_has_circular_dependency : Error<
789   "protocol has circular dependency">;
790 def err_undeclared_protocol : Error<"cannot find protocol declaration for %0">;
791 def warn_undef_protocolref : Warning<"cannot find protocol definition for %0">;
792 def warn_atprotocol_protocol : Warning<
793   "@protocol is using a forward protocol declaration of %0">, InGroup<AtProtocol>;
794 def warn_readonly_property : Warning<
795   "attribute 'readonly' of property %0 restricts attribute "
796   "'readwrite' of property inherited from %1">,
797   InGroup<PropertyAttr>;
798
799 def warn_property_attribute : Warning<
800   "'%1' attribute on property %0 does not match the property inherited from %2">,
801   InGroup<PropertyAttr>;
802 def warn_property_types_are_incompatible : Warning<
803   "property type %0 is incompatible with type %1 inherited from %2">,
804   InGroup<DiagGroup<"incompatible-property-type">>;
805 def warn_protocol_property_mismatch : Warning<
806   "property of type %0 was selected for synthesis">,
807   InGroup<DiagGroup<"protocol-property-synthesis-ambiguity">>;
808 def err_undef_interface : Error<"cannot find interface declaration for %0">;
809 def err_category_forward_interface : Error<
810   "cannot define %select{category|class extension}0 for undefined class %1">;
811 def err_class_extension_after_impl : Error<
812   "cannot declare class extension for %0 after class implementation">;
813 def note_implementation_declared : Note<
814   "class implementation is declared here">;
815 def note_while_in_implementation : Note<
816   "detected while default synthesizing properties in class implementation">;
817 def note_class_declared : Note<
818   "class is declared here">;
819 def note_receiver_class_declared : Note<
820   "receiver is instance of class declared here">;
821 def note_receiver_expr_here : Note<
822   "receiver expression is here">;
823 def note_receiver_is_id : Note<
824   "receiver is treated with 'id' type for purpose of method lookup">;
825 def note_suppressed_class_declare : Note<
826   "class with specified objc_requires_property_definitions attribute is declared here">;
827 def err_objc_root_class_subclass : Error<
828   "objc_root_class attribute may only be specified on a root class declaration">;
829 def err_restricted_superclass_mismatch : Error<
830   "cannot subclass a class that was declared with the "
831   "'objc_subclassing_restricted' attribute">;
832 def warn_objc_root_class_missing : Warning<
833   "class %0 defined without specifying a base class">,
834   InGroup<ObjCRootClass>;
835 def err_objc_runtime_visible_category : Error<
836   "cannot implement a category for class %0 that is only visible via the "
837   "Objective-C runtime">;
838 def err_objc_runtime_visible_subclass : Error<
839   "cannot implement subclass %0 of a superclass %1 that is only visible via the "
840   "Objective-C runtime">;
841 def note_objc_needs_superclass : Note<
842   "add a super class to fix this problem">;
843 def warn_dup_category_def : Warning<
844   "duplicate definition of category %1 on interface %0">;
845 def err_conflicting_super_class : Error<"conflicting super class name %0">;
846 def err_dup_implementation_class : Error<"reimplementation of class %0">;
847 def err_dup_implementation_category : Error<
848   "reimplementation of category %1 for class %0">;
849 def err_conflicting_ivar_type : Error<
850   "instance variable %0 has conflicting type%diff{: $ vs $|}1,2">;
851 def err_duplicate_ivar_declaration : Error<
852   "instance variable is already declared">;
853 def warn_on_superclass_use : Warning<
854   "class implementation may not have super class">;
855 def err_conflicting_ivar_bitwidth : Error<
856   "instance variable %0 has conflicting bit-field width">;
857 def err_conflicting_ivar_name : Error<
858   "conflicting instance variable names: %0 vs %1">;
859 def err_inconsistent_ivar_count : Error<
860   "inconsistent number of instance variables specified">;
861 def warn_undef_method_impl : Warning<"method definition for %0 not found">,
862   InGroup<DiagGroup<"incomplete-implementation">>;
863
864 def warn_conflicting_overriding_ret_types : Warning<
865   "conflicting return type in "
866   "declaration of %0%diff{: $ vs $|}1,2">,
867   InGroup<OverridingMethodMismatch>, DefaultIgnore;
868
869 def warn_conflicting_ret_types : Warning<
870   "conflicting return type in "
871   "implementation of %0%diff{: $ vs $|}1,2">,
872   InGroup<MismatchedReturnTypes>;
873
874 def warn_conflicting_overriding_ret_type_modifiers : Warning<
875   "conflicting distributed object modifiers on return type "
876   "in declaration of %0">,
877   InGroup<OverridingMethodMismatch>, DefaultIgnore;
878
879 def warn_conflicting_ret_type_modifiers : Warning<
880   "conflicting distributed object modifiers on return type "
881   "in implementation of %0">,
882   InGroup<DistributedObjectModifiers>;
883
884 def warn_non_covariant_overriding_ret_types : Warning<
885   "conflicting return type in "
886   "declaration of %0: %1 vs %2">,
887   InGroup<OverridingMethodMismatch>, DefaultIgnore;
888
889 def warn_non_covariant_ret_types : Warning<
890   "conflicting return type in "
891   "implementation of %0: %1 vs %2">,
892   InGroup<MethodSignatures>, DefaultIgnore;
893
894 def warn_conflicting_overriding_param_types : Warning<
895   "conflicting parameter types in "
896   "declaration of %0%diff{: $ vs $|}1,2">,
897   InGroup<OverridingMethodMismatch>, DefaultIgnore;
898
899 def warn_conflicting_param_types : Warning<
900   "conflicting parameter types in "
901   "implementation of %0%diff{: $ vs $|}1,2">,
902   InGroup<MismatchedParameterTypes>;
903
904 def warn_conflicting_param_modifiers : Warning<
905   "conflicting distributed object modifiers on parameter type "
906   "in implementation of %0">,
907   InGroup<DistributedObjectModifiers>;
908
909 def warn_conflicting_overriding_param_modifiers : Warning<
910   "conflicting distributed object modifiers on parameter type "
911   "in declaration of %0">,
912   InGroup<OverridingMethodMismatch>, DefaultIgnore;
913
914 def warn_non_contravariant_overriding_param_types : Warning<
915   "conflicting parameter types in "
916   "declaration of %0: %1 vs %2">,
917   InGroup<OverridingMethodMismatch>, DefaultIgnore;
918
919 def warn_non_contravariant_param_types : Warning<
920   "conflicting parameter types in "
921   "implementation of %0: %1 vs %2">,
922   InGroup<MethodSignatures>, DefaultIgnore;
923
924 def warn_conflicting_overriding_variadic :Warning<
925   "conflicting variadic declaration of method and its "
926   "implementation">,
927   InGroup<OverridingMethodMismatch>, DefaultIgnore;
928
929 def warn_conflicting_variadic :Warning<
930   "conflicting variadic declaration of method and its "
931   "implementation">;
932
933 def warn_category_method_impl_match:Warning<
934   "category is implementing a method which will also be implemented"
935   " by its primary class">, InGroup<ObjCProtocolMethodImpl>;
936
937 def warn_implements_nscopying : Warning<
938 "default assign attribute on property %0 which implements "
939 "NSCopying protocol is not appropriate with -fobjc-gc[-only]">;
940
941 def warn_multiple_method_decl : Warning<"multiple methods named %0 found">,
942   InGroup<ObjCMultipleMethodNames>;
943 def warn_strict_multiple_method_decl : Warning<
944   "multiple methods named %0 found">, InGroup<StrictSelector>, DefaultIgnore;
945 def warn_accessor_property_type_mismatch : Warning<
946   "type of property %0 does not match type of accessor %1">;
947 def note_conv_function_declared_at : Note<"type conversion function declared here">;
948 def note_method_declared_at : Note<"method %0 declared here">;
949 def note_property_attribute : Note<"property %0 is declared "
950   "%select{deprecated|unavailable|partial}1 here">;
951 def err_setter_type_void : Error<"type of setter must be void">;
952 def err_duplicate_method_decl : Error<"duplicate declaration of method %0">;
953 def warn_duplicate_method_decl : 
954   Warning<"multiple declarations of method %0 found and ignored">, 
955   InGroup<MethodDuplicate>, DefaultIgnore;
956 def warn_objc_cdirective_format_string :
957   Warning<"using %0 directive in %select{NSString|CFString}1 "
958           "which is being passed as a formatting argument to the formatting "
959           "%select{method|CFfunction}2">,
960   InGroup<ObjCCStringFormat>, DefaultIgnore;
961 def err_objc_var_decl_inclass : 
962     Error<"cannot declare variable inside @interface or @protocol">;
963 def err_missing_method_context : Error<
964   "missing context for method declaration">;
965 def err_objc_property_attr_mutually_exclusive : Error<
966   "property attributes '%0' and '%1' are mutually exclusive">;
967 def err_objc_property_requires_object : Error<
968   "property with '%0' attribute must be of object type">;
969 def warn_objc_property_no_assignment_attribute : Warning<
970   "no 'assign', 'retain', or 'copy' attribute is specified - "
971   "'assign' is assumed">,
972   InGroup<ObjCPropertyNoAttribute>;
973 def warn_objc_isa_use : Warning<
974   "direct access to Objective-C's isa is deprecated in favor of "
975   "object_getClass()">, InGroup<DeprecatedObjCIsaUsage>;
976 def warn_objc_isa_assign : Warning<
977   "assignment to Objective-C's isa is deprecated in favor of "
978   "object_setClass()">, InGroup<DeprecatedObjCIsaUsage>;
979 def warn_objc_pointer_masking : Warning<
980   "bitmasking for introspection of Objective-C object pointers is strongly "
981   "discouraged">,
982   InGroup<ObjCPointerIntrospect>;
983 def warn_objc_pointer_masking_performSelector : Warning<warn_objc_pointer_masking.Text>,
984   InGroup<ObjCPointerIntrospectPerformSelector>;
985 def warn_objc_property_default_assign_on_object : Warning<
986   "default property attribute 'assign' not appropriate for non-GC object">,
987   InGroup<ObjCPropertyNoAttribute>;
988 def warn_property_attr_mismatch : Warning<
989   "property attribute in class extension does not match the primary class">,
990   InGroup<PropertyAttr>;
991 def warn_property_implicitly_mismatched : Warning <
992   "primary property declaration is implicitly strong while redeclaration "
993   "in class extension is weak">,
994   InGroup<DiagGroup<"objc-property-implicit-mismatch">>;
995 def warn_objc_property_copy_missing_on_block : Warning<
996     "'copy' attribute must be specified for the block property "
997     "when -fobjc-gc-only is specified">;
998 def warn_objc_property_retain_of_block : Warning<
999     "retain'ed block property does not copy the block "
1000     "- use copy attribute instead">, InGroup<ObjCRetainBlockProperty>;
1001 def warn_objc_readonly_property_has_setter : Warning<
1002     "setter cannot be specified for a readonly property">,
1003     InGroup<ObjCReadonlyPropertyHasSetter>;
1004 def warn_atomic_property_rule : Warning<
1005   "writable atomic property %0 cannot pair a synthesized %select{getter|setter}1 "
1006   "with a user defined %select{getter|setter}2">,
1007   InGroup<DiagGroup<"atomic-property-with-user-defined-accessor">>;
1008 def note_atomic_property_fixup_suggest : Note<"setter and getter must both be "
1009   "synthesized, or both be user defined,or the property must be nonatomic">;
1010 def err_atomic_property_nontrivial_assign_op : Error<
1011   "atomic property of reference type %0 cannot have non-trivial assignment"
1012   " operator">;
1013 def warn_cocoa_naming_owned_rule : Warning<
1014   "property follows Cocoa naming"
1015   " convention for returning 'owned' objects">,
1016   InGroup<DiagGroup<"objc-property-matches-cocoa-ownership-rule">>;
1017 def err_cocoa_naming_owned_rule : Error<
1018   "property follows Cocoa naming"
1019   " convention for returning 'owned' objects">;
1020 def note_cocoa_naming_declare_family : Note<
1021   "explicitly declare getter %objcinstance0 with '%1' to return an 'unowned' "
1022   "object">;
1023 def warn_auto_synthesizing_protocol_property :Warning<
1024   "auto property synthesis will not synthesize property %0"
1025   " declared in protocol %1">,
1026   InGroup<DiagGroup<"objc-protocol-property-synthesis">>;
1027 def warn_no_autosynthesis_shared_ivar_property : Warning <
1028   "auto property synthesis will not synthesize property "
1029   "%0 because it cannot share an ivar with another synthesized property">,
1030   InGroup<ObjCNoPropertyAutoSynthesis>;
1031 def warn_no_autosynthesis_property : Warning<
1032   "auto property synthesis will not synthesize property "
1033   "%0 because it is 'readwrite' but it will be synthesized 'readonly' "
1034   "via another property">,
1035   InGroup<ObjCNoPropertyAutoSynthesis>;
1036 def warn_autosynthesis_property_in_superclass : Warning<
1037   "auto property synthesis will not synthesize property "
1038   "%0; it will be implemented by its superclass, use @dynamic to "
1039   "acknowledge intention">,
1040   InGroup<ObjCNoPropertyAutoSynthesis>;
1041 def warn_autosynthesis_property_ivar_match :Warning<
1042   "autosynthesized property %0 will use %select{|synthesized}1 instance variable "
1043   "%2, not existing instance variable %3">,
1044   InGroup<DiagGroup<"objc-autosynthesis-property-ivar-name-match">>;
1045 def warn_missing_explicit_synthesis : Warning <
1046   "auto property synthesis is synthesizing property not explicitly synthesized">,
1047   InGroup<DiagGroup<"objc-missing-property-synthesis">>, DefaultIgnore;
1048 def warn_property_getter_owning_mismatch : Warning<
1049   "property declared as returning non-retained objects"
1050   "; getter returning retained objects">;
1051 def warn_property_redecl_getter_mismatch : Warning<
1052   "getter name mismatch between property redeclaration (%1) and its original "
1053   "declaration (%0)">, InGroup<PropertyAttr>;
1054 def err_property_setter_ambiguous_use : Error<
1055   "synthesized properties %0 and %1 both claim setter %2 -"
1056   " use of this setter will cause unexpected behavior">;
1057 def warn_default_atomic_custom_getter_setter : Warning<
1058   "atomic by default property %0 has a user defined %select{getter|setter}1 "
1059   "(property should be marked 'atomic' if this is intended)">,
1060   InGroup<CustomAtomic>, DefaultIgnore;
1061 def err_use_continuation_class : Error<
1062   "illegal redeclaration of property in class extension %0"
1063   " (attribute must be 'readwrite', while its primary must be 'readonly')">;
1064 def err_type_mismatch_continuation_class : Error<
1065   "type of property %0 in class extension does not match "
1066   "property type in primary class">;
1067 def err_use_continuation_class_redeclaration_readwrite : Error<
1068   "illegal redeclaration of 'readwrite' property in class extension %0"
1069   " (perhaps you intended this to be a 'readwrite' redeclaration of a "
1070   "'readonly' public property?)">;
1071 def err_continuation_class : Error<"class extension has no primary class">;
1072 def err_property_type : Error<"property cannot have array or function type %0">;
1073 def err_missing_property_context : Error<
1074   "missing context for property implementation declaration">;
1075 def err_bad_property_decl : Error<
1076   "property implementation must have its declaration in interface %0 or one of "
1077   "its extensions">;
1078 def err_category_property : Error<
1079   "property declared in category %0 cannot be implemented in "
1080   "class implementation">;
1081 def note_property_declare : Note<
1082   "property declared here">;
1083 def note_protocol_property_declare : Note<
1084   "it could also be property of type %0 declared here">;
1085 def note_property_synthesize : Note<
1086   "property synthesized here">;
1087 def err_synthesize_category_decl : Error<
1088   "@synthesize not allowed in a category's implementation">;
1089 def err_synthesize_on_class_property : Error<
1090   "@synthesize not allowed on a class property %0">;
1091 def err_missing_property_interface : Error<
1092   "property implementation in a category with no category declaration">;
1093 def err_bad_category_property_decl : Error<
1094   "property implementation must have its declaration in the category %0">;
1095 def err_bad_property_context : Error<
1096   "property implementation must be in a class or category implementation">;
1097 def err_missing_property_ivar_decl : Error<
1098   "synthesized property %0 must either be named the same as a compatible"
1099   " instance variable or must explicitly name an instance variable">;
1100 def err_arc_perform_selector_retains : Error<
1101   "performSelector names a selector which retains the object">;
1102 def warn_arc_perform_selector_leaks : Warning<
1103   "performSelector may cause a leak because its selector is unknown">,
1104   InGroup<DiagGroup<"arc-performSelector-leaks">>;
1105 def warn_dealloc_in_category : Warning<
1106 "-dealloc is being overridden in a category">,
1107 InGroup<DeallocInCategory>;
1108 def err_gc_weak_property_strong_type : Error<
1109   "weak attribute declared on a __strong type property in GC mode">;
1110 def warn_arc_repeated_use_of_weak : Warning <
1111   "weak %select{variable|property|implicit property|instance variable}0 %1 is "
1112   "accessed multiple times in this %select{function|method|block|lambda}2 "
1113   "but may be unpredictably set to nil; assign to a strong variable to keep "
1114   "the object alive">,
1115   InGroup<ARCRepeatedUseOfWeak>, DefaultIgnore;
1116 def warn_implicitly_retains_self : Warning <
1117   "block implicitly retains 'self'; explicitly mention 'self' to indicate "
1118   "this is intended behavior">,
1119   InGroup<DiagGroup<"implicit-retain-self">>, DefaultIgnore;
1120 def warn_arc_possible_repeated_use_of_weak : Warning <
1121   "weak %select{variable|property|implicit property|instance variable}0 %1 may "
1122   "be accessed multiple times in this %select{function|method|block|lambda}2 "
1123   "and may be unpredictably set to nil; assign to a strong variable to keep "
1124   "the object alive">,
1125   InGroup<ARCRepeatedUseOfWeakMaybe>, DefaultIgnore;
1126 def note_arc_weak_also_accessed_here : Note<
1127   "also accessed here">;
1128 def err_incomplete_synthesized_property : Error<
1129   "cannot synthesize property %0 with incomplete type %1">;
1130
1131 def err_property_ivar_type : Error<
1132   "type of property %0 (%1) does not match type of instance variable %2 (%3)">;
1133 def err_property_accessor_type : Error<
1134   "type of property %0 (%1) does not match type of accessor %2 (%3)">;
1135 def err_ivar_in_superclass_use : Error<
1136   "property %0 attempting to use instance variable %1 declared in super class %2">;
1137 def err_weak_property : Error<
1138   "existing instance variable %1 for __weak property %0 must be __weak">;
1139 def err_strong_property : Error<
1140   "existing instance variable %1 for strong property %0 may not be __weak">;
1141 def err_dynamic_property_ivar_decl : Error<
1142   "dynamic property cannot have instance variable specification">;
1143 def err_duplicate_ivar_use : Error<
1144   "synthesized properties %0 and %1 both claim instance variable %2">;
1145 def err_property_implemented : Error<"property %0 is already implemented">;
1146 def warn_objc_missing_super_call : Warning<
1147   "method possibly missing a [super %0] call">,
1148   InGroup<ObjCMissingSuperCalls>;
1149 def err_dealloc_bad_result_type : Error<
1150   "dealloc return type must be correctly specified as 'void' under ARC, "
1151   "instead of %0">;
1152 def warn_undeclared_selector : Warning<
1153   "undeclared selector %0">, InGroup<UndeclaredSelector>, DefaultIgnore;
1154 def warn_undeclared_selector_with_typo : Warning<
1155   "undeclared selector %0; did you mean %1?">,
1156   InGroup<UndeclaredSelector>, DefaultIgnore;
1157 def warn_implicit_atomic_property : Warning<
1158   "property is assumed atomic by default">, InGroup<ImplicitAtomic>, DefaultIgnore;
1159 def note_auto_readonly_iboutlet_fixup_suggest : Note<
1160   "property should be changed to be readwrite">;
1161 def warn_auto_readonly_iboutlet_property : Warning<
1162   "readonly IBOutlet property %0 when auto-synthesized may "
1163   "not work correctly with 'nib' loader">,
1164   InGroup<DiagGroup<"readonly-iboutlet-property">>;
1165 def warn_auto_implicit_atomic_property : Warning<
1166   "property is assumed atomic when auto-synthesizing the property">,
1167   InGroup<ImplicitAtomic>, DefaultIgnore;
1168 def warn_unimplemented_selector:  Warning<
1169   "no method with selector %0 is implemented in this translation unit">, 
1170   InGroup<Selector>, DefaultIgnore;
1171 def warn_unimplemented_protocol_method : Warning<
1172   "method %0 in protocol %1 not implemented">, InGroup<Protocol>;
1173 def warn_multiple_selectors: Warning<
1174   "several methods with selector %0 of mismatched types are found "
1175   "for the @selector expression">,
1176   InGroup<SelectorTypeMismatch>, DefaultIgnore;
1177
1178 def err_objc_kindof_nonobject : Error<
1179   "'__kindof' specifier cannot be applied to non-object type %0">;
1180 def err_objc_kindof_wrong_position : Error<
1181   "'__kindof' type specifier must precede the declarator">;
1182
1183 // C++ declarations
1184 def err_static_assert_expression_is_not_constant : Error<
1185   "static_assert expression is not an integral constant expression">;
1186 def err_static_assert_failed : Error<"static_assert failed%select{ %1|}0">;
1187 def ext_static_assert_no_message : ExtWarn<
1188   "static_assert with no message is a C++1z extension">, InGroup<CXX1z>;
1189 def warn_cxx14_compat_static_assert_no_message : Warning<
1190   "static_assert with no message is incompatible with C++ standards before C++1z">,
1191   DefaultIgnore, InGroup<CXXPre1zCompat>;
1192
1193 def ext_inline_variable : ExtWarn<
1194   "inline variables are a C++1z extension">, InGroup<CXX1z>;
1195 def warn_cxx14_compat_inline_variable : Warning<
1196   "inline variables are incompatible with C++ standards before C++1z">,
1197   DefaultIgnore, InGroup<CXXPre1zCompat>;
1198
1199 def warn_inline_namespace_reopened_noninline : Warning<
1200   "inline namespace reopened as a non-inline namespace">;
1201 def err_inline_namespace_mismatch : Error<
1202   "non-inline namespace cannot be reopened as inline">;
1203
1204 def err_unexpected_friend : Error<
1205   "friends can only be classes or functions">;
1206 def ext_enum_friend : ExtWarn<
1207   "befriending enumeration type %0 is a C++11 extension">, InGroup<CXX11>;
1208 def warn_cxx98_compat_enum_friend : Warning<
1209   "befriending enumeration type %0 is incompatible with C++98">,
1210   InGroup<CXX98Compat>, DefaultIgnore;
1211 def ext_nonclass_type_friend : ExtWarn<
1212   "non-class friend type %0 is a C++11 extension">, InGroup<CXX11>;
1213 def warn_cxx98_compat_nonclass_type_friend : Warning<
1214   "non-class friend type %0 is incompatible with C++98">,
1215   InGroup<CXX98Compat>, DefaultIgnore;
1216 def err_friend_is_member : Error<
1217   "friends cannot be members of the declaring class">;
1218 def warn_cxx98_compat_friend_is_member : Warning<
1219   "friend declaration naming a member of the declaring class is incompatible "
1220   "with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
1221 def ext_unelaborated_friend_type : ExtWarn<
1222   "unelaborated friend declaration is a C++11 extension; specify "
1223   "'%select{struct|interface|union|class|enum}0' to befriend %1">,
1224   InGroup<CXX11>;
1225 def warn_cxx98_compat_unelaborated_friend_type : Warning<
1226   "befriending %1 without '%select{struct|interface|union|class|enum}0' "
1227   "keyword is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
1228 def err_qualified_friend_not_found : Error<
1229   "no function named %0 with type %1 was found in the specified scope">;
1230 def err_introducing_special_friend : Error<
1231   "%plural{[0,2]:must use a qualified name when declaring|3:cannot declare}0"
1232   " a %select{constructor|destructor|conversion operator|deduction guide}0 "
1233   "as a friend">;
1234 def err_tagless_friend_type_template : Error<
1235   "friend type templates must use an elaborated type">;
1236 def err_no_matching_local_friend : Error<
1237   "no matching function found in local scope">;
1238 def err_no_matching_local_friend_suggest : Error<
1239   "no matching function %0 found in local scope; did you mean %3?">;
1240 def err_partial_specialization_friend : Error<
1241   "partial specialization cannot be declared as a friend">;
1242 def err_qualified_friend_def : Error<
1243   "friend function definition cannot be qualified with '%0'">;
1244 def err_friend_def_in_local_class : Error<
1245   "friend function cannot be defined in a local class">;
1246 def err_friend_not_first_in_declaration : Error<
1247   "'friend' must appear first in a non-function declaration">;
1248 def err_using_decl_friend : Error<
1249   "cannot befriend target of using declaration">;
1250 def warn_template_qualified_friend_unsupported : Warning<
1251   "dependent nested name specifier '%0' for friend class declaration is "
1252   "not supported; turning off access control for %1">,
1253   InGroup<UnsupportedFriend>;
1254 def warn_template_qualified_friend_ignored : Warning<
1255   "dependent nested name specifier '%0' for friend template declaration is "
1256   "not supported; ignoring this friend declaration">,
1257   InGroup<UnsupportedFriend>;
1258 def ext_friend_tag_redecl_outside_namespace : ExtWarn<
1259   "unqualified friend declaration referring to type outside of the nearest "
1260   "enclosing namespace is a Microsoft extension; add a nested name specifier">,
1261   InGroup<MicrosoftUnqualifiedFriend>;
1262 def err_pure_friend : Error<"friend declaration cannot have a pure-specifier">;
1263
1264 def err_invalid_member_in_interface : Error<
1265   "%select{data member |non-public member function |static member function |"
1266           "user-declared constructor|user-declared destructor|operator |"
1267           "nested class }0%1 is not permitted within an interface type">;
1268 def err_invalid_base_in_interface : Error<
1269   "interface type cannot inherit from "
1270   "%select{'struct|non-public 'interface|'class}0 %1'">;
1271
1272 def err_abstract_type_in_decl : Error<
1273   "%select{return|parameter|variable|field|instance variable|"
1274   "synthesized instance variable}0 type %1 is an abstract class">;
1275 def err_allocation_of_abstract_type : Error<
1276   "allocating an object of abstract class type %0">;
1277 def err_throw_abstract_type : Error<
1278   "cannot throw an object of abstract type %0">;
1279 def err_array_of_abstract_type : Error<"array of abstract class type %0">;
1280 def err_capture_of_abstract_type : Error<
1281   "by-copy capture of value of abstract type %0">;
1282 def err_capture_of_incomplete_type : Error<
1283   "by-copy capture of variable %0 with incomplete type %1">;
1284 def err_capture_default_non_local : Error<
1285   "non-local lambda expression cannot have a capture-default">;
1286
1287 def err_multiple_final_overriders : Error<
1288   "virtual function %q0 has more than one final overrider in %1">; 
1289 def note_final_overrider : Note<"final overrider of %q0 in %1">;
1290
1291 def err_type_defined_in_type_specifier : Error<
1292   "%0 cannot be defined in a type specifier">;
1293 def err_type_defined_in_result_type : Error<
1294   "%0 cannot be defined in the result type of a function">;
1295 def err_type_defined_in_param_type : Error<
1296   "%0 cannot be defined in a parameter type">;
1297 def err_type_defined_in_alias_template : Error<
1298   "%0 cannot be defined in a type alias template">;
1299 def err_type_defined_in_condition : Error<
1300   "%0 cannot be defined in a condition">;
1301
1302 def note_pure_virtual_function : Note<
1303   "unimplemented pure virtual method %0 in %1">;
1304
1305 def note_pure_qualified_call_kext : Note<
1306   "qualified call to %0::%1 is treated as a virtual call to %1 due to -fapple-kext">;
1307
1308 def err_deleted_decl_not_first : Error<
1309   "deleted definition must be first declaration">;
1310
1311 def err_deleted_override : Error<
1312   "deleted function %0 cannot override a non-deleted function">;
1313
1314 def err_non_deleted_override : Error<
1315   "non-deleted function %0 cannot override a deleted function">;
1316
1317 def warn_weak_vtable : Warning<
1318   "%0 has no out-of-line virtual method definitions; its vtable will be "
1319   "emitted in every translation unit">,
1320   InGroup<DiagGroup<"weak-vtables">>, DefaultIgnore;
1321 def warn_weak_template_vtable : Warning<
1322   "explicit template instantiation %0 will emit a vtable in every "
1323   "translation unit">,
1324   InGroup<DiagGroup<"weak-template-vtables">>, DefaultIgnore;
1325
1326 def ext_using_undefined_std : ExtWarn<
1327   "using directive refers to implicitly-defined namespace 'std'">;
1328   
1329 // C++ exception specifications
1330 def err_exception_spec_in_typedef : Error<
1331   "exception specifications are not allowed in %select{typedefs|type aliases}0">;
1332 def err_distant_exception_spec : Error<
1333   "exception specifications are not allowed beyond a single level "
1334   "of indirection">;
1335 def err_incomplete_in_exception_spec : Error<
1336   "%select{|pointer to |reference to }0incomplete type %1 is not allowed "
1337   "in exception specification">;
1338 def ext_incomplete_in_exception_spec : ExtWarn<err_incomplete_in_exception_spec.Text>,
1339   InGroup<MicrosoftExceptionSpec>;
1340 def err_rref_in_exception_spec : Error<
1341   "rvalue reference type %0 is not allowed in exception specification">;
1342 def err_mismatched_exception_spec : Error<
1343   "exception specification in declaration does not match previous declaration">;
1344 def ext_mismatched_exception_spec : ExtWarn<err_mismatched_exception_spec.Text>,
1345   InGroup<MicrosoftExceptionSpec>;
1346 def err_override_exception_spec : Error<
1347   "exception specification of overriding function is more lax than "
1348   "base version">;
1349 def ext_override_exception_spec : ExtWarn<err_override_exception_spec.Text>,
1350   InGroup<MicrosoftExceptionSpec>;
1351 def err_incompatible_exception_specs : Error<
1352   "target exception specification is not superset of source">;
1353 def warn_incompatible_exception_specs : Warning<
1354   err_incompatible_exception_specs.Text>, InGroup<IncompatibleExceptionSpec>;
1355 def err_deep_exception_specs_differ : Error<
1356   "exception specifications of %select{return|argument}0 types differ">;
1357 def warn_deep_exception_specs_differ : Warning<
1358   err_deep_exception_specs_differ.Text>, InGroup<IncompatibleExceptionSpec>;
1359 def err_missing_exception_specification : Error<
1360   "%0 is missing exception specification '%1'">;
1361 def ext_missing_exception_specification : ExtWarn<
1362   err_missing_exception_specification.Text>,
1363   InGroup<DiagGroup<"missing-exception-spec">>;
1364 def ext_ms_missing_exception_specification : ExtWarn<
1365   err_missing_exception_specification.Text>,
1366   InGroup<MicrosoftExceptionSpec>;
1367 def err_noexcept_needs_constant_expression : Error<
1368   "argument to noexcept specifier must be a constant expression">;
1369 def err_exception_spec_not_parsed : Error<
1370   "exception specification is not available until end of class definition">;
1371
1372 // C++ access checking
1373 def err_class_redeclared_with_different_access : Error<
1374   "%0 redeclared with '%1' access">;
1375 def err_access : Error<
1376   "%1 is a %select{private|protected}0 member of %3">, AccessControl;
1377 def ext_ms_using_declaration_inaccessible : ExtWarn<
1378   "using declaration referring to inaccessible member '%0' (which refers "
1379   "to accessible member '%1') is a Microsoft compatibility extension">,
1380     AccessControl, InGroup<MicrosoftUsingDecl>;
1381 def err_access_ctor : Error<
1382   "calling a %select{private|protected}0 constructor of class %2">, 
1383   AccessControl;
1384 def ext_rvalue_to_reference_access_ctor : Extension<
1385   "C++98 requires an accessible copy constructor for class %2 when binding "
1386   "a reference to a temporary; was %select{private|protected}0">,
1387   AccessControl, InGroup<BindToTemporaryCopy>;
1388 def err_access_base_ctor : Error<
1389   // The ERRORs represent other special members that aren't constructors, in
1390   // hopes that someone will bother noticing and reporting if they appear
1391   "%select{base class|inherited virtual base class}0 %1 has %select{private|"
1392   "protected}3 %select{default |copy |move |*ERROR* |*ERROR* "
1393   "|*ERROR*|}2constructor">, AccessControl;
1394 def err_access_field_ctor : Error<
1395   // The ERRORs represent other special members that aren't constructors, in
1396   // hopes that someone will bother noticing and reporting if they appear
1397   "field of type %0 has %select{private|protected}2 "
1398   "%select{default |copy |move |*ERROR* |*ERROR* |*ERROR* |}1constructor">,
1399   AccessControl;
1400 def err_access_friend_function : Error<
1401   "friend function %1 is a %select{private|protected}0 member of %3">,
1402   AccessControl;
1403
1404 def err_access_dtor : Error<
1405   "calling a %select{private|protected}1 destructor of class %0">, 
1406   AccessControl;
1407 def err_access_dtor_base :
1408     Error<"base class %0 has %select{private|protected}1 destructor">,
1409     AccessControl;
1410 def err_access_dtor_vbase :
1411     Error<"inherited virtual base class %1 has "
1412     "%select{private|protected}2 destructor">,
1413     AccessControl;
1414 def err_access_dtor_temp :
1415     Error<"temporary of type %0 has %select{private|protected}1 destructor">,
1416     AccessControl;
1417 def err_access_dtor_exception :
1418     Error<"exception object of type %0 has %select{private|protected}1 "
1419           "destructor">, AccessControl;
1420 def err_access_dtor_field :
1421     Error<"field of type %1 has %select{private|protected}2 destructor">,
1422     AccessControl;
1423 def err_access_dtor_var :
1424     Error<"variable of type %1 has %select{private|protected}2 destructor">,
1425     AccessControl;
1426 def err_access_dtor_ivar :
1427     Error<"instance variable of type %0 has %select{private|protected}1 "
1428           "destructor">,
1429     AccessControl;
1430 def note_previous_access_declaration : Note<
1431   "previously declared '%1' here">;
1432 def note_access_natural : Note<
1433   "%select{|implicitly }1declared %select{private|protected}0 here">;
1434 def note_access_constrained_by_path : Note<
1435   "constrained by %select{|implicitly }1%select{private|protected}0"
1436   " inheritance here">;
1437 def note_access_protected_restricted_noobject : Note<
1438   "must name member using the type of the current context %0">;
1439 def note_access_protected_restricted_ctordtor : Note<
1440   "protected %select{constructor|destructor}0 can only be used to "
1441   "%select{construct|destroy}0 a base class subobject">;
1442 def note_access_protected_restricted_object : Note<
1443   "can only access this member on an object of type %0">;
1444 def warn_cxx98_compat_sfinae_access_control : Warning<
1445   "substitution failure due to access control is incompatible with C++98">,
1446   InGroup<CXX98Compat>, DefaultIgnore, NoSFINAE;
1447   
1448 // C++ name lookup
1449 def err_incomplete_nested_name_spec : Error<
1450   "incomplete type %0 named in nested name specifier">;
1451 def err_dependent_nested_name_spec : Error<
1452   "nested name specifier for a declaration cannot depend on a template "
1453   "parameter">;
1454 def err_nested_name_member_ref_lookup_ambiguous : Error<
1455   "lookup of %0 in member access expression is ambiguous">;
1456 def ext_nested_name_member_ref_lookup_ambiguous : ExtWarn<
1457   "lookup of %0 in member access expression is ambiguous; using member of %1">,
1458   InGroup<AmbigMemberTemplate>;
1459 def note_ambig_member_ref_object_type : Note<
1460   "lookup in the object type %0 refers here">;
1461 def note_ambig_member_ref_scope : Note<
1462   "lookup from the current scope refers here">;
1463 def err_qualified_member_nonclass : Error<
1464   "qualified member access refers to a member in %0">;
1465 def err_incomplete_member_access : Error<
1466   "member access into incomplete type %0">;
1467 def err_incomplete_type : Error<
1468   "incomplete type %0 where a complete type is required">;
1469 def warn_cxx98_compat_enum_nested_name_spec : Warning<
1470   "enumeration type in nested name specifier is incompatible with C++98">,
1471   InGroup<CXX98Compat>, DefaultIgnore;
1472 def err_nested_name_spec_is_not_class : Error<
1473   "%0 cannot appear before '::' because it is not a class"
1474   "%select{ or namespace|, namespace, or enumeration}1; did you mean ':'?">;
1475 def ext_nested_name_spec_is_enum : ExtWarn<
1476   "use of enumeration in a nested name specifier is a C++11 extension">,
1477   InGroup<CXX11>;
1478 def err_out_of_line_qualified_id_type_names_constructor : Error<
1479   "qualified reference to %0 is a constructor name rather than a "
1480   "%select{template name|type}1 in this context">;
1481 def ext_out_of_line_qualified_id_type_names_constructor : ExtWarn<
1482   "ISO C++ specifies that "
1483   "qualified reference to %0 is a constructor name rather than a "
1484   "%select{template name|type}1 in this context, despite preceding "
1485   "%select{'typename'|'template'}2 keyword">, SFINAEFailure,
1486   InGroup<DiagGroup<"injected-class-name">>;
1487
1488 // C++ class members
1489 def err_storageclass_invalid_for_member : Error<
1490   "storage class specified for a member declaration">;
1491 def err_mutable_function : Error<"'mutable' cannot be applied to functions">;
1492 def err_mutable_reference : Error<"'mutable' cannot be applied to references">;
1493 def ext_mutable_reference : ExtWarn<
1494   "'mutable' on a reference type is a Microsoft extension">,
1495   InGroup<MicrosoftMutableReference>;
1496 def err_mutable_const : Error<"'mutable' and 'const' cannot be mixed">;
1497 def err_mutable_nonmember : Error<
1498   "'mutable' can only be applied to member variables">;
1499 def err_virtual_in_union : Error<
1500   "unions cannot have virtual functions">;
1501 def err_virtual_non_function : Error<
1502   "'virtual' can only appear on non-static member functions">;
1503 def err_virtual_out_of_class : Error<
1504   "'virtual' can only be specified inside the class definition">;
1505 def err_virtual_member_function_template : Error<
1506   "'virtual' cannot be specified on member function templates">;
1507 def err_static_overrides_virtual : Error<
1508   "'static' member function %0 overrides a virtual function in a base class">;
1509 def err_explicit_non_function : Error<
1510   "'explicit' can only appear on non-static member functions">;
1511 def err_explicit_out_of_class : Error<
1512   "'explicit' can only be specified inside the class definition">;
1513 def err_explicit_non_ctor_or_conv_function : Error<
1514   "'explicit' can only be applied to a constructor or conversion function">;
1515 def err_static_not_bitfield : Error<"static member %0 cannot be a bit-field">;
1516 def err_static_out_of_line : Error<
1517   "'static' can only be specified inside the class definition">;
1518 def err_storage_class_for_static_member : Error<
1519   "static data member definition cannot specify a storage class">;
1520 def err_typedef_not_bitfield : Error<"typedef member %0 cannot be a bit-field">;
1521 def err_not_integral_type_bitfield : Error<
1522   "bit-field %0 has non-integral type %1">;
1523 def err_not_integral_type_anon_bitfield : Error<
1524   "anonymous bit-field has non-integral type %0">;
1525 def err_member_function_initialization : Error<
1526   "initializer on function does not look like a pure-specifier">;
1527 def err_non_virtual_pure : Error<
1528   "%0 is not virtual and cannot be declared pure">;
1529 def ext_pure_function_definition : ExtWarn<
1530   "function definition with pure-specifier is a Microsoft extension">,
1531   InGroup<MicrosoftPureDefinition>;
1532 def err_implicit_object_parameter_init : Error<
1533   "cannot initialize object parameter of type %0 with an expression "
1534   "of type %1">;
1535 def err_qualified_member_of_unrelated : Error<
1536   "%q0 is not a member of class %1">;
1537
1538 def warn_call_to_pure_virtual_member_function_from_ctor_dtor : Warning<
1539   "call to pure virtual member function %0 has undefined behavior; "
1540   "overrides of %0 in subclasses are not available in the "
1541   "%select{constructor|destructor}1 of %2">;
1542
1543 def note_member_declared_at : Note<"member is declared here">;
1544 def note_ivar_decl : Note<"instance variable is declared here">;
1545 def note_bitfield_decl : Note<"bit-field is declared here">;
1546 def note_implicit_param_decl : Note<"%0 is an implicit parameter">;
1547 def note_member_synthesized_at : Note<
1548   "implicit %select{default constructor|copy constructor|move constructor|copy "
1549   "assignment operator|move assignment operator|destructor}0 for %1 first "
1550   "required here">;
1551 def note_inhctor_synthesized_at : Note<
1552   "inherited constructor for %0 first required here">;
1553 def err_missing_default_ctor : Error<
1554   "%select{constructor for %1 must explicitly initialize the|"
1555   "implicit default constructor for %1 must explicitly initialize the|"
1556   "cannot use constructor inherited from base class %4;}0 "
1557   "%select{base class|member}2 %3 %select{which|which|of %1}0 "
1558   "does not have a default constructor">;
1559 def note_due_to_dllexported_class : Note<
1560   "due to '%0' being dllexported%select{|; try compiling in C++11 mode}1">;
1561
1562 def err_illegal_union_or_anon_struct_member : Error<
1563   "%select{anonymous struct|union}0 member %1 has a non-trivial "
1564   "%select{constructor|copy constructor|move constructor|copy assignment "
1565   "operator|move assignment operator|destructor}2">;
1566 def warn_cxx98_compat_nontrivial_union_or_anon_struct_member : Warning<
1567   "%select{anonymous struct|union}0 member %1 with a non-trivial "
1568   "%select{constructor|copy constructor|move constructor|copy assignment "
1569   "operator|move assignment operator|destructor}2 is incompatible with C++98">,
1570   InGroup<CXX98Compat>, DefaultIgnore;
1571
1572 def note_nontrivial_virtual_dtor : Note<
1573   "destructor for %0 is not trivial because it is virtual">;
1574 def note_nontrivial_has_virtual : Note<
1575   "because type %0 has a virtual %select{member function|base class}1">;
1576 def note_nontrivial_no_def_ctor : Note<
1577   "because %select{base class of |field of |}0type %1 has no "
1578   "default constructor">;
1579 def note_user_declared_ctor : Note<
1580   "implicit default constructor suppressed by user-declared constructor">;
1581 def note_nontrivial_no_copy : Note<
1582   "because no %select{<<ERROR>>|constructor|constructor|assignment operator|"
1583   "assignment operator|<<ERROR>>}2 can be used to "
1584   "%select{<<ERROR>>|copy|move|copy|move|<<ERROR>>}2 "
1585   "%select{base class|field|an object}0 of type %3">;
1586 def note_nontrivial_user_provided : Note<
1587   "because %select{base class of |field of |}0type %1 has a user-provided "
1588   "%select{default constructor|copy constructor|move constructor|"
1589   "copy assignment operator|move assignment operator|destructor}2">;
1590 def note_nontrivial_in_class_init : Note<
1591   "because field %0 has an initializer">;
1592 def note_nontrivial_param_type : Note<
1593   "because its parameter is %diff{of type $, not $|of the wrong type}2,3">;
1594 def note_nontrivial_default_arg : Note<"because it has a default argument">;
1595 def note_nontrivial_variadic : Note<"because it is a variadic function">;
1596 def note_nontrivial_subobject : Note<
1597   "because the function selected to %select{construct|copy|move|copy|move|"
1598   "destroy}2 %select{base class|field}0 of type %1 is not trivial">;
1599 def note_nontrivial_objc_ownership : Note<
1600   "because type %0 has a member with %select{no|no|__strong|__weak|"
1601   "__autoreleasing}1 ownership">;
1602
1603 def err_static_data_member_not_allowed_in_anon_struct : Error<
1604   "static data member %0 not allowed in anonymous struct">;
1605 def ext_static_data_member_in_union : ExtWarn<
1606   "static data member %0 in union is a C++11 extension">, InGroup<CXX11>;
1607 def warn_cxx98_compat_static_data_member_in_union : Warning<
1608   "static data member %0 in union is incompatible with C++98">,
1609   InGroup<CXX98Compat>, DefaultIgnore;
1610 def ext_union_member_of_reference_type : ExtWarn<
1611   "union member %0 has reference type %1, which is a Microsoft extension">,
1612   InGroup<MicrosoftUnionMemberReference>;
1613 def err_union_member_of_reference_type : Error<
1614   "union member %0 has reference type %1">;
1615 def ext_anonymous_struct_union_qualified : Extension<
1616   "anonymous %select{struct|union}0 cannot be '%1'">;
1617 def err_different_return_type_for_overriding_virtual_function : Error<
1618   "virtual function %0 has a different return type "
1619   "%diff{($) than the function it overrides (which has return type $)|"
1620   "than the function it overrides}1,2">;
1621 def note_overridden_virtual_function : Note<
1622   "overridden virtual function is here">;
1623 def err_conflicting_overriding_cc_attributes : Error<
1624   "virtual function %0 has different calling convention attributes "
1625   "%diff{($) than the function it overrides (which has calling convention $)|"
1626   "than the function it overrides}1,2">;
1627
1628 def err_covariant_return_inaccessible_base : Error<
1629   "invalid covariant return for virtual function: %1 is a "
1630   "%select{private|protected}2 base class of %0">, AccessControl;
1631 def err_covariant_return_ambiguous_derived_to_base_conv : Error<
1632   "return type of virtual function %3 is not covariant with the return type of "
1633   "the function it overrides (ambiguous conversion from derived class "
1634   "%0 to base class %1:%2)">;
1635 def err_covariant_return_not_derived : Error<
1636   "return type of virtual function %0 is not covariant with the return type of "
1637   "the function it overrides (%1 is not derived from %2)">;
1638 def err_covariant_return_incomplete : Error<
1639   "return type of virtual function %0 is not covariant with the return type of "
1640   "the function it overrides (%1 is incomplete)">;
1641 def err_covariant_return_type_different_qualifications : Error<
1642   "return type of virtual function %0 is not covariant with the return type of "
1643   "the function it overrides (%1 has different qualifiers than %2)">;
1644 def err_covariant_return_type_class_type_more_qualified : Error<
1645   "return type of virtual function %0 is not covariant with the return type of "
1646   "the function it overrides (class type %1 is more qualified than class "
1647   "type %2">;
1648
1649 // C++ implicit special member functions
1650 def note_in_declaration_of_implicit_special_member : Note<
1651   "while declaring the implicit "
1652   "%select{default constructor|copy constructor|move constructor|"
1653   "copy assignment operator|move assignment operator|destructor}1"
1654   " for %0">;
1655
1656 // C++ constructors
1657 def err_constructor_cannot_be : Error<"constructor cannot be declared '%0'">;
1658 def err_invalid_qualified_constructor : Error<
1659   "'%0' qualifier is not allowed on a constructor">;
1660 def err_ref_qualifier_constructor : Error<
1661   "ref-qualifier '%select{&&|&}0' is not allowed on a constructor">;
1662
1663 def err_constructor_return_type : Error<
1664   "constructor cannot have a return type">;
1665 def err_constructor_redeclared : Error<"constructor cannot be redeclared">;
1666 def err_constructor_byvalue_arg : Error<
1667   "copy constructor must pass its first argument by reference">;
1668 def warn_no_constructor_for_refconst : Warning<
1669   "%select{struct|interface|union|class|enum}0 %1 does not declare any "
1670   "constructor to initialize its non-modifiable members">;
1671 def note_refconst_member_not_initialized : Note<
1672   "%select{const|reference}0 member %1 will never be initialized">;
1673 def ext_ms_explicit_constructor_call : ExtWarn<
1674   "explicit constructor calls are a Microsoft extension">,
1675   InGroup<MicrosoftExplicitConstructorCall>;
1676
1677 // C++ destructors
1678 def err_destructor_not_member : Error<
1679   "destructor must be a non-static member function">;
1680 def err_destructor_cannot_be : Error<"destructor cannot be declared '%0'">;
1681 def err_invalid_qualified_destructor : Error<
1682   "'%0' qualifier is not allowed on a destructor">;
1683 def err_ref_qualifier_destructor : Error<
1684   "ref-qualifier '%select{&&|&}0' is not allowed on a destructor">;
1685 def err_destructor_return_type : Error<"destructor cannot have a return type">;
1686 def err_destructor_redeclared : Error<"destructor cannot be redeclared">;
1687 def err_destructor_with_params : Error<"destructor cannot have any parameters">;
1688 def err_destructor_variadic : Error<"destructor cannot be variadic">;
1689 def err_destructor_typedef_name : Error<
1690   "destructor cannot be declared using a %select{typedef|type alias}1 %0 of the class name">;
1691 def err_destructor_name : Error<
1692   "expected the class name after '~' to name the enclosing class">;
1693 def err_destructor_class_name : Error<
1694   "expected the class name after '~' to name a destructor">;
1695 def err_ident_in_dtor_not_a_type : Error<
1696   "identifier %0 in object destruction expression does not name a type">;
1697 def err_destructor_expr_type_mismatch : Error<
1698   "destructor type %0 in object destruction expression does not match the "
1699   "type %1 of the object being destroyed">;
1700 def note_destructor_type_here : Note<
1701   "type %0 is declared here">;
1702
1703 def err_destructor_template : Error<
1704   "destructor cannot be declared as a template">;
1705
1706 // C++ initialization
1707 def err_init_conversion_failed : Error<
1708   "cannot initialize %select{a variable|a parameter|return object|an "
1709   "exception object|a member subobject|an array element|a new value|a value|a "
1710   "base class|a constructor delegation|a vector element|a block element|a "
1711   "block element|a complex element|a lambda capture|a compound literal "
1712   "initializer|a related result|a parameter of CF audited function}0 "
1713   "%diff{of type $ with an %select{rvalue|lvalue}2 of type $|"
1714   "with an %select{rvalue|lvalue}2 of incompatible type}1,3"
1715   "%select{|: different classes%diff{ ($ vs $)|}5,6"
1716   "|: different number of parameters (%5 vs %6)"
1717   "|: type mismatch at %ordinal5 parameter%diff{ ($ vs $)|}6,7"
1718   "|: different return type%diff{ ($ vs $)|}5,6"
1719   "|: different qualifiers ("
1720   "%select{none|const|restrict|const and restrict|volatile|const and volatile|"
1721   "volatile and restrict|const, volatile, and restrict}5 vs "
1722   "%select{none|const|restrict|const and restrict|volatile|const and volatile|"
1723   "volatile and restrict|const, volatile, and restrict}6)"
1724   "|: different exception specifications}4">;
1725
1726 def err_lvalue_to_rvalue_ref : Error<"rvalue reference %diff{to type $ cannot "
1727   "bind to lvalue of type $|cannot bind to incompatible lvalue}0,1">;
1728 def err_lvalue_reference_bind_to_initlist : Error<
1729   "%select{non-const|volatile}0 lvalue reference to type %1 cannot bind to an "
1730   "initializer list temporary">;
1731 def err_lvalue_reference_bind_to_temporary : Error<
1732   "%select{non-const|volatile}0 lvalue reference %diff{to type $ cannot bind "
1733   "to a temporary of type $|cannot bind to incompatible temporary}1,2">;
1734 def err_lvalue_reference_bind_to_unrelated : Error<
1735   "%select{non-const|volatile}0 lvalue reference "
1736   "%diff{to type $ cannot bind to a value of unrelated type $|"
1737   "cannot bind to a value of unrelated type}1,2">;
1738 def err_reference_bind_drops_quals : Error<
1739   "binding value %diff{of type $ to reference to type $|to reference}0,1 "
1740   "drops %select{<<ERROR>>|'const'|'restrict'|'const' and 'restrict'|"
1741   "'volatile'|'const' and 'volatile'|'restrict' and 'volatile'|"
1742   "'const', 'restrict', and 'volatile'}2 qualifier%plural{1:|2:|4:|:s}2">;
1743 def err_reference_bind_failed : Error<
1744   "reference %diff{to type $ could not bind to an %select{rvalue|lvalue}1 of "
1745   "type $|could not bind to %select{rvalue|lvalue}1 of incompatible type}0,2">;
1746 def err_reference_bind_init_list : Error<
1747   "reference to type %0 cannot bind to an initializer list">;
1748 def warn_temporary_array_to_pointer_decay : Warning<
1749   "pointer is initialized by a temporary array, which will be destroyed at the "
1750   "end of the full-expression">,
1751   InGroup<DiagGroup<"address-of-array-temporary">>;
1752 def err_init_list_bad_dest_type : Error<
1753   "%select{|non-aggregate }0type %1 cannot be initialized with an initializer "
1754   "list">;
1755 def err_member_function_call_bad_cvr : Error<"member function %0 not viable: "
1756     "'this' argument has type %1, but function is not marked "
1757     "%select{const|restrict|const or restrict|volatile|const or volatile|"
1758     "volatile or restrict|const, volatile, or restrict}2">;
1759
1760 def err_reference_bind_to_bitfield : Error<
1761   "%select{non-const|volatile}0 reference cannot bind to "
1762   "bit-field%select{| %1}2">;
1763 def err_reference_bind_to_vector_element : Error<
1764   "%select{non-const|volatile}0 reference cannot bind to vector element">;
1765 def err_reference_var_requires_init : Error<
1766   "declaration of reference variable %0 requires an initializer">;
1767 def err_reference_without_init : Error<
1768   "reference to type %0 requires an initializer">;
1769 def note_value_initialization_here : Note<
1770   "in value-initialization of type %0 here">;
1771 def err_reference_has_multiple_inits : Error<
1772   "reference cannot be initialized with multiple values">;
1773 def err_init_non_aggr_init_list : Error<
1774   "initialization of non-aggregate type %0 with an initializer list">;
1775 def err_init_reference_member_uninitialized : Error<
1776   "reference member of type %0 uninitialized">;
1777 def note_uninit_reference_member : Note<
1778   "uninitialized reference member is here">;
1779 def warn_field_is_uninit : Warning<"field %0 is uninitialized when used here">,
1780   InGroup<Uninitialized>;
1781 def warn_base_class_is_uninit : Warning<
1782   "base class %0 is uninitialized when used here to access %q1">,
1783   InGroup<Uninitialized>;
1784 def warn_reference_field_is_uninit : Warning<
1785   "reference %0 is not yet bound to a value when used here">,
1786   InGroup<Uninitialized>;
1787 def note_uninit_in_this_constructor : Note<
1788   "during field initialization in %select{this|the implicit default}0 "
1789   "constructor">;
1790 def warn_static_self_reference_in_init : Warning<
1791   "static variable %0 is suspiciously used within its own initialization">,
1792   InGroup<UninitializedStaticSelfInit>;
1793 def warn_uninit_self_reference_in_init : Warning<
1794   "variable %0 is uninitialized when used within its own initialization">,
1795   InGroup<Uninitialized>;
1796 def warn_uninit_self_reference_in_reference_init : Warning<
1797   "reference %0 is not yet bound to a value when used within its own"
1798   " initialization">,
1799   InGroup<Uninitialized>;
1800 def warn_uninit_var : Warning<
1801   "variable %0 is uninitialized when %select{used here|captured by block}1">,
1802   InGroup<Uninitialized>, DefaultIgnore;
1803 def warn_sometimes_uninit_var : Warning<
1804   "variable %0 is %select{used|captured}1 uninitialized whenever "
1805   "%select{'%3' condition is %select{true|false}4|"
1806   "'%3' loop %select{is entered|exits because its condition is false}4|"
1807   "'%3' loop %select{condition is true|exits because its condition is false}4|"
1808   "switch %3 is taken|"
1809   "its declaration is reached|"
1810   "%3 is called}2">,
1811   InGroup<UninitializedSometimes>, DefaultIgnore;
1812 def warn_maybe_uninit_var : Warning<
1813   "variable %0 may be uninitialized when "
1814   "%select{used here|captured by block}1">,
1815   InGroup<UninitializedMaybe>, DefaultIgnore;
1816 def note_var_declared_here : Note<"variable %0 is declared here">;
1817 def note_uninit_var_use : Note<
1818   "%select{uninitialized use occurs|variable is captured by block}0 here">;
1819 def warn_uninit_byref_blockvar_captured_by_block : Warning<
1820   "block pointer variable %0 is uninitialized when captured by block">,
1821   InGroup<Uninitialized>, DefaultIgnore;
1822 def note_block_var_fixit_add_initialization : Note<
1823   "did you mean to use __block %0?">;
1824 def note_in_omitted_aggregate_initializer : Note<
1825   "in implicit initialization of %select{"
1826   "array element %1 with omitted initializer|"
1827   "field %1 with omitted initializer|"
1828   "trailing array elements in runtime-sized array new}0">;
1829 def note_in_reference_temporary_list_initializer : Note<
1830   "in initialization of temporary of type %0 created to "
1831   "list-initialize this reference">;
1832 def note_var_fixit_add_initialization : Note<
1833   "initialize the variable %0 to silence this warning">;
1834 def note_uninit_fixit_remove_cond : Note<
1835   "remove the %select{'%1' if its condition|condition if it}0 "
1836   "is always %select{false|true}2">;
1837 def err_init_incomplete_type : Error<"initialization of incomplete type %0">;
1838 def err_list_init_in_parens : Error<
1839   "cannot initialize %select{non-class|reference}0 type %1 with a "
1840   "parenthesized initializer list">;
1841
1842 def warn_unsequenced_mod_mod : Warning<
1843   "multiple unsequenced modifications to %0">, InGroup<Unsequenced>;
1844 def warn_unsequenced_mod_use : Warning<
1845   "unsequenced modification and access to %0">, InGroup<Unsequenced>;
1846
1847 def err_temp_copy_no_viable : Error<
1848   "no viable constructor %select{copying variable|copying parameter|"
1849   "returning object|throwing object|copying member subobject|copying array "
1850   "element|allocating object|copying temporary|initializing base subobject|"
1851   "initializing vector element|capturing value}0 of type %1">;
1852 def ext_rvalue_to_reference_temp_copy_no_viable : Extension<
1853   "no viable constructor %select{copying variable|copying parameter|"
1854   "returning object|throwing object|copying member subobject|copying array "
1855   "element|allocating object|copying temporary|initializing base subobject|"
1856   "initializing vector element|capturing value}0 of type %1; C++98 requires a copy "
1857   "constructor when binding a reference to a temporary">,
1858   InGroup<BindToTemporaryCopy>;
1859 def err_temp_copy_ambiguous : Error<
1860   "ambiguous constructor call when %select{copying variable|copying "
1861   "parameter|returning object|throwing object|copying member subobject|copying "
1862   "array element|allocating object|copying temporary|initializing base subobject|"
1863   "initializing vector element|capturing value}0 of type %1">;
1864 def err_temp_copy_deleted : Error<
1865   "%select{copying variable|copying parameter|returning object|throwing "
1866   "object|copying member subobject|copying array element|allocating object|"
1867   "copying temporary|initializing base subobject|initializing vector element|"
1868   "capturing value}0 of type %1 invokes deleted constructor">;
1869 def err_temp_copy_incomplete : Error<
1870   "copying a temporary object of incomplete type %0">;
1871 def warn_cxx98_compat_temp_copy : Warning<
1872   "%select{copying variable|copying parameter|returning object|throwing "
1873   "object|copying member subobject|copying array element|allocating object|"
1874   "copying temporary|initializing base subobject|initializing vector element}1 "
1875   "of type %2 when binding a reference to a temporary would %select{invoke "
1876   "an inaccessible constructor|find no viable constructor|find ambiguous "
1877   "constructors|invoke a deleted constructor}0 in C++98">,
1878   InGroup<CXX98CompatBindToTemporaryCopy>, DefaultIgnore;
1879 def err_selected_explicit_constructor : Error<
1880   "chosen constructor is explicit in copy-initialization">;
1881 def note_explicit_ctor_deduction_guide_here : Note<
1882   "explicit %select{constructor|deduction guide}0 declared here">;
1883
1884 // C++11 decltype
1885 def err_decltype_in_declarator : Error<
1886     "'decltype' cannot be used to name a declaration">;
1887     
1888 // C++11 auto
1889 def warn_cxx98_compat_auto_type_specifier : Warning<
1890   "'auto' type specifier is incompatible with C++98">,
1891   InGroup<CXX98Compat>, DefaultIgnore;
1892 def err_auto_variable_cannot_appear_in_own_initializer : Error<
1893   "variable %0 declared with deduced type %1 "
1894   "cannot appear in its own initializer">;
1895 def err_binding_cannot_appear_in_own_initializer : Error<
1896   "binding %0 cannot appear in the initializer of its own "
1897   "decomposition declaration">;
1898 def err_illegal_decl_array_of_auto : Error<
1899   "'%0' declared as array of %1">;
1900 def err_new_array_of_auto : Error<
1901   "cannot allocate array of 'auto'">;
1902 def err_auto_not_allowed : Error<
1903   "%select{'auto'|'decltype(auto)'|'__auto_type'|"
1904   "use of "
1905   "%select{class template|function template|variable template|alias template|"
1906   "template template parameter|template}2 %3 requires template arguments; "
1907   "argument deduction}0 not allowed "
1908   "%select{in function prototype"
1909   "|in non-static struct member|in struct member"
1910   "|in non-static union member|in union member"
1911   "|in non-static class member|in interface member"
1912   "|in exception declaration|in template parameter until C++1z|in block literal"
1913   "|in template argument|in typedef|in type alias|in function return type"
1914   "|in conversion function type|here|in lambda parameter"
1915   "|in type allocated by 'new'|in K&R-style function parameter"
1916   "|in template parameter|in friend declaration}1">;
1917 def err_dependent_deduced_tst : Error<
1918   "typename specifier refers to "
1919   "%select{class template|function template|variable template|alias template|"
1920   "template template parameter|template}0 member in %1; "
1921   "argument deduction not allowed here">;
1922 def err_auto_not_allowed_var_inst : Error<
1923   "'auto' variable template instantiation is not allowed">;
1924 def err_auto_var_requires_init : Error<
1925   "declaration of variable %0 with deduced type %1 requires an initializer">;
1926 def err_auto_new_requires_ctor_arg : Error<
1927   "new expression for type %0 requires a constructor argument">;
1928 def err_auto_new_list_init : Error<
1929   "new expression for type %0 cannot use list-initialization">;
1930 def err_auto_var_init_no_expression : Error<
1931   "initializer for variable %0 with type %1 is empty">;
1932 def err_auto_var_init_multiple_expressions : Error<
1933   "initializer for variable %0 with type %1 contains multiple expressions">;
1934 def err_auto_var_init_paren_braces : Error<
1935   "cannot deduce type for variable %1 with type %2 from "
1936   "%select{parenthesized|nested}0 initializer list">;
1937 def err_auto_new_ctor_multiple_expressions : Error<
1938   "new expression for type %0 contains multiple constructor arguments">;
1939 def err_auto_missing_trailing_return : Error<
1940   "'auto' return without trailing return type; deduced return types are a "
1941   "C++14 extension">;
1942 def err_deduced_return_type : Error<
1943   "deduced return types are a C++14 extension">;
1944 def err_trailing_return_without_auto : Error<
1945   "function with trailing return type must specify return type 'auto', not %0">;
1946 def err_trailing_return_in_parens : Error<
1947   "trailing return type may not be nested within parentheses">;
1948 def err_auto_var_deduction_failure : Error<
1949   "variable %0 with type %1 has incompatible initializer of type %2">;
1950 def err_auto_var_deduction_failure_from_init_list : Error<
1951   "cannot deduce actual type for variable %0 with type %1 from initializer list">;
1952 def err_auto_new_deduction_failure : Error<
1953   "new expression for type %0 has incompatible constructor argument of type %1">;
1954 def err_auto_different_deductions : Error<
1955   "%select{'auto'|'decltype(auto)'|'__auto_type'|template arguments}0 "
1956   "deduced as %1 in declaration of %2 and "
1957   "deduced as %3 in declaration of %4">;
1958 def err_auto_non_deduced_not_alone : Error<
1959   "%select{function with deduced return type|"
1960   "declaration with trailing return type}0 "
1961   "must be the only declaration in its group">;
1962 def err_implied_std_initializer_list_not_found : Error<
1963   "cannot deduce type of initializer list because std::initializer_list was "
1964   "not found; include <initializer_list>">;
1965 def err_malformed_std_initializer_list : Error<
1966   "std::initializer_list must be a class template with a single type parameter">;
1967 def warn_dangling_std_initializer_list : Warning<
1968   "array backing the initializer list will be destroyed at the end of "
1969   "%select{the full-expression|the constructor}0">,
1970   InGroup<DiagGroup<"dangling-initializer-list">>;
1971 def err_auto_init_list_from_c : Error<
1972   "cannot use __auto_type with initializer list in C">;
1973 def err_auto_bitfield : Error<
1974   "cannot pass bit-field as __auto_type initializer in C">;
1975
1976 // C++1y decltype(auto) type
1977 def err_decltype_auto_invalid : Error<
1978   "'decltype(auto)' not allowed here">;
1979 def err_decltype_auto_cannot_be_combined : Error<
1980   "'decltype(auto)' cannot be combined with other type specifiers">;
1981 def err_decltype_auto_function_declarator_not_declaration : Error<
1982   "'decltype(auto)' can only be used as a return type "
1983   "in a function declaration">;
1984 def err_decltype_auto_compound_type : Error<
1985   "cannot form %select{pointer to|reference to|array of}0 'decltype(auto)'">;
1986 def err_decltype_auto_initializer_list : Error<
1987   "cannot deduce 'decltype(auto)' from initializer list">;
1988
1989 // C++1z deduced class template specialization types
1990 def err_deduced_class_template_compound_type : Error<
1991   "cannot %select{form pointer to|form reference to|form array of|"
1992   "form function returning|use parentheses when declaring variable with}0 "
1993   "deduced class template specialization type">;
1994 def err_deduced_non_class_template_specialization_type : Error<
1995   "%select{<error>|function template|variable template|alias template|"
1996   "template template parameter|template}0 %1 requires template arguments; "
1997   "argument deduction only allowed for class templates">;
1998 def err_deduced_class_template_ctor_ambiguous : Error<
1999   "ambiguous deduction for template arguments of %0">;
2000 def err_deduced_class_template_ctor_no_viable : Error<
2001   "no viable constructor or deduction guide for deduction of "
2002   "template arguments of %0">;
2003 def err_deduced_class_template_incomplete : Error<
2004   "template %0 has no definition and no %select{|viable }1deduction guides "
2005   "for deduction of template arguments">;
2006 def err_deduced_class_template_deleted : Error<
2007   "class template argument deduction for %0 selected a deleted constructor">;
2008 def err_deduced_class_template_explicit : Error<
2009   "class template argument deduction for %0 selected an explicit "
2010   "%select{constructor|deduction guide}1 for copy-list-initialization">;
2011 def err_deduction_guide_no_trailing_return_type : Error<
2012   "deduction guide declaration without trailing return type">;
2013 def err_deduction_guide_bad_trailing_return_type : Error<
2014   "deduced type %1 of deduction guide is not %select{|written as }2"
2015   "a specialization of template %0">;
2016 def err_deduction_guide_with_complex_decl : Error<
2017   "cannot specify any part of a return type in the "
2018   "declaration of a deduction guide">;
2019 def err_deduction_guide_invalid_specifier : Error<
2020   "deduction guide cannot be declared '%0'">;
2021 def err_deduction_guide_name_not_class_template : Error<
2022   "cannot specify deduction guide for "
2023   "%select{<error>|function template|variable template|alias template|"
2024   "template template parameter|dependent template name}0 %1">;
2025 def err_deduction_guide_wrong_scope : Error<
2026   "deduction guide must be declared in the same scope as template %q0">;
2027 def err_deduction_guide_defines_function : Error<
2028   "deduction guide cannot have a function definition">;
2029 def err_deduction_guide_explicit_mismatch : Error<
2030   "deduction guide is %select{not |}0declared 'explicit' but "
2031   "previous declaration was%select{ not|}0">;
2032 def err_deduction_guide_specialized : Error<"deduction guide cannot be "
2033   "%select{explicitly instantiated|explicitly specialized}0">;
2034 def err_deduction_guide_template_not_deducible : Error<
2035     "deduction guide template contains "
2036     "%select{a template parameter|template parameters}0 that cannot be "
2037     "deduced">;
2038
2039 // C++1y deduced return types
2040 def err_auto_fn_deduction_failure : Error<
2041   "cannot deduce return type %0 from returned value of type %1">;
2042 def err_auto_fn_different_deductions : Error<
2043   "'%select{auto|decltype(auto)}0' in return type deduced as %1 here but "
2044   "deduced as %2 in earlier return statement">;
2045 def err_auto_fn_used_before_defined : Error<
2046   "function %0 with deduced return type cannot be used before it is defined">;
2047 def err_auto_fn_no_return_but_not_auto : Error<
2048   "cannot deduce return type %0 for function with no return statements">;
2049 def err_auto_fn_return_void_but_not_auto : Error<
2050   "cannot deduce return type %0 from omitted return expression">;
2051 def err_auto_fn_return_init_list : Error<
2052   "cannot deduce return type from initializer list">;
2053 def err_auto_fn_virtual : Error<
2054   "function with deduced return type cannot be virtual">;
2055
2056 // C++11 override control
2057 def override_keyword_only_allowed_on_virtual_member_functions : Error<
2058   "only virtual member functions can be marked '%0'">;
2059 def override_keyword_hides_virtual_member_function : Error<
2060   "non-virtual member function marked '%0' hides virtual member "
2061   "%select{function|functions}1">;
2062 def err_function_marked_override_not_overriding : Error<
2063   "%0 marked 'override' but does not override any member functions">;
2064 def warn_destructor_marked_not_override_overriding : Warning <
2065   "%0 overrides a destructor but is not marked 'override'">,
2066   InGroup<CXX11WarnOverrideDestructor>, DefaultIgnore;
2067 def warn_function_marked_not_override_overriding : Warning <
2068   "%0 overrides a member function but is not marked 'override'">,
2069   InGroup<CXX11WarnOverrideMethod>;
2070 def err_class_marked_final_used_as_base : Error<
2071   "base %0 is marked '%select{final|sealed}1'">;
2072 def warn_abstract_final_class : Warning<
2073   "abstract class is marked '%select{final|sealed}0'">, InGroup<AbstractFinalClass>;
2074
2075 // C++11 attributes
2076 def err_repeat_attribute : Error<"%0 attribute cannot be repeated">;
2077
2078 // C++11 final
2079 def err_final_function_overridden : Error<
2080   "declaration of %0 overrides a '%select{final|sealed}1' function">;
2081
2082 // C++11 scoped enumerations
2083 def err_enum_invalid_underlying : Error<
2084   "non-integral type %0 is an invalid underlying type">;
2085 def err_enumerator_too_large : Error<
2086   "enumerator value is not representable in the underlying type %0">;
2087 def ext_enumerator_too_large : ExtWarn<
2088   "enumerator value is not representable in the underlying type %0">,
2089   InGroup<MicrosoftEnumValue>;
2090 def err_enumerator_wrapped : Error<
2091   "enumerator value %0 is not representable in the underlying type %1">;
2092 def err_enum_redeclare_type_mismatch : Error<
2093   "enumeration redeclared with different underlying type %0 (was %1)">;
2094 def err_enum_redeclare_fixed_mismatch : Error<
2095   "enumeration previously declared with %select{non|}0fixed underlying type">;
2096 def err_enum_redeclare_scoped_mismatch : Error<
2097   "enumeration previously declared as %select{un|}0scoped">;
2098 def err_enum_class_reference : Error<
2099   "reference to %select{|scoped }0enumeration must use 'enum' "
2100   "not 'enum class'">;
2101 def err_only_enums_have_underlying_types : Error<
2102   "only enumeration types have underlying types">;
2103 def err_underlying_type_of_incomplete_enum : Error<
2104   "cannot determine underlying type of incomplete enumeration type %0">;
2105
2106 // C++11 delegating constructors
2107 def err_delegating_ctor : Error<
2108   "delegating constructors are permitted only in C++11">;
2109 def warn_cxx98_compat_delegating_ctor : Warning<
2110   "delegating constructors are incompatible with C++98">,
2111   InGroup<CXX98Compat>, DefaultIgnore;
2112 def err_delegating_initializer_alone : Error<
2113   "an initializer for a delegating constructor must appear alone">;
2114 def warn_delegating_ctor_cycle : Warning<
2115   "constructor for %0 creates a delegation cycle">, DefaultError,
2116   InGroup<DelegatingCtorCycles>;
2117 def note_it_delegates_to : Note<"it delegates to">;
2118 def note_which_delegates_to : Note<"which delegates to">;
2119
2120 // C++11 range-based for loop
2121 def err_for_range_decl_must_be_var : Error<
2122   "for range declaration must declare a variable">;
2123 def err_for_range_storage_class : Error<
2124   "loop variable %0 may not be declared %select{'extern'|'static'|"
2125   "'__private_extern__'|'auto'|'register'|'constexpr'}1">;
2126 def err_type_defined_in_for_range : Error<
2127   "types may not be defined in a for range declaration">;
2128 def err_for_range_deduction_failure : Error<
2129   "cannot use type %0 as a range">;
2130 def err_for_range_incomplete_type : Error<
2131   "cannot use incomplete type %0 as a range">;
2132 def err_for_range_iter_deduction_failure : Error<
2133   "cannot use type %0 as an iterator">;
2134 def err_for_range_member_begin_end_mismatch : Error<
2135   "range type %0 has '%select{begin|end}1' member but no '%select{end|begin}1' member">;
2136 def ext_for_range_begin_end_types_differ : ExtWarn<
2137   "'begin' and 'end' returning different types (%0 and %1) is a C++1z extension">,
2138   InGroup<CXX1z>;
2139 def warn_for_range_begin_end_types_differ : Warning<
2140   "'begin' and 'end' returning different types (%0 and %1) is incompatible "
2141   "with C++ standards before C++1z">, InGroup<CXXPre1zCompat>, DefaultIgnore;
2142 def note_in_for_range: Note<
2143   "when looking up '%select{begin|end}0' function for range expression "
2144   "of type %1">;
2145 def err_for_range_invalid: Error<
2146   "invalid range expression of type %0; no viable '%select{begin|end}1' "
2147   "function available">;
2148 def err_range_on_array_parameter : Error<
2149   "cannot build range expression with array function parameter %0 since "
2150   "parameter with array type %1 is treated as pointer type %2">;
2151 def err_for_range_dereference : Error<
2152   "invalid range expression of type %0; did you mean to dereference it "
2153   "with '*'?">;
2154 def note_for_range_invalid_iterator : Note <
2155   "in implicit call to 'operator%select{!=|*|++}0' for iterator of type %1">;
2156 def note_for_range_begin_end : Note<
2157   "selected '%select{begin|end}0' %select{function|template }1%2 with iterator type %3">;
2158 def warn_for_range_const_reference_copy : Warning<
2159   "loop variable %0 "
2160   "%diff{has type $ but is initialized with type $"
2161   "| is initialized with a value of a different type}1,2 resulting in a copy">,
2162   InGroup<RangeLoopAnalysis>, DefaultIgnore;
2163 def note_use_type_or_non_reference : Note<
2164   "use non-reference type %0 to keep the copy or type %1 to prevent copying">;
2165 def warn_for_range_variable_always_copy : Warning<
2166   "loop variable %0 is always a copy because the range of type %1 does not "
2167   "return a reference">,
2168   InGroup<RangeLoopAnalysis>, DefaultIgnore;
2169 def note_use_non_reference_type : Note<"use non-reference type %0">;
2170 def warn_for_range_copy : Warning<
2171   "loop variable %0 of type %1 creates a copy from type %2">,
2172   InGroup<RangeLoopAnalysis>, DefaultIgnore;
2173 def note_use_reference_type : Note<"use reference type %0 to prevent copying">;
2174
2175 // C++11 constexpr
2176 def warn_cxx98_compat_constexpr : Warning<
2177   "'constexpr' specifier is incompatible with C++98">,
2178   InGroup<CXX98Compat>, DefaultIgnore;
2179 // FIXME: Maybe this should also go in -Wc++14-compat?
2180 def warn_cxx14_compat_constexpr_not_const : Warning<
2181   "'constexpr' non-static member function will not be implicitly 'const' "
2182   "in C++14; add 'const' to avoid a change in behavior">,
2183   InGroup<DiagGroup<"constexpr-not-const">>;
2184 def err_invalid_constexpr : Error<
2185   "%select{function parameter|typedef|non-static data member}0 "
2186   "cannot be constexpr">;
2187 def err_invalid_constexpr_member : Error<"non-static data member cannot be "
2188   "constexpr%select{; did you intend to make it %select{const|static}0?|}1">;
2189 def err_constexpr_tag : Error<
2190   "%select{class|struct|interface|union|enum}0 cannot be marked constexpr">;
2191 def err_constexpr_dtor : Error<"destructor cannot be marked constexpr">;
2192 def err_constexpr_no_declarators : Error<
2193   "constexpr can only be used in variable and function declarations">;
2194 def err_invalid_constexpr_var_decl : Error<
2195   "constexpr variable declaration must be a definition">;
2196 def err_constexpr_static_mem_var_requires_init : Error<
2197   "declaration of constexpr static data member %0 requires an initializer">;
2198 def err_constexpr_var_non_literal : Error<
2199   "constexpr variable cannot have non-literal type %0">;
2200 def err_constexpr_var_requires_const_init : Error<
2201   "constexpr variable %0 must be initialized by a constant expression">;
2202 def err_constexpr_redecl_mismatch : Error<
2203   "%select{non-constexpr declaration of %0 follows constexpr declaration"
2204   "|constexpr declaration of %0 follows non-constexpr declaration}1">;
2205 def err_constexpr_virtual : Error<"virtual function cannot be constexpr">;
2206 def err_constexpr_virtual_base : Error<
2207   "constexpr %select{member function|constructor}0 not allowed in "
2208   "%select{struct|interface|class}1 with virtual base "
2209   "%plural{1:class|:classes}2">;
2210 def note_non_literal_incomplete : Note<
2211   "incomplete type %0 is not a literal type">;
2212 def note_non_literal_virtual_base : Note<"%select{struct|interface|class}0 "
2213   "with virtual base %plural{1:class|:classes}1 is not a literal type">;
2214 def note_constexpr_virtual_base_here : Note<"virtual base class declared here">;
2215 def err_constexpr_non_literal_return : Error<
2216   "constexpr function's return type %0 is not a literal type">;
2217 def err_constexpr_non_literal_param : Error<
2218   "constexpr %select{function|constructor}1's %ordinal0 parameter type %2 is "
2219   "not a literal type">;
2220 def err_constexpr_body_invalid_stmt : Error<
2221   "statement not allowed in constexpr %select{function|constructor}0">;
2222 def ext_constexpr_body_invalid_stmt : ExtWarn<
2223   "use of this statement in a constexpr %select{function|constructor}0 "
2224   "is a C++14 extension">, InGroup<CXX14>;
2225 def warn_cxx11_compat_constexpr_body_invalid_stmt : Warning<
2226   "use of this statement in a constexpr %select{function|constructor}0 "
2227   "is incompatible with C++ standards before C++14">,
2228   InGroup<CXXPre14Compat>, DefaultIgnore;
2229 def ext_constexpr_type_definition : ExtWarn<
2230   "type definition in a constexpr %select{function|constructor}0 "
2231   "is a C++14 extension">, InGroup<CXX14>;
2232 def warn_cxx11_compat_constexpr_type_definition : Warning<
2233   "type definition in a constexpr %select{function|constructor}0 "
2234   "is incompatible with C++ standards before C++14">,
2235   InGroup<CXXPre14Compat>, DefaultIgnore;
2236 def err_constexpr_vla : Error<
2237   "variably-modified type %0 cannot be used in a constexpr "
2238   "%select{function|constructor}1">;
2239 def ext_constexpr_local_var : ExtWarn<
2240   "variable declaration in a constexpr %select{function|constructor}0 "
2241   "is a C++14 extension">, InGroup<CXX14>;
2242 def warn_cxx11_compat_constexpr_local_var : Warning<
2243   "variable declaration in a constexpr %select{function|constructor}0 "
2244   "is incompatible with C++ standards before C++14">,
2245   InGroup<CXXPre14Compat>, DefaultIgnore;
2246 def err_constexpr_local_var_static : Error<
2247   "%select{static|thread_local}1 variable not permitted in a constexpr "
2248   "%select{function|constructor}0">;
2249 def err_constexpr_local_var_non_literal_type : Error<
2250   "variable of non-literal type %1 cannot be defined in a constexpr "
2251   "%select{function|constructor}0">;
2252 def err_constexpr_local_var_no_init : Error<
2253   "variables defined in a constexpr %select{function|constructor}0 must be "
2254   "initialized">;
2255 def ext_constexpr_function_never_constant_expr : ExtWarn<
2256   "constexpr %select{function|constructor}0 never produces a "
2257   "constant expression">, InGroup<DiagGroup<"invalid-constexpr">>, DefaultError;
2258 def err_attr_cond_never_constant_expr : Error<
2259   "%0 attribute expression never produces a constant expression">;
2260 def err_diagnose_if_invalid_diagnostic_type : Error<
2261   "invalid diagnostic type for 'diagnose_if'; use \"error\" or \"warning\" "
2262   "instead">;
2263 def err_constexpr_body_no_return : Error<
2264   "no return statement in constexpr function">;
2265 def err_constexpr_return_missing_expr : Error<
2266   "non-void constexpr function %0 should return a value">;
2267 def warn_cxx11_compat_constexpr_body_no_return : Warning<
2268   "constexpr function with no return statements is incompatible with C++ "
2269   "standards before C++14">, InGroup<CXXPre14Compat>, DefaultIgnore;
2270 def ext_constexpr_body_multiple_return : ExtWarn<
2271   "multiple return statements in constexpr function is a C++14 extension">,
2272   InGroup<CXX14>;
2273 def warn_cxx11_compat_constexpr_body_multiple_return : Warning<
2274   "multiple return statements in constexpr function "
2275   "is incompatible with C++ standards before C++14">,
2276   InGroup<CXXPre14Compat>, DefaultIgnore;
2277 def note_constexpr_body_previous_return : Note<
2278   "previous return statement is here">;
2279 def err_constexpr_function_try_block : Error<
2280   "function try block not allowed in constexpr %select{function|constructor}0">;
2281 def err_constexpr_union_ctor_no_init : Error<
2282   "constexpr union constructor does not initialize any member">;
2283 def err_constexpr_ctor_missing_init : Error<
2284   "constexpr constructor must initialize all members">;
2285 def note_constexpr_ctor_missing_init : Note<
2286   "member not initialized by constructor">;
2287 def note_non_literal_no_constexpr_ctors : Note<
2288   "%0 is not literal because it is not an aggregate and has no constexpr "
2289   "constructors other than copy or move constructors">;
2290 def note_non_literal_base_class : Note<
2291   "%0 is not literal because it has base class %1 of non-literal type">;
2292 def note_non_literal_field : Note<
2293   "%0 is not literal because it has data member %1 of "
2294   "%select{non-literal|volatile}3 type %2">;
2295 def note_non_literal_user_provided_dtor : Note<
2296   "%0 is not literal because it has a user-provided destructor">;
2297 def note_non_literal_nontrivial_dtor : Note<
2298   "%0 is not literal because it has a non-trivial destructor">;
2299 def warn_private_extern : Warning<
2300   "use of __private_extern__ on a declaration may not produce external symbol "
2301   "private to the linkage unit and is deprecated">, InGroup<PrivateExtern>;
2302 def note_private_extern : Note<
2303   "use __attribute__((visibility(\"hidden\"))) attribute instead">;
2304
2305 // C++ Concepts TS
2306 def err_concept_wrong_decl_kind : Error<
2307   "'concept' can only appear on the definition of a function template or variable template">;
2308 def err_concept_decls_may_only_appear_in_namespace_scope : Error<
2309   "concept declarations may only appear in namespace scope">;
2310 def err_function_concept_not_defined : Error<
2311   "function concept declaration must be a definition">;
2312 def err_var_concept_not_initialized : Error<
2313   "variable concept declaration must be initialized">;
2314 def err_function_concept_exception_spec : Error<
2315   "function concept cannot have exception specification">;
2316 def err_concept_decl_invalid_specifiers : Error<
2317   "%select{variable|function}0 concept cannot be declared "
2318   "'%select{thread_local|inline|friend|constexpr}1'">;
2319 def err_function_concept_with_params : Error<
2320   "function concept cannot have any parameters">;
2321 def err_function_concept_bool_ret : Error<
2322   "declared return type of function concept must be 'bool'">;
2323 def err_variable_concept_bool_decl : Error<
2324   "declared type of variable concept must be 'bool'">;
2325 def err_concept_specified_specialization : Error<
2326   "'concept' cannot be applied on an "
2327   "%select{explicit instantiation|explicit specialization|partial specialization}0">;
2328 def err_concept_specialized : Error<
2329   "%select{function|variable}0 concept cannot be "
2330   "%select{explicitly instantiated|explicitly specialized|partially specialized}1">;
2331
2332 def err_template_different_associated_constraints : Error<
2333   "associated constraints differ in template redeclaration">;
2334
2335 // C++11 char16_t/char32_t
2336 def warn_cxx98_compat_unicode_type : Warning<
2337   "'%0' type specifier is incompatible with C++98">,
2338   InGroup<CXX98Compat>, DefaultIgnore;
2339
2340 // __make_integer_seq
2341 def err_integer_sequence_negative_length : Error<
2342   "integer sequences must have non-negative sequence length">;
2343 def err_integer_sequence_integral_element_type : Error<
2344   "integer sequences must have integral element type">;
2345
2346 // __type_pack_element
2347 def err_type_pack_element_out_of_bounds : Error<
2348   "a parameter pack may not be accessed at an out of bounds index">;
2349
2350 // Objective-C++
2351 def err_objc_decls_may_only_appear_in_global_scope : Error<
2352   "Objective-C declarations may only appear in global scope">;
2353 def warn_auto_var_is_id : Warning<
2354   "'auto' deduced as 'id' in declaration of %0">,
2355   InGroup<DiagGroup<"auto-var-id">>;
2356
2357 // Attributes
2358 def err_nsobject_attribute : Error<
2359   "'NSObject' attribute is for pointer types only">;
2360 def err_attributes_are_not_compatible : Error<
2361   "%0 and %1 attributes are not compatible">;
2362 def err_attribute_wrong_number_arguments : Error<
2363   "%0 attribute %plural{0:takes no arguments|1:takes one argument|"
2364   ":requires exactly %1 arguments}1">;
2365 def err_attribute_too_many_arguments : Error<
2366   "%0 attribute takes no more than %1 argument%s1">;
2367 def err_attribute_too_few_arguments : Error<
2368   "%0 attribute takes at least %1 argument%s1">;
2369 def err_attribute_invalid_vector_type : Error<"invalid vector element type %0">;
2370 def err_attribute_bad_neon_vector_size : Error<
2371   "Neon vector size must be 64 or 128 bits">;
2372 def err_attribute_requires_positive_integer : Error<
2373   "%0 attribute requires a positive integral compile time constant expression">;
2374 def err_attribute_requires_opencl_version : Error<
2375   "%0 attribute requires OpenCL version %1%select{| or above}2">;
2376 def warn_unsupported_target_attribute
2377     : Warning<"Ignoring unsupported '%0' in the target attribute string">,
2378     InGroup<IgnoredAttributes>;
2379 def err_attribute_unsupported
2380     : Error<"%0 attribute is not supported for this target">;
2381 // The err_*_attribute_argument_not_int are separate because they're used by
2382 // VerifyIntegerConstantExpression.
2383 def err_aligned_attribute_argument_not_int : Error<
2384   "'aligned' attribute requires integer constant">;
2385 def err_align_value_attribute_argument_not_int : Error<
2386   "'align_value' attribute requires integer constant">;
2387 def err_alignas_attribute_wrong_decl_type : Error<
2388   "%0 attribute cannot be applied to a %select{function parameter|"
2389   "variable with 'register' storage class|'catch' variable|bit-field}1">;
2390 def err_alignas_missing_on_definition : Error<
2391   "%0 must be specified on definition if it is specified on any declaration">;
2392 def note_alignas_on_declaration : Note<"declared with %0 attribute here">;
2393 def err_alignas_mismatch : Error<
2394   "redeclaration has different alignment requirement (%1 vs %0)">;
2395 def err_alignas_underaligned : Error<
2396   "requested alignment is less than minimum alignment of %1 for type %0">;
2397 def err_attribute_argument_n_type : Error<
2398   "%0 attribute requires parameter %1 to be %select{int or bool|an integer "
2399   "constant|a string|an identifier}2">;
2400 def err_attribute_argument_type : Error<
2401   "%0 attribute requires %select{int or bool|an integer "
2402   "constant|a string|an identifier}1">;
2403 def err_attribute_argument_outof_range : Error<
2404   "%0 attribute requires integer constant between %1 and %2 inclusive">;
2405 def err_init_priority_object_attr : Error<
2406   "can only use 'init_priority' attribute on file-scope definitions "
2407   "of objects of class type">;
2408 def err_attribute_argument_vec_type_hint : Error<
2409   "invalid attribute argument %0 - expecting a vector or vectorizable scalar type">;
2410 def err_attribute_argument_out_of_bounds : Error<
2411   "%0 attribute parameter %1 is out of bounds">;
2412 def err_attribute_only_once_per_parameter : Error<
2413   "%0 attribute can only be applied once per parameter">;
2414 def err_attribute_uuid_malformed_guid : Error<
2415   "uuid attribute contains a malformed GUID">;
2416 def err_mismatched_uuid : Error<"uuid does not match previous declaration">;
2417 def note_previous_uuid : Note<"previous uuid specified here">;
2418 def warn_attribute_pointers_only : Warning<
2419   "%0 attribute only applies to%select{| constant}1 pointer arguments">,
2420   InGroup<IgnoredAttributes>;
2421 def err_attribute_pointers_only : Error<warn_attribute_pointers_only.Text>;
2422 def err_attribute_integers_only : Error<
2423   "%0 attribute argument may only refer to a function parameter of integer "
2424   "type">;
2425 def warn_attribute_return_pointers_only : Warning<
2426   "%0 attribute only applies to return values that are pointers">,
2427   InGroup<IgnoredAttributes>;
2428 def warn_attribute_return_pointers_refs_only : Warning<
2429   "%0 attribute only applies to return values that are pointers or references">,
2430   InGroup<IgnoredAttributes>;
2431 def warn_attribute_pointer_or_reference_only : Warning<
2432   "%0 attribute only applies to a pointer or reference (%1 is invalid)">,
2433   InGroup<IgnoredAttributes>;
2434 def err_attribute_no_member_pointers : Error<
2435   "%0 attribute cannot be used with pointers to members">;
2436 def err_attribute_invalid_implicit_this_argument : Error<
2437   "%0 attribute is invalid for the implicit this argument">;
2438 def err_ownership_type : Error<
2439   "%0 attribute only applies to %select{pointer|integer}1 arguments">;
2440 def err_ownership_returns_index_mismatch : Error<
2441   "'ownership_returns' attribute index does not match; here it is %0">;
2442 def note_ownership_returns_index_mismatch : Note<
2443   "declared with index %0 here">;
2444 def err_format_strftime_third_parameter : Error<
2445   "strftime format attribute requires 3rd parameter to be 0">;
2446 def err_format_attribute_requires_variadic : Error<
2447   "format attribute requires variadic function">;
2448 def err_format_attribute_not : Error<"format argument not %0">;
2449 def err_format_attribute_result_not : Error<"function does not return %0">;
2450 def err_format_attribute_implicit_this_format_string : Error<
2451   "format attribute cannot specify the implicit this argument as the format "
2452   "string">;
2453 def err_init_method_bad_return_type : Error<
2454   "init methods must return an object pointer type, not %0">;
2455 def err_attribute_invalid_size : Error<
2456   "vector size not an integral multiple of component size">;
2457 def err_attribute_zero_size : Error<"zero vector size">;
2458 def err_attribute_size_too_large : Error<"vector size too large">;
2459 def err_typecheck_vector_not_convertable : Error<
2460   "cannot convert between vector values of different size (%0 and %1)">;
2461 def err_typecheck_vector_not_convertable_non_scalar : Error<
2462   "cannot convert between vector and non-scalar values (%0 and %1)">;
2463 def err_typecheck_vector_lengths_not_equal : Error<
2464   "vector operands do not have the same number of elements (%0 and %1)">;
2465 def warn_typecheck_vector_element_sizes_not_equal : Warning<
2466   "vector operands do not have the same elements sizes (%0 and %1)">,
2467   InGroup<DiagGroup<"vec-elem-size">>, DefaultError;
2468 def err_ext_vector_component_exceeds_length : Error<
2469   "vector component access exceeds type %0">;
2470 def err_ext_vector_component_name_illegal : Error<
2471   "illegal vector component name '%0'">;
2472 def err_attribute_address_space_negative : Error<
2473   "address space is negative">;
2474 def err_attribute_address_space_too_high : Error<
2475   "address space is larger than the maximum supported (%0)">;
2476 def err_attribute_address_multiple_qualifiers : Error<
2477   "multiple address spaces specified for type">;
2478 def err_attribute_address_function_type : Error<
2479   "function type may not be qualified with an address space">;
2480 def err_as_qualified_auto_decl : Error<
2481   "automatic variable qualified with an address space">;
2482 def err_arg_with_address_space : Error<
2483   "parameter may not be qualified with an address space">;
2484 def err_field_with_address_space : Error<
2485   "field may not be qualified with an address space">;
2486 def err_attr_objc_ownership_redundant : Error<
2487   "the type %0 is already explicitly ownership-qualified">;
2488 def err_invalid_nsnumber_type : Error<
2489   "%0 is not a valid literal type for NSNumber">;
2490 def err_objc_illegal_boxed_expression_type : Error<
2491   "illegal type %0 used in a boxed expression">;
2492 def err_objc_non_trivially_copyable_boxed_expression_type : Error<
2493   "non-trivially copyable type %0 cannot be used in a boxed expression">;
2494 def err_objc_incomplete_boxed_expression_type : Error<
2495   "incomplete type %0 used in a boxed expression">;
2496 def err_undeclared_objc_literal_class : Error<
2497   "definition of class %0 must be available to use Objective-C "
2498   "%select{array literals|dictionary literals|numeric literals|boxed expressions|"
2499   "string literals}1">;
2500 def err_undeclared_boxing_method : Error<
2501   "declaration of %0 is missing in %1 class">;
2502 def err_objc_literal_method_sig : Error<
2503   "literal construction method %0 has incompatible signature">;
2504 def note_objc_literal_method_param : Note<
2505   "%select{first|second|third}0 parameter has unexpected type %1 "
2506   "(should be %2)">;
2507 def note_objc_literal_method_return : Note<
2508   "method returns unexpected type %0 (should be an object type)">;
2509 def err_invalid_collection_element : Error<
2510   "collection element of type %0 is not an Objective-C object">;
2511 def err_box_literal_collection : Error<
2512   "%select{string|character|boolean|numeric}0 literal must be prefixed by '@' "
2513   "in a collection">;
2514 def warn_objc_literal_comparison : Warning<
2515   "direct comparison of %select{an array literal|a dictionary literal|"
2516   "a numeric literal|a boxed expression|}0 has undefined behavior">,
2517   InGroup<ObjCLiteralComparison>;
2518 def err_missing_atsign_prefix : Error<
2519   "string literal must be prefixed by '@' ">;
2520 def warn_objc_string_literal_comparison : Warning<
2521   "direct comparison of a string literal has undefined behavior">, 
2522   InGroup<ObjCStringComparison>;
2523 def warn_concatenated_nsarray_literal : Warning<
2524   "concatenated NSString literal for an NSArray expression - "
2525   "possibly missing a comma">,
2526   InGroup<ObjCStringConcatenation>;
2527 def note_objc_literal_comparison_isequal : Note<
2528   "use 'isEqual:' instead">;
2529 def warn_objc_collection_literal_element : Warning<
2530   "object of type %0 is not compatible with "
2531   "%select{array element type|dictionary key type|dictionary value type}1 %2">,
2532   InGroup<ObjCLiteralConversion>;
2533 def err_swift_param_attr_not_swiftcall : Error<
2534   "'%0' parameter can only be used with swiftcall calling convention">;
2535 def err_swift_indirect_result_not_first : Error<
2536   "'swift_indirect_result' parameters must be first parameters of function">;
2537 def err_swift_error_result_not_after_swift_context : Error<
2538   "'swift_error_result' parameter must follow 'swift_context' parameter">;
2539 def err_swift_abi_parameter_wrong_type : Error<
2540   "'%0' parameter must have pointer%select{| to unqualified pointer}1 type; "
2541   "type here is %2">;
2542
2543 def err_attribute_argument_invalid : Error<
2544   "%0 attribute argument is invalid: %select{max must be 0 since min is 0|"
2545   "min must not be greater than max}1">;
2546 def err_attribute_argument_is_zero : Error<
2547   "%0 attribute must be greater than 0">;
2548 def warn_attribute_argument_n_negative : Warning<
2549   "%0 attribute parameter %1 is negative and will be ignored">,
2550   InGroup<CudaCompat>;
2551 def err_property_function_in_objc_container : Error<
2552   "use of Objective-C property in function nested in Objective-C "
2553   "container not supported, move function outside its container">;
2554
2555 let CategoryName = "Cocoa API Issue" in {
2556 def warn_objc_redundant_literal_use : Warning<
2557   "using %0 with a literal is redundant">, InGroup<ObjCRedundantLiteralUse>;
2558 }
2559
2560 def err_attr_tlsmodel_arg : Error<"tls_model must be \"global-dynamic\", "
2561   "\"local-dynamic\", \"initial-exec\" or \"local-exec\"">;
2562
2563 def err_tls_var_aligned_over_maximum : Error<
2564   "alignment (%0) of thread-local variable %1 is greater than the maximum supported "
2565   "alignment (%2) for a thread-local variable on this target">;
2566
2567 def err_only_annotate_after_access_spec : Error<
2568   "access specifier can only have annotation attributes">;
2569
2570 def err_attribute_section_invalid_for_target : Error<
2571   "argument to 'section' attribute is not valid for this target: %0">;
2572 def warn_mismatched_section : Warning<
2573   "section does not match previous declaration">, InGroup<Section>;
2574
2575 def err_anonymous_property: Error<
2576   "anonymous property is not supported">;
2577 def err_property_is_variably_modified : Error<
2578   "property %0 has a variably modified type">;
2579 def err_no_accessor_for_property : Error<
2580   "no %select{getter|setter}0 defined for property %1">;
2581 def err_cannot_find_suitable_accessor : Error<
2582   "cannot find suitable %select{getter|setter}0 for property %1">;
2583
2584 def warn_alloca_align_alignof : Warning<
2585   "second argument to __builtin_alloca_with_align is supposed to be in bits">,
2586   InGroup<DiagGroup<"alloca-with-align-alignof">>;
2587
2588 def err_alignment_too_small : Error<
2589   "requested alignment must be %0 or greater">;
2590 def err_alignment_too_big : Error<
2591   "requested alignment must be %0 or smaller">;
2592 def err_alignment_not_power_of_two : Error<
2593   "requested alignment is not a power of 2">;
2594 def err_alignment_dependent_typedef_name : Error<
2595   "requested alignment is dependent but declaration is not dependent">;
2596
2597 def err_attribute_aligned_too_great : Error<
2598   "requested alignment must be %0 bytes or smaller">;
2599 def warn_redeclaration_without_attribute_prev_attribute_ignored : Warning<
2600   "%q0 redeclared without %1 attribute: previous %1 ignored">,
2601   InGroup<MicrosoftInconsistentDllImport>;
2602 def warn_redeclaration_without_import_attribute : Warning<
2603   "%q0 redeclared without 'dllimport' attribute: 'dllexport' attribute added">,
2604   InGroup<MicrosoftInconsistentDllImport>;
2605 def warn_dllimport_dropped_from_inline_function : Warning<
2606   "%q0 redeclared inline; %1 attribute ignored">,
2607   InGroup<IgnoredAttributes>;
2608 def warn_attribute_ignored : Warning<"%0 attribute ignored">,
2609   InGroup<IgnoredAttributes>;
2610 def warn_attribute_ignored_on_inline :
2611   Warning<"%0 attribute ignored on inline function">,
2612   InGroup<IgnoredAttributes>;
2613 def warn_attribute_after_definition_ignored : Warning<
2614   "attribute %0 after definition is ignored">,
2615    InGroup<IgnoredAttributes>;
2616 def warn_unknown_attribute_ignored : Warning<
2617   "unknown attribute %0 ignored">, InGroup<UnknownAttributes>;
2618 def warn_cxx11_gnu_attribute_on_type : Warning<
2619   "attribute %0 ignored, because it cannot be applied to a type">,
2620   InGroup<IgnoredAttributes>;
2621 def warn_unhandled_ms_attribute_ignored : Warning<
2622   "__declspec attribute %0 is not supported">, 
2623   InGroup<IgnoredAttributes>;
2624 def err_decl_attribute_invalid_on_stmt : Error<
2625   "%0 attribute cannot be applied to a statement">;
2626 def err_stmt_attribute_invalid_on_decl : Error<
2627   "%0 attribute cannot be applied to a declaration">;
2628 def warn_declspec_attribute_ignored : Warning<
2629   "attribute %0 is ignored, place it after "
2630   "\"%select{class|struct|interface|union|enum}1\" to apply attribute to "
2631   "type declaration">, InGroup<IgnoredAttributes>;
2632 def warn_attribute_precede_definition : Warning<
2633   "attribute declaration must precede definition">,
2634   InGroup<IgnoredAttributes>;
2635 def warn_attribute_void_function_method : Warning<
2636   "attribute %0 cannot be applied to "
2637   "%select{functions|Objective-C method}1 without return value">,
2638   InGroup<IgnoredAttributes>;
2639 def warn_attribute_weak_on_field : Warning<
2640   "__weak attribute cannot be specified on a field declaration">,
2641   InGroup<IgnoredAttributes>;
2642 def warn_gc_attribute_weak_on_local : Warning<
2643   "Objective-C GC does not allow weak variables on the stack">,
2644   InGroup<IgnoredAttributes>;
2645 def warn_nsobject_attribute : Warning<
2646   "'NSObject' attribute may be put on a typedef only; attribute is ignored">,
2647   InGroup<NSobjectAttribute>;
2648 def warn_independentclass_attribute : Warning<
2649   "'objc_independent_class' attribute may be put on a typedef only; "
2650   "attribute is ignored">,
2651   InGroup<IndependentClassAttribute>;
2652 def warn_ptr_independentclass_attribute : Warning<
2653   "'objc_independent_class' attribute may be put on Objective-C object "
2654   "pointer type only; attribute is ignored">,
2655   InGroup<IndependentClassAttribute>;
2656 def warn_attribute_weak_on_local : Warning<
2657   "__weak attribute cannot be specified on an automatic variable when ARC "
2658   "is not enabled">,
2659   InGroup<IgnoredAttributes>;
2660 def warn_weak_identifier_undeclared : Warning<
2661   "weak identifier %0 never declared">;
2662 def err_attribute_weak_static : Error<
2663   "weak declaration cannot have internal linkage">;
2664 def err_attribute_selectany_non_extern_data : Error<
2665   "'selectany' can only be applied to data items with external linkage">;
2666 def err_declspec_thread_on_thread_variable : Error<
2667   "'__declspec(thread)' applied to variable that already has a "
2668   "thread-local storage specifier">;
2669 def err_attribute_dll_not_extern : Error<
2670   "%q0 must have external linkage when declared %q1">;
2671 def err_attribute_dll_thread_local : Error<
2672   "%q0 cannot be thread local when declared %q1">;
2673 def err_attribute_dll_lambda : Error<
2674   "lambda cannot be declared %0">;
2675 def warn_attribute_invalid_on_definition : Warning<
2676   "'%0' attribute cannot be specified on a definition">,
2677   InGroup<IgnoredAttributes>;
2678 def err_attribute_dll_redeclaration : Error<
2679   "redeclaration of %q0 cannot add %q1 attribute">;
2680 def warn_attribute_dll_redeclaration : Warning<
2681   "redeclaration of %q0 should not add %q1 attribute">,
2682   InGroup<DiagGroup<"dll-attribute-on-redeclaration">>;
2683 def err_attribute_dllimport_function_definition : Error<
2684   "dllimport cannot be applied to non-inline function definition">;
2685 def err_attribute_dll_deleted : Error<
2686   "attribute %q0 cannot be applied to a deleted function">;
2687 def err_attribute_dllimport_data_definition : Error<
2688   "definition of dllimport data">;
2689 def err_attribute_dllimport_static_field_definition : Error<
2690   "definition of dllimport static field not allowed">;
2691 def warn_attribute_dllimport_static_field_definition : Warning<
2692   "definition of dllimport static field">,
2693   InGroup<DiagGroup<"dllimport-static-field-def">>;
2694 def warn_attribute_dllexport_explicit_instantiation_decl : Warning<
2695   "explicit instantiation declaration should not be 'dllexport'">,
2696   InGroup<DiagGroup<"dllexport-explicit-instantiation-decl">>;
2697 def warn_invalid_initializer_from_system_header : Warning<
2698   "invalid constructor form class in system header, should not be explicit">,
2699   InGroup<DiagGroup<"invalid-initializer-from-system-header">>;
2700 def note_used_in_initialization_here : Note<"used in initialization here">;
2701 def err_attribute_dll_member_of_dll_class : Error<
2702   "attribute %q0 cannot be applied to member of %q1 class">;
2703 def warn_attribute_dll_instantiated_base_class : Warning<
2704   "propagating dll attribute to %select{already instantiated|explicitly specialized}0 "
2705   "base class template without dll attribute is not supported">,
2706   InGroup<DiagGroup<"unsupported-dll-base-class-template">>, DefaultIgnore;
2707 def err_attribute_dll_ambiguous_default_ctor : Error<
2708   "'__declspec(dllexport)' cannot be applied to more than one default constructor in %0">;
2709 def err_attribute_weakref_not_static : Error<
2710   "weakref declaration must have internal linkage">;
2711 def err_attribute_weakref_not_global_context : Error<
2712   "weakref declaration of %0 must be in a global context">;
2713 def err_attribute_weakref_without_alias : Error<
2714   "weakref declaration of %0 must also have an alias attribute">;
2715 def err_alias_not_supported_on_darwin : Error <
2716   "only weak aliases are supported on darwin">;
2717 def err_alias_to_undefined : Error<
2718   "%select{alias|ifunc}0 must point to a defined %select{variable or |}1function">;
2719 def warn_alias_to_weak_alias : Warning<
2720   "%select{alias|ifunc}2 will always resolve to %0 even if weak definition of %1 is overridden">,
2721   InGroup<IgnoredAttributes>;
2722 def warn_alias_with_section : Warning<
2723   "%select{alias|ifunc}1 will not be in section '%0' but in the same section as the %select{aliasee|resolver}2">,
2724   InGroup<IgnoredAttributes>;
2725 def err_duplicate_mangled_name : Error<
2726   "definition with same mangled name as another definition">;
2727 def err_cyclic_alias : Error<
2728   "%select{alias|ifunc}0 definition is part of a cycle">;
2729 def err_ifunc_resolver_return : Error<
2730   "ifunc resolver function must return a pointer">;
2731 def err_ifunc_resolver_params : Error<
2732   "ifunc resolver function must have no parameters">;
2733 def warn_attribute_wrong_decl_type : Warning<
2734   "%0 attribute only applies to %select{"
2735   "functions"
2736   "|unions"
2737   "|variables and functions"
2738   "|functions and global variables"
2739   "|functions, variables, and Objective-C interfaces"
2740   "|functions and methods"
2741   "|parameters"
2742   "|functions, methods and blocks"
2743   "|functions, methods, and classes"
2744   "|functions, methods, and parameters"
2745   "|functions, methods, and global variables"
2746   "|classes"
2747   "|enums"
2748   "|variables"
2749   "|methods"
2750   "|fields and global variables"
2751   "|structs"
2752   "|parameters and typedefs"
2753   "|variables and typedefs"
2754   "|thread-local variables"
2755   "|variables and fields"
2756   "|variables, data members and tag types"
2757   "|types and namespaces"
2758   "|Objective-C interfaces"
2759   "|methods and properties"
2760   "|struct or union"
2761   "|struct, union or class"
2762   "|types"
2763   "|Objective-C instance methods"
2764   "|init methods of interface or class extension declarations"
2765   "|variables, functions and classes"
2766   "|functions, variables, classes, and Objective-C interfaces"
2767   "|Objective-C protocols"
2768   "|variables with static or thread storage duration"
2769   "|functions, methods, properties, and global variables"
2770   "|structs, unions, and typedefs"
2771   "|structs and typedefs"
2772   "|interface or protocol declarations"
2773   "|kernel functions"
2774   "|non-K&R-style functions"
2775   "|variables, enums, fields and typedefs"
2776   "|functions, methods, enums, and classes"
2777   "|structs, classes, variables, functions, and inline namespaces"
2778   "|variables, functions, methods, types, enumerations, enumerators, labels, and non-static data members"
2779   "|classes and enumerations"
2780   "|named declarations}1">,
2781   InGroup<IgnoredAttributes>;
2782 def err_attribute_wrong_decl_type : Error<warn_attribute_wrong_decl_type.Text>;
2783 def warn_type_attribute_wrong_type : Warning<
2784   "'%0' only applies to %select{function|pointer|"
2785   "Objective-C object or block pointer}1 types; type here is %2">,
2786   InGroup<IgnoredAttributes>;
2787 def warn_incomplete_encoded_type : Warning<
2788   "encoding of %0 type is incomplete because %1 component has unknown encoding">,
2789   InGroup<DiagGroup<"encode-type">>;
2790 def warn_gnu_inline_attribute_requires_inline : Warning<
2791   "'gnu_inline' attribute requires function to be marked 'inline',"
2792   " attribute ignored">,
2793   InGroup<IgnoredAttributes>;
2794 def err_attribute_vecreturn_only_vector_member : Error<
2795   "the vecreturn attribute can only be used on a class or structure with one member, which must be a vector">;
2796 def err_attribute_vecreturn_only_pod_record : Error<
2797   "the vecreturn attribute can only be used on a POD (plain old data) class or structure (i.e. no virtual functions)">;
2798 def err_cconv_change : Error<
2799   "function declared '%0' here was previously declared "
2800   "%select{'%2'|without calling convention}1">;
2801 def warn_cconv_ignored : Warning<
2802   "calling convention %0 ignored for this target">, InGroup<IgnoredAttributes>;
2803 def err_cconv_knr : Error<
2804   "function with no prototype cannot use the %0 calling convention">;
2805 def warn_cconv_knr : Warning<
2806   err_cconv_knr.Text>,
2807   InGroup<DiagGroup<"missing-prototype-for-cc">>;
2808 def err_cconv_varargs : Error<
2809   "variadic function cannot use %0 calling convention">;
2810 def warn_cconv_varargs : Warning<
2811   "%0 calling convention ignored on variadic function">,
2812   InGroup<IgnoredAttributes>;
2813 def warn_cconv_structors : Warning<
2814   "%0 calling convention ignored on constructor/destructor">,
2815   InGroup<IgnoredAttributes>;
2816 def err_regparm_mismatch : Error<"function declared with regparm(%0) "
2817   "attribute was previously declared "
2818   "%plural{0:without the regparm|:with the regparm(%1)}1 attribute">;
2819 def err_returns_retained_mismatch : Error<
2820   "function declared with the ns_returns_retained attribute "
2821   "was previously declared without the ns_returns_retained attribute">;
2822 def err_objc_precise_lifetime_bad_type : Error<
2823   "objc_precise_lifetime only applies to retainable types; type here is %0">;
2824 def warn_objc_precise_lifetime_meaningless : Error<
2825   "objc_precise_lifetime is not meaningful for "
2826   "%select{__unsafe_unretained|__autoreleasing}0 objects">;
2827 def err_invalid_pcs : Error<"invalid PCS type">;
2828 def warn_attribute_not_on_decl : Warning<
2829   "%0 attribute ignored when parsing type">, InGroup<IgnoredAttributes>;
2830 def err_base_specifier_attribute : Error<
2831   "%0 attribute cannot be applied to a base specifier">;
2832 def err_invalid_attribute_on_virtual_function : Error<
2833   "%0 attribute cannot be applied to virtual functions">;
2834
2835 // Availability attribute
2836 def warn_availability_unknown_platform : Warning<
2837   "unknown platform %0 in availability macro">, InGroup<Availability>;
2838 def warn_availability_version_ordering : Warning<
2839   "feature cannot be %select{introduced|deprecated|obsoleted}0 in %1 version "
2840   "%2 before it was %select{introduced|deprecated|obsoleted}3 in version %4; "
2841   "attribute ignored">, InGroup<Availability>;
2842 def warn_mismatched_availability: Warning<
2843   "availability does not match previous declaration">, InGroup<Availability>;
2844 def warn_mismatched_availability_override : Warning<
2845   "%select{|overriding }4method %select{introduced after|"
2846   "deprecated before|obsoleted before}0 "
2847   "%select{the protocol method it implements|overridden method}4 "
2848   "on %1 (%2 vs. %3)">, InGroup<Availability>;
2849 def warn_mismatched_availability_override_unavail : Warning<
2850   "%select{|overriding }1method cannot be unavailable on %0 when "
2851   "%select{the protocol method it implements|its overridden method}1 is "
2852   "available">,
2853   InGroup<Availability>;
2854 def note_overridden_method : Note<
2855   "overridden method is here">;
2856 def note_protocol_method : Note<
2857   "protocol method is here">;
2858
2859 def warn_unguarded_availability :
2860   Warning<"%0 is only available on %1 %2 or newer">,
2861   InGroup<UnguardedAvailability>, DefaultIgnore;
2862 def warn_partial_availability : Warning<"%0 is only available conditionally">,
2863     InGroup<UnguardedAvailability>, DefaultIgnore;
2864 def note_partial_availability_silence : Note<
2865   "explicitly redeclare %0 to silence this warning">;
2866 def note_unguarded_available_silence : Note<
2867   "enclose %0 in an @available check to silence this warning">;
2868 def warn_partial_message : Warning<"%0 is partial: %1">,
2869     InGroup<UnguardedAvailability>, DefaultIgnore;
2870 def warn_partial_fwdclass_message : Warning<
2871     "%0 may be partial because the receiver type is unknown">,
2872     InGroup<UnguardedAvailability>, DefaultIgnore;
2873
2874 // Thread Safety Attributes
2875 def warn_invalid_capability_name : Warning<
2876   "invalid capability name '%0'; capability name must be 'mutex' or 'role'">,
2877   InGroup<ThreadSafetyAttributes>, DefaultIgnore;
2878 def warn_thread_attribute_ignored : Warning<
2879   "ignoring %0 attribute because its argument is invalid">,
2880   InGroup<ThreadSafetyAttributes>, DefaultIgnore;
2881 def warn_thread_attribute_argument_not_lockable : Warning<
2882   "%0 attribute requires arguments whose type is annotated "
2883   "with 'capability' attribute; type here is %1">,
2884   InGroup<ThreadSafetyAttributes>, DefaultIgnore;
2885 def warn_thread_attribute_decl_not_lockable : Warning<
2886   "%0 attribute can only be applied in a context annotated "
2887   "with 'capability(\"mutex\")' attribute">,
2888   InGroup<ThreadSafetyAttributes>, DefaultIgnore;
2889 def warn_thread_attribute_decl_not_pointer : Warning<
2890   "%0 only applies to pointer types; type here is %1">,
2891   InGroup<ThreadSafetyAttributes>, DefaultIgnore;
2892 def err_attribute_argument_out_of_range : Error<
2893   "%0 attribute parameter %1 is out of bounds: "
2894   "%plural{0:no parameters to index into|"
2895   "1:can only be 1, since there is one parameter|"
2896   ":must be between 1 and %2}2">;
2897
2898 // Thread Safety Analysis   
2899 def warn_unlock_but_no_lock : Warning<"releasing %0 '%1' that was not held">,
2900   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2901 def warn_unlock_kind_mismatch : Warning<
2902   "releasing %0 '%1' using %select{shared|exclusive}2 access, expected "
2903   "%select{shared|exclusive}3 access">,
2904   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2905 def warn_double_lock : Warning<"acquiring %0 '%1' that is already held">,
2906   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2907 def warn_no_unlock : Warning<
2908   "%0 '%1' is still held at the end of function">,
2909   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2910 def warn_expecting_locked : Warning<
2911   "expecting %0 '%1' to be held at the end of function">,
2912   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;  
2913 // FIXME: improve the error message about locks not in scope
2914 def warn_lock_some_predecessors : Warning<
2915   "%0 '%1' is not held on every path through here">,
2916   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2917 def warn_expecting_lock_held_on_loop : Warning<
2918   "expecting %0 '%1' to be held at start of each loop">,
2919   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2920 def note_locked_here : Note<"%0 acquired here">;
2921 def warn_lock_exclusive_and_shared : Warning<
2922   "%0 '%1' is acquired exclusively and shared in the same scope">,
2923   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2924 def note_lock_exclusive_and_shared : Note<
2925   "the other acquisition of %0 '%1' is here">;
2926 def warn_variable_requires_any_lock : Warning<
2927   "%select{reading|writing}1 variable '%0' requires holding "
2928   "%select{any mutex|any mutex exclusively}1">,
2929   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2930 def warn_var_deref_requires_any_lock : Warning<
2931   "%select{reading|writing}1 the value pointed to by '%0' requires holding "
2932   "%select{any mutex|any mutex exclusively}1">,
2933   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2934 def warn_fun_excludes_mutex : Warning<
2935   "cannot call function '%1' while %0 '%2' is held">,
2936   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2937 def warn_cannot_resolve_lock : Warning<
2938   "cannot resolve lock expression">,
2939   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2940 def warn_acquired_before : Warning<
2941   "%0 '%1' must be acquired before '%2'">,
2942   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2943 def warn_acquired_before_after_cycle : Warning<
2944   "Cycle in acquired_before/after dependencies, starting with '%0'">,
2945   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2946
2947
2948 // Thread safety warnings negative capabilities
2949 def warn_acquire_requires_negative_cap : Warning<
2950   "acquiring %0 '%1' requires negative capability '%2'">,
2951   InGroup<ThreadSafetyNegative>, DefaultIgnore;
2952
2953 // Thread safety warnings on pass by reference
2954 def warn_guarded_pass_by_reference : Warning<
2955   "passing variable '%1' by reference requires holding %0 "
2956   "%select{'%2'|'%2' exclusively}3">,
2957   InGroup<ThreadSafetyReference>, DefaultIgnore;
2958 def warn_pt_guarded_pass_by_reference : Warning<
2959   "passing the value that '%1' points to by reference requires holding %0 "
2960   "%select{'%2'|'%2' exclusively}3">,
2961   InGroup<ThreadSafetyReference>, DefaultIgnore;
2962
2963 // Imprecise thread safety warnings
2964 def warn_variable_requires_lock : Warning<
2965   "%select{reading|writing}3 variable '%1' requires holding %0 "
2966   "%select{'%2'|'%2' exclusively}3">,
2967   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2968 def warn_var_deref_requires_lock : Warning<
2969   "%select{reading|writing}3 the value pointed to by '%1' requires "
2970   "holding %0 %select{'%2'|'%2' exclusively}3">,
2971   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2972 def warn_fun_requires_lock : Warning<
2973   "calling function '%1' requires holding %0 %select{'%2'|'%2' exclusively}3">,
2974   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2975
2976 // Precise thread safety warnings
2977 def warn_variable_requires_lock_precise :
2978   Warning<warn_variable_requires_lock.Text>,
2979   InGroup<ThreadSafetyPrecise>, DefaultIgnore;
2980 def warn_var_deref_requires_lock_precise :
2981   Warning<warn_var_deref_requires_lock.Text>,
2982   InGroup<ThreadSafetyPrecise>, DefaultIgnore;
2983 def warn_fun_requires_lock_precise :
2984   Warning<warn_fun_requires_lock.Text>,
2985   InGroup<ThreadSafetyPrecise>, DefaultIgnore;
2986 def note_found_mutex_near_match : Note<"found near match '%0'">;
2987
2988 // Verbose thread safety warnings
2989 def warn_thread_safety_verbose : Warning<"Thread safety verbose warning.">, 
2990   InGroup<ThreadSafetyVerbose>, DefaultIgnore;
2991 def note_thread_warning_in_fun : Note<"Thread warning in function '%0'">;
2992 def note_guarded_by_declared_here : Note<"Guarded_by declared here.">;
2993
2994 // Dummy warning that will trigger "beta" warnings from the analysis if enabled. 
2995 def warn_thread_safety_beta : Warning<"Thread safety beta warning.">, 
2996   InGroup<ThreadSafetyBeta>, DefaultIgnore;
2997
2998 // Consumed warnings
2999 def warn_use_in_invalid_state : Warning<
3000   "invalid invocation of method '%0' on object '%1' while it is in the '%2' "
3001   "state">, InGroup<Consumed>, DefaultIgnore;
3002 def warn_use_of_temp_in_invalid_state : Warning<
3003   "invalid invocation of method '%0' on a temporary object while it is in the "
3004   "'%1' state">, InGroup<Consumed>, DefaultIgnore;
3005 def warn_attr_on_unconsumable_class : Warning<
3006   "consumed analysis attribute is attached to member of class '%0' which isn't "
3007   "marked as consumable">, InGroup<Consumed>, DefaultIgnore;
3008 def warn_return_typestate_for_unconsumable_type : Warning<
3009   "return state set for an unconsumable type '%0'">, InGroup<Consumed>,
3010   DefaultIgnore;
3011 def warn_return_typestate_mismatch : Warning<
3012   "return value not in expected state; expected '%0', observed '%1'">,
3013   InGroup<Consumed>, DefaultIgnore;
3014 def warn_loop_state_mismatch : Warning<
3015   "state of variable '%0' must match at the entry and exit of loop">,
3016   InGroup<Consumed>, DefaultIgnore;
3017 def warn_param_return_typestate_mismatch : Warning<
3018   "parameter '%0' not in expected state when the function returns: expected "
3019   "'%1', observed '%2'">, InGroup<Consumed>, DefaultIgnore;
3020 def warn_param_typestate_mismatch : Warning<
3021   "argument not in expected state; expected '%0', observed '%1'">,
3022   InGroup<Consumed>, DefaultIgnore;
3023
3024 // no_sanitize attribute
3025 def warn_unknown_sanitizer_ignored : Warning<
3026   "unknown sanitizer '%0' ignored">, InGroup<UnknownSanitizers>;
3027
3028 def warn_impcast_vector_scalar : Warning<
3029   "implicit conversion turns vector to scalar: %0 to %1">,
3030   InGroup<Conversion>, DefaultIgnore;
3031 def warn_impcast_complex_scalar : Warning<
3032   "implicit conversion discards imaginary component: %0 to %1">,
3033   InGroup<Conversion>, DefaultIgnore;
3034 def warn_impcast_float_precision : Warning<
3035   "implicit conversion loses floating-point precision: %0 to %1">,
3036   InGroup<Conversion>, DefaultIgnore;
3037 def warn_impcast_double_promotion : Warning<
3038   "implicit conversion increases floating-point precision: %0 to %1">,
3039   InGroup<DoublePromotion>, DefaultIgnore;
3040 def warn_impcast_integer_sign : Warning<
3041   "implicit conversion changes signedness: %0 to %1">,
3042   InGroup<SignConversion>, DefaultIgnore;
3043 def warn_impcast_integer_sign_conditional : Warning<
3044   "operand of ? changes signedness: %0 to %1">,
3045   InGroup<SignConversion>, DefaultIgnore;
3046 def warn_impcast_integer_precision : Warning<
3047   "implicit conversion loses integer precision: %0 to %1">,
3048   InGroup<Conversion>, DefaultIgnore;
3049 def warn_impcast_integer_64_32 : Warning<
3050   "implicit conversion loses integer precision: %0 to %1">,
3051   InGroup<Shorten64To32>, DefaultIgnore;
3052 def warn_impcast_integer_precision_constant : Warning<
3053   "implicit conversion from %2 to %3 changes value from %0 to %1">,
3054   InGroup<ConstantConversion>;
3055 def warn_impcast_bitfield_precision_constant : Warning<
3056   "implicit truncation from %2 to bit-field changes value from %0 to %1">,
3057   InGroup<BitFieldConstantConversion>;
3058
3059 def warn_impcast_literal_float_to_integer : Warning<
3060   "implicit conversion from %0 to %1 changes value from %2 to %3">,
3061   InGroup<LiteralConversion>;
3062 def warn_impcast_float_integer : Warning<
3063   "implicit conversion turns floating-point number into integer: %0 to %1">,
3064   InGroup<FloatConversion>, DefaultIgnore;
3065
3066 def warn_impcast_float_to_integer : Warning<
3067   "implicit conversion of out of range value from %0 to %1 changes value "
3068   "from %2 to %3">,
3069   InGroup<FloatOverflowConversion>, DefaultIgnore;
3070 def warn_impcast_float_to_integer_zero : Warning<
3071   "implicit conversion from %0 to %1 changes non-zero value from %2 to %3">,
3072   InGroup<FloatZeroConversion>, DefaultIgnore;
3073
3074 def warn_impcast_string_literal_to_bool : Warning<
3075   "implicit conversion turns string literal into bool: %0 to %1">,
3076   InGroup<StringConversion>, DefaultIgnore;
3077 def warn_impcast_different_enum_types : Warning<
3078   "implicit conversion from enumeration type %0 to different enumeration type "
3079   "%1">, InGroup<EnumConversion>;
3080 def warn_impcast_bool_to_null_pointer : Warning<
3081     "initialization of pointer of type %0 to null from a constant boolean "
3082     "expression">, InGroup<BoolConversion>;
3083 def warn_non_literal_null_pointer : Warning<
3084     "expression which evaluates to zero treated as a null pointer constant of "
3085     "type %0">, InGroup<NonLiteralNullConversion>;
3086 def warn_impcast_null_pointer_to_integer : Warning<
3087     "implicit conversion of %select{NULL|nullptr}0 constant to %1">,
3088     InGroup<NullConversion>;
3089 def warn_impcast_floating_point_to_bool : Warning<
3090     "implicit conversion turns floating-point number into bool: %0 to %1">,
3091     InGroup<ImplicitConversionFloatingPointToBool>;
3092 def ext_ms_impcast_fn_obj : ExtWarn<
3093   "implicit conversion between pointer-to-function and pointer-to-object is a "
3094   "Microsoft extension">, InGroup<MicrosoftCast>;
3095
3096 def warn_impcast_pointer_to_bool : Warning<
3097     "address of%select{| function| array}0 '%1' will always evaluate to "
3098     "'true'">,
3099     InGroup<PointerBoolConversion>;
3100 def warn_cast_nonnull_to_bool : Warning<
3101     "nonnull %select{function call|parameter}0 '%1' will evaluate to "
3102     "'true' on first encounter">,
3103     InGroup<PointerBoolConversion>;
3104 def warn_this_bool_conversion : Warning<
3105   "'this' pointer cannot be null in well-defined C++ code; pointer may be "
3106   "assumed to always convert to true">, InGroup<UndefinedBoolConversion>;
3107 def warn_address_of_reference_bool_conversion : Warning<
3108   "reference cannot be bound to dereferenced null pointer in well-defined C++ "
3109   "code; pointer may be assumed to always convert to true">,
3110   InGroup<UndefinedBoolConversion>;
3111
3112 def warn_null_pointer_compare : Warning<
3113     "comparison of %select{address of|function|array}0 '%1' %select{not |}2"
3114     "equal to a null pointer is always %select{true|false}2">,
3115     InGroup<TautologicalPointerCompare>;
3116 def warn_nonnull_expr_compare : Warning<
3117     "comparison of nonnull %select{function call|parameter}0 '%1' "
3118     "%select{not |}2equal to a null pointer is '%select{true|false}2' on first "
3119     "encounter">,
3120     InGroup<TautologicalPointerCompare>;
3121 def warn_this_null_compare : Warning<
3122   "'this' pointer cannot be null in well-defined C++ code; comparison may be "
3123   "assumed to always evaluate to %select{true|false}0">,
3124   InGroup<TautologicalUndefinedCompare>;
3125 def warn_address_of_reference_null_compare : Warning<
3126   "reference cannot be bound to dereferenced null pointer in well-defined C++ "
3127   "code; comparison may be assumed to always evaluate to "
3128   "%select{true|false}0">,
3129   InGroup<TautologicalUndefinedCompare>;
3130 def note_reference_is_return_value : Note<"%0 returns a reference">;
3131
3132 def note_function_warning_silence : Note<
3133     "prefix with the address-of operator to silence this warning">;
3134 def note_function_to_function_call : Note<
3135     "suffix with parentheses to turn this into a function call">;
3136 def warn_impcast_objective_c_literal_to_bool : Warning<
3137     "implicit boolean conversion of Objective-C object literal always "
3138     "evaluates to true">,
3139     InGroup<ObjCLiteralConversion>;
3140
3141 def warn_cast_align : Warning<
3142   "cast from %0 to %1 increases required alignment from %2 to %3">,
3143   InGroup<CastAlign>, DefaultIgnore;
3144 def warn_old_style_cast : Warning<
3145   "use of old-style cast">, InGroup<OldStyleCast>, DefaultIgnore;
3146
3147 // Separate between casts to void* and non-void* pointers.
3148 // Some APIs use (abuse) void* for something like a user context,
3149 // and often that value is an integer even if it isn't a pointer itself.
3150 // Having a separate warning flag allows users to control the warning
3151 // for their workflow.
3152 def warn_int_to_pointer_cast : Warning<
3153   "cast to %1 from smaller integer type %0">,
3154   InGroup<IntToPointerCast>;
3155 def warn_int_to_void_pointer_cast : Warning<
3156   "cast to %1 from smaller integer type %0">,
3157   InGroup<IntToVoidPointerCast>;
3158
3159 def warn_no_underlying_type_specified_for_enum_bitfield : Warning<
3160   "enums in the Microsoft ABI are signed integers by default; consider giving "
3161   "the enum %0 an unsigned underlying type to make this code portable">,
3162   InGroup<SignedEnumBitfield>, DefaultIgnore;
3163 def warn_attribute_packed_for_bitfield : Warning<
3164   "'packed' attribute was ignored on bit-fields with single-byte alignment "
3165   "in older versions of GCC and Clang">,
3166   InGroup<DiagGroup<"attribute-packed-for-bitfield">>;
3167 def warn_transparent_union_attribute_field_size_align : Warning<
3168   "%select{alignment|size}0 of field %1 (%2 bits) does not match the "
3169   "%select{alignment|size}0 of the first field in transparent union; "
3170   "transparent_union attribute ignored">,
3171   InGroup<IgnoredAttributes>;
3172 def note_transparent_union_first_field_size_align : Note<
3173   "%select{alignment|size}0 of first field is %1 bits">;
3174 def warn_transparent_union_attribute_not_definition : Warning<
3175   "transparent_union attribute can only be applied to a union definition; "
3176   "attribute ignored">,
3177   InGroup<IgnoredAttributes>;
3178 def warn_transparent_union_attribute_floating : Warning<
3179   "first field of a transparent union cannot have %select{floating point|"
3180   "vector}0 type %1; transparent_union attribute ignored">,
3181   InGroup<IgnoredAttributes>;
3182 def warn_transparent_union_attribute_zero_fields : Warning<
3183   "transparent union definition must contain at least one field; "
3184   "transparent_union attribute ignored">,
3185   InGroup<IgnoredAttributes>;
3186 def warn_attribute_type_not_supported : Warning<
3187   "%0 attribute argument not supported: %1">,
3188   InGroup<IgnoredAttributes>;
3189 def warn_attribute_unknown_visibility : Warning<"unknown visibility %0">,
3190   InGroup<IgnoredAttributes>;
3191 def warn_attribute_protected_visibility :
3192   Warning<"target does not support 'protected' visibility; using 'default'">,
3193   InGroup<DiagGroup<"unsupported-visibility">>;
3194 def err_mismatched_visibility: Error<"visibility does not match previous declaration">;
3195 def note_previous_attribute : Note<"previous attribute is here">;
3196 def note_conflicting_attribute : Note<"conflicting attribute is here">;
3197 def note_attribute : Note<"attribute is here">;
3198 def err_mismatched_ms_inheritance : Error<
3199   "inheritance model does not match %select{definition|previous declaration}0">;
3200 def warn_ignored_ms_inheritance : Warning<
3201   "inheritance model ignored on %select{primary template|partial specialization}0">,
3202   InGroup<IgnoredAttributes>;
3203 def note_previous_ms_inheritance : Note<
3204   "previous inheritance model specified here">;
3205 def err_machine_mode : Error<"%select{unknown|unsupported}0 machine mode %1">;
3206 def err_mode_not_primitive : Error<
3207   "mode attribute only supported for integer and floating-point types">;
3208 def err_mode_wrong_type : Error<
3209   "type of machine mode does not match type of base type">;
3210 def warn_vector_mode_deprecated : Warning<
3211   "specifying vector types with the 'mode' attribute is deprecated; "
3212   "use the 'vector_size' attribute instead">,
3213   InGroup<DeprecatedAttributes>;
3214 def err_complex_mode_vector_type : Error<
3215   "type of machine mode does not support base vector types">;
3216 def err_enum_mode_vector_type : Error<
3217   "mode %0 is not supported for enumeration types">;
3218 def warn_attribute_nonnull_no_pointers : Warning<
3219   "'nonnull' attribute applied to function with no pointer arguments">,
3220   InGroup<IgnoredAttributes>;
3221 def warn_attribute_nonnull_parm_no_args : Warning<
3222   "'nonnull' attribute when used on parameters takes no arguments">,
3223   InGroup<IgnoredAttributes>;
3224 def note_declared_nonnull : Note<
3225   "declared %select{'returns_nonnull'|'nonnull'}0 here">;
3226 def warn_attribute_sentinel_named_arguments : Warning<
3227   "'sentinel' attribute requires named arguments">,
3228   InGroup<IgnoredAttributes>;
3229 def warn_attribute_sentinel_not_variadic : Warning<
3230   "'sentinel' attribute only supported for variadic %select{functions|blocks}0">,
3231   InGroup<IgnoredAttributes>;
3232 def err_attribute_sentinel_less_than_zero : Error<
3233   "'sentinel' parameter 1 less than zero">;
3234 def err_attribute_sentinel_not_zero_or_one : Error<
3235   "'sentinel' parameter 2 not 0 or 1">;
3236 def warn_cleanup_ext : Warning<
3237   "GCC does not allow the 'cleanup' attribute argument to be anything other "
3238   "than a simple identifier">, 
3239   InGroup<GccCompat>;
3240 def err_attribute_cleanup_arg_not_function : Error<
3241   "'cleanup' argument %select{|%1 |%1 }0is not a %select{||single }0function">;
3242 def err_attribute_cleanup_func_must_take_one_arg : Error<
3243   "'cleanup' function %0 must take 1 parameter">;
3244 def err_attribute_cleanup_func_arg_incompatible_type : Error<
3245   "'cleanup' function %0 parameter has "
3246   "%diff{type $ which is incompatible with type $|incompatible type}1,2">;
3247 def err_attribute_regparm_wrong_platform : Error<
3248   "'regparm' is not valid on this platform">;
3249 def err_attribute_regparm_invalid_number : Error<
3250   "'regparm' parameter must be between 0 and %0 inclusive">;
3251 def err_attribute_not_supported_in_lang : Error<
3252   "%0 attribute is not supported in %select{C|C++|Objective-C}1">;
3253 def err_attribute_not_supported_on_arch
3254     : Error<"%0 attribute is not supported on '%1'">;
3255
3256 // Clang-Specific Attributes
3257 def warn_attribute_iboutlet : Warning<
3258   "%0 attribute can only be applied to instance variables or properties">,
3259   InGroup<IgnoredAttributes>;
3260 def err_iboutletcollection_type : Error<
3261   "invalid type %0 as argument of iboutletcollection attribute">;
3262 def err_iboutletcollection_builtintype : Error<
3263   "type argument of iboutletcollection attribute cannot be a builtin type">;
3264 def warn_iboutlet_object_type : Warning<
3265   "%select{instance variable|property}2 with %0 attribute must "
3266   "be an object type (invalid %1)">, InGroup<ObjCInvalidIBOutletProperty>;
3267 def warn_iboutletcollection_property_assign : Warning<
3268   "IBOutletCollection properties should be copy/strong and not assign">,
3269   InGroup<ObjCInvalidIBOutletProperty>;
3270   
3271 def err_attribute_overloadable_missing : Error<
3272   "%select{overloaded function|redeclaration of}0 %1 must have the "
3273   "'overloadable' attribute">;
3274 def note_attribute_overloadable_prev_overload : Note<
3275   "previous overload of function is here">;
3276 def err_attribute_overloadable_no_prototype : Error<
3277   "'overloadable' function %0 must have a prototype">;
3278 def warn_ns_attribute_wrong_return_type : Warning<
3279   "%0 attribute only applies to %select{functions|methods|properties}1 that "
3280   "return %select{an Objective-C object|a pointer|a non-retainable pointer}2">,
3281   InGroup<IgnoredAttributes>;
3282 def err_ns_attribute_wrong_parameter_type : Error<
3283   "%0 attribute only applies to "
3284   "%select{Objective-C object|pointer|pointer-to-CF-pointer}1 parameters">;
3285 def warn_ns_attribute_wrong_parameter_type : Warning<
3286   "%0 attribute only applies to "
3287   "%select{Objective-C object|pointer|pointer-to-CF-pointer}1 parameters">,
3288   InGroup<IgnoredAttributes>;
3289 def warn_objc_requires_super_protocol : Warning<
3290   "%0 attribute cannot be applied to %select{methods in protocols|dealloc}1">,
3291   InGroup<DiagGroup<"requires-super-attribute">>;
3292 def note_protocol_decl : Note<
3293   "protocol is declared here">;
3294 def note_protocol_decl_undefined : Note<
3295   "protocol %0 has no definition">;
3296
3297 // objc_designated_initializer attribute diagnostics.
3298 def warn_objc_designated_init_missing_super_call : Warning<
3299   "designated initializer missing a 'super' call to a designated initializer of the super class">,
3300   InGroup<ObjCDesignatedInit>;
3301 def note_objc_designated_init_marked_here : Note<
3302   "method marked as designated initializer of the class here">;
3303 def warn_objc_designated_init_non_super_designated_init_call : Warning<
3304   "designated initializer should only invoke a designated initializer on 'super'">,
3305   InGroup<ObjCDesignatedInit>;
3306 def warn_objc_designated_init_non_designated_init_call : Warning<
3307   "designated initializer invoked a non-designated initializer">,
3308   InGroup<ObjCDesignatedInit>;
3309 def warn_objc_secondary_init_super_init_call : Warning<
3310   "convenience initializer should not invoke an initializer on 'super'">,
3311   InGroup<ObjCDesignatedInit>;
3312 def warn_objc_secondary_init_missing_init_call : Warning<
3313   "convenience initializer missing a 'self' call to another initializer">,
3314   InGroup<ObjCDesignatedInit>;
3315 def warn_objc_implementation_missing_designated_init_override : Warning<
3316   "method override for the designated initializer of the superclass %objcinstance0 not found">,
3317   InGroup<ObjCDesignatedInit>;
3318
3319 // objc_bridge attribute diagnostics.
3320 def err_objc_attr_not_id : Error<
3321   "parameter of %0 attribute must be a single name of an Objective-C %select{class|protocol}1">;
3322 def err_objc_attr_typedef_not_id : Error<
3323   "parameter of %0 attribute must be 'id' when used on a typedef">;
3324 def err_objc_attr_typedef_not_void_pointer : Error<
3325   "'objc_bridge(id)' is only allowed on structs and typedefs of void pointers">;
3326 def err_objc_cf_bridged_not_interface : Error<
3327   "CF object of type %0 is bridged to %1, which is not an Objective-C class">;
3328 def err_objc_ns_bridged_invalid_cfobject : Error<
3329   "ObjectiveC object of type %0 is bridged to %1, which is not valid CF object">;
3330 def warn_objc_invalid_bridge : Warning<
3331   "%0 bridges to %1, not %2">, InGroup<ObjCBridge>;
3332 def warn_objc_invalid_bridge_to_cf : Warning<
3333   "%0 cannot bridge to %1">, InGroup<ObjCBridge>;
3334
3335 // objc_bridge_related attribute diagnostics.
3336 def err_objc_bridged_related_invalid_class : Error<
3337   "could not find Objective-C class %0 to convert %1 to %2">;
3338 def err_objc_bridged_related_invalid_class_name : Error<
3339   "%0 must be name of an Objective-C class to be able to convert %1 to %2">;
3340 def err_objc_bridged_related_known_method : Error<
3341  "%0 must be explicitly converted to %1; use %select{%objcclass2|%objcinstance2}3 "
3342  "method for this conversion">;
3343
3344 def err_objc_attr_protocol_requires_definition : Error<
3345   "attribute %0 can only be applied to @protocol definitions, not forward declarations">;
3346
3347 // Function Parameter Semantic Analysis.
3348 def err_param_with_void_type : Error<"argument may not have 'void' type">;
3349 def err_void_only_param : Error<
3350   "'void' must be the first and only parameter if specified">;
3351 def err_void_param_qualified : Error<
3352   "'void' as parameter must not have type qualifiers">;
3353 def err_ident_list_in_fn_declaration : Error<
3354   "a parameter list without types is only allowed in a function definition">;
3355 def ext_param_not_declared : Extension<
3356   "parameter %0 was not declared, defaulting to type 'int'">;
3357 def err_param_default_argument : Error<
3358   "C does not support default arguments">;
3359 def err_param_default_argument_redefinition : Error<
3360   "redefinition of default argument">;
3361 def ext_param_default_argument_redefinition : ExtWarn<
3362   err_param_default_argument_redefinition.Text>,
3363   InGroup<MicrosoftDefaultArgRedefinition>;
3364 def err_param_default_argument_missing : Error<
3365   "missing default argument on parameter">;
3366 def err_param_default_argument_missing_name : Error<
3367   "missing default argument on parameter %0">;
3368 def err_param_default_argument_references_param : Error<
3369   "default argument references parameter %0">;
3370 def err_param_default_argument_references_local : Error<
3371   "default argument references local variable %0 of enclosing function">;
3372 def err_param_default_argument_references_this : Error<
3373   "default argument references 'this'">;
3374 def err_param_default_argument_nonfunc : Error<
3375   "default arguments can only be specified for parameters in a function "
3376   "declaration">;
3377 def err_param_default_argument_template_redecl : Error<
3378   "default arguments cannot be added to a function template that has already "
3379   "been declared">;
3380 def err_param_default_argument_member_template_redecl : Error<
3381   "default arguments cannot be added to an out-of-line definition of a member "
3382   "of a %select{class template|class template partial specialization|nested "
3383   "class in a template}0">;
3384 def err_param_default_argument_on_parameter_pack : Error<
3385   "parameter pack cannot have a default argument">;
3386 def err_uninitialized_member_for_assign : Error<
3387   "cannot define the implicit copy assignment operator for %0, because "
3388   "non-static %select{reference|const}1 member %2 cannot use copy "
3389   "assignment operator">;
3390 def err_uninitialized_member_in_ctor : Error<
3391   "%select{constructor for %1|"
3392   "implicit default constructor for %1|"
3393   "cannot use constructor inherited from %1:}0 must explicitly "
3394   "initialize the %select{reference|const}2 member %3">;
3395 def err_default_arg_makes_ctor_special : Error<
3396   "addition of default argument on redeclaration makes this constructor a "
3397   "%select{default|copy|move}0 constructor">;
3398
3399 def err_use_of_default_argument_to_function_declared_later : Error<
3400   "use of default argument to function %0 that is declared later in class %1">;
3401 def note_default_argument_declared_here : Note<
3402   "default argument declared here">;
3403 def err_recursive_default_argument : Error<"recursive evaluation of default argument">;
3404
3405 def ext_param_promoted_not_compatible_with_prototype : ExtWarn<
3406   "%diff{promoted type $ of K&R function parameter is not compatible with the "
3407   "parameter type $|promoted type of K&R function parameter is not compatible "
3408   "with parameter type}0,1 declared in a previous prototype">,
3409   InGroup<KNRPromotedParameter>;
3410
3411
3412 // C++ Overloading Semantic Analysis.
3413 def err_ovl_diff_return_type : Error<
3414   "functions that differ only in their return type cannot be overloaded">;
3415 def err_ovl_static_nonstatic_member : Error<
3416   "static and non-static member functions with the same parameter types "
3417   "cannot be overloaded">;
3418
3419 def err_ovl_no_viable_function_in_call : Error<
3420   "no matching function for call to %0">;
3421 def err_ovl_no_viable_member_function_in_call : Error<
3422   "no matching member function for call to %0">;
3423 def err_ovl_ambiguous_call : Error<
3424   "call to %0 is ambiguous">;
3425 def err_ovl_deleted_call : Error<
3426   "call to %select{unavailable|deleted}0 function %1%2">;
3427 def err_ovl_ambiguous_member_call : Error<
3428   "call to member function %0 is ambiguous">;
3429 def err_ovl_deleted_member_call : Error<
3430   "call to %select{unavailable|deleted}0 member function %1%2">;
3431 def note_ovl_too_many_candidates : Note<
3432     "remaining %0 candidate%s0 omitted; "
3433     "pass -fshow-overloads=all to show them">;
3434 def note_ovl_candidate : Note<"candidate "
3435     "%select{function|function|constructor|"
3436     "function |function |constructor |"
3437     "is the implicit default constructor|"
3438     "is the implicit copy constructor|"
3439     "is the implicit move constructor|"
3440     "is the implicit copy assignment operator|"
3441     "is the implicit move assignment operator|"
3442     "inherited constructor|"
3443     "inherited constructor }0%2"
3444     "%select{| has different class%diff{ (expected $ but has $)|}4,5"
3445     "| has different number of parameters (expected %4 but has %5)"
3446     "| has type mismatch at %ordinal4 parameter"
3447     "%diff{ (expected $ but has $)|}5,6"
3448     "| has different return type%diff{ ($ expected but has $)|}4,5"
3449     "| has different qualifiers (expected "
3450     "%select{none|const|restrict|const and restrict|volatile|const and volatile"
3451     "|volatile and restrict|const, volatile, and restrict}4 but found "
3452     "%select{none|const|restrict|const and restrict|volatile|const and volatile"
3453     "|volatile and restrict|const, volatile, and restrict}5)"
3454     "| has different exception specification}3">;
3455
3456 def note_ovl_candidate_inherited_constructor : Note<
3457     "constructor from base class %0 inherited here">;
3458 def note_ovl_candidate_inherited_constructor_slice : Note<
3459     "candidate %select{constructor|template}0 ignored: "
3460     "inherited constructor cannot be used to %select{copy|move}1 object">;
3461 def note_ovl_candidate_illegal_constructor : Note<
3462     "candidate %select{constructor|template}0 ignored: "
3463     "instantiation %select{takes|would take}0 its own class type by value">;
3464 def note_ovl_candidate_bad_deduction : Note<
3465     "candidate template ignored: failed template argument deduction">;
3466 def note_ovl_candidate_incomplete_deduction : Note<"candidate template ignored: "
3467     "couldn't infer template argument %0">;
3468 def note_ovl_candidate_inconsistent_deduction : Note<
3469     "candidate template ignored: deduced conflicting %select{types|values|"
3470     "templates}0 for parameter %1%diff{ ($ vs. $)|}2,3">;
3471 def note_ovl_candidate_inconsistent_deduction_types : Note<
3472     "candidate template ignored: deduced values %diff{"
3473     "of conflicting types for parameter %0 (%1 of type $ vs. %3 of type $)|"
3474     "%1 and %3 of conflicting types for parameter %0}2,4">;
3475 def note_ovl_candidate_explicit_arg_mismatch_named : Note<
3476     "candidate template ignored: invalid explicitly-specified argument "
3477     "for template parameter %0">;
3478 def note_ovl_candidate_explicit_arg_mismatch_unnamed : Note<
3479     "candidate template ignored: invalid explicitly-specified argument "
3480     "for %ordinal0 template parameter">;
3481 def note_ovl_candidate_instantiation_depth : Note<
3482     "candidate template ignored: substitution exceeded maximum template "
3483     "instantiation depth">;
3484 def note_ovl_candidate_underqualified : Note<
3485     "candidate template ignored: cannot deduce a type for %0 that would "
3486     "make %2 equal %1">;
3487 def note_ovl_candidate_substitution_failure : Note<
3488     "candidate template ignored: substitution failure%0%1">;
3489 def note_ovl_candidate_disabled_by_enable_if : Note<
3490     "candidate template ignored: disabled by %0%1">;
3491 def note_ovl_candidate_has_pass_object_size_params: Note<
3492     "candidate address cannot be taken because parameter %0 has "
3493     "pass_object_size attribute">;
3494 def err_diagnose_if_succeeded : Error<"%0">;
3495 def warn_diagnose_if_succeeded : Warning<"%0">, InGroup<UserDefinedWarnings>,
3496     ShowInSystemHeader;
3497 def note_ovl_candidate_disabled_by_function_cond_attr : Note<
3498     "candidate disabled: %0">;
3499 def note_ovl_candidate_disabled_by_extension : Note<
3500     "candidate disabled due to OpenCL extension">;
3501 def err_addrof_function_disabled_by_enable_if_attr : Error<
3502     "cannot take address of function %0 because it has one or more "
3503     "non-tautological enable_if conditions">;
3504 def note_addrof_ovl_candidate_disabled_by_enable_if_attr : Note<
3505     "candidate function made ineligible by enable_if">;
3506 def note_ovl_candidate_deduced_mismatch : Note<
3507     "candidate template ignored: deduced type "
3508     "%diff{$ of %select{|element of }4%ordinal0 parameter does not match "
3509     "adjusted type $ of %select{|element of }4argument"
3510     "|of %select{|element of }4%ordinal0 parameter does not match "
3511     "adjusted type of %select{|element of }4argument}1,2%3">;
3512 def note_ovl_candidate_non_deduced_mismatch : Note<
3513     "candidate template ignored: could not match %diff{$ against $|types}0,1">;
3514 // This note is needed because the above note would sometimes print two
3515 // different types with the same name.  Remove this note when the above note
3516 // can handle that case properly.
3517 def note_ovl_candidate_non_deduced_mismatch_qualified : Note<
3518     "candidate template ignored: could not match %q0 against %q1">;
3519
3520 // Note that we don't treat templates differently for this diagnostic.
3521 def note_ovl_candidate_arity : Note<"candidate "
3522     "%select{function|function|constructor|function|function|constructor|"
3523     "constructor (the implicit default constructor)|"
3524     "constructor (the implicit copy constructor)|"
3525     "constructor (the implicit move constructor)|"
3526     "function (the implicit copy assignment operator)|"
3527     "function (the implicit move assignment operator)|"
3528     "inherited constructor|"
3529     "inherited constructor}0 %select{|template }1"
3530     "not viable: requires%select{ at least| at most|}2 %3 argument%s3, but %4 "
3531     "%plural{1:was|:were}4 provided">;
3532
3533 def note_ovl_candidate_arity_one : Note<"candidate "
3534     "%select{function|function|constructor|function|function|constructor|"
3535     "constructor (the implicit default constructor)|"
3536     "constructor (the implicit copy constructor)|"
3537     "constructor (the implicit move constructor)|"
3538     "function (the implicit copy assignment operator)|"
3539     "function (the implicit move assignment operator)|"
3540     "inherited constructor|"
3541     "inherited constructor}0 %select{|template }1not viable: "
3542     "%select{requires at least|allows at most single|requires single}2 "
3543     "argument %3, but %plural{0:no|:%4}4 arguments were provided">;
3544
3545 def note_ovl_candidate_deleted : Note<
3546     "candidate %select{function|function|constructor|"
3547     "function |function |constructor |"
3548     "constructor (the implicit default constructor)|"
3549     "constructor (the implicit copy constructor)|"
3550     "constructor (the implicit move constructor)|"
3551     "function (the implicit copy assignment operator)|"
3552     "function (the implicit move assignment operator)|"
3553     "inherited constructor|"
3554     "inherited constructor }0%1 has been "
3555     "%select{explicitly made unavailable|explicitly deleted|"
3556     "implicitly deleted}2">;
3557
3558 // Giving the index of the bad argument really clutters this message, and
3559 // it's relatively unimportant because 1) it's generally obvious which
3560 // argument(s) are of the given object type and 2) the fix is usually
3561 // to complete the type, which doesn't involve changes to the call line
3562 // anyway.  If people complain, we can change it.
3563 def note_ovl_candidate_bad_conv_incomplete : Note<"candidate "
3564     "%select{function|function|constructor|"
3565     "function |function |constructor |"
3566     "constructor (the implicit default constructor)|"
3567     "constructor (the implicit copy constructor)|"
3568     "constructor (the implicit move constructor)|"
3569     "function (the implicit copy assignment operator)|"
3570     "function (the implicit move assignment operator)|"
3571     "inherited constructor|"
3572     "inherited constructor }0%1 "
3573     "not viable: cannot convert argument of incomplete type "
3574     "%diff{$ to $|to parameter type}2,3 for "
3575     "%select{%ordinal5 argument|object argument}4"
3576     "%select{|; dereference the argument with *|"
3577     "; take the address of the argument with &|"
3578     "; remove *|"
3579     "; remove &}6">;
3580 def note_ovl_candidate_bad_list_argument : Note<"candidate "
3581     "%select{function|function|constructor|"
3582     "function |function |constructor |"
3583     "constructor (the implicit default constructor)|"
3584     "constructor (the implicit copy constructor)|"
3585     "constructor (the implicit move constructor)|"
3586     "function (the implicit copy assignment operator)|"
3587     "function (the implicit move assignment operator)|"
3588     "inherited constructor|"
3589     "inherited constructor }0%1 "
3590     "not viable: cannot convert initializer list argument to %3">;
3591 def note_ovl_candidate_bad_overload : Note<"candidate "
3592     "%select{function|function|constructor|"
3593     "function |function |constructor |"
3594     "constructor (the implicit default constructor)|"
3595     "constructor (the implicit copy constructor)|"
3596     "constructor (the implicit move constructor)|"
3597     "function (the implicit copy assignment operator)|"
3598     "function (the implicit move assignment operator)|"
3599     "inherited constructor|"
3600     "inherited constructor }0%1"
3601     " not viable: no overload of %3 matching %2 for %ordinal4 argument">;
3602 def note_ovl_candidate_bad_conv : Note<"candidate "
3603     "%select{function|function|constructor|"
3604     "function |function |constructor |"
3605     "constructor (the implicit default constructor)|"
3606     "constructor (the implicit copy constructor)|"
3607     "constructor (the implicit move constructor)|"
3608     "function (the implicit copy assignment operator)|"
3609     "function (the implicit move assignment operator)|"
3610     "inherited constructor|"
3611     "inherited constructor }0%1"
3612     " not viable: no known conversion "
3613     "%diff{from $ to $|from argument type to parameter type}2,3 for "
3614     "%select{%ordinal5 argument|object argument}4"
3615     "%select{|; dereference the argument with *|"
3616     "; take the address of the argument with &|"
3617     "; remove *|"
3618     "; remove &}6">;
3619 def note_ovl_candidate_bad_arc_conv : Note<"candidate "
3620     "%select{function|function|constructor|"
3621     "function |function |constructor |"
3622     "constructor (the implicit default constructor)|"
3623     "constructor (the implicit copy constructor)|"
3624     "constructor (the implicit move constructor)|"
3625     "function (the implicit copy assignment operator)|"
3626     "function (the implicit move assignment operator)|"
3627     "inherited constructor|"
3628     "inherited constructor }0%1"
3629     " not viable: cannot implicitly convert argument "
3630     "%diff{of type $ to $|type to parameter type}2,3 for "
3631     "%select{%ordinal5 argument|object argument}4 under ARC">;
3632 def note_ovl_candidate_bad_lvalue : Note<"candidate "
3633     "%select{function|function|constructor|"
3634     "function |function |constructor |"
3635     "constructor (the implicit default constructor)|"
3636     "constructor (the implicit copy constructor)|"
3637     "constructor (the implicit move constructor)|"
3638     "function (the implicit copy assignment operator)|"
3639     "function (the implicit move assignment operator)|"
3640     "inherited constructor|"
3641     "inherited constructor }0%1"
3642     " not viable: expects an l-value for "
3643     "%select{%ordinal3 argument|object argument}2">;
3644 def note_ovl_candidate_bad_addrspace : Note<"candidate "
3645     "%select{function|function|constructor|"
3646     "function |function |constructor |"
3647     "constructor (the implicit default constructor)|"
3648     "constructor (the implicit copy constructor)|"
3649     "constructor (the implicit move constructor)|"
3650     "function (the implicit copy assignment operator)|"
3651     "function (the implicit move assignment operator)|"
3652     "inherited constructor|"
3653     "inherited constructor }0%1 not viable: "
3654     "%select{%ordinal6|'this'}5 argument (%2) is in "
3655     "address space %3, but parameter must be in address space %4">;
3656 def note_ovl_candidate_bad_gc : Note<"candidate "
3657     "%select{function|function|constructor|"
3658     "function |function |constructor |"
3659     "constructor (the implicit default constructor)|"
3660     "constructor (the implicit copy constructor)|"
3661     "constructor (the implicit move constructor)|"
3662     "function (the implicit copy assignment operator)|"
3663     "function (the implicit move assignment operator)|"
3664     "inherited constructor|"
3665     "inherited constructor }0%1 not viable: "
3666     "%select{%ordinal6|'this'}5 argument (%2) has %select{no|__weak|__strong}3 "
3667     "ownership, but parameter has %select{no|__weak|__strong}4 ownership">;
3668 def note_ovl_candidate_bad_ownership : Note<"candidate "
3669     "%select{function|function|constructor|"
3670     "function |function |constructor |"
3671     "constructor (the implicit default constructor)|"
3672     "constructor (the implicit copy constructor)|"
3673     "constructor (the implicit move constructor)|"
3674     "function (the implicit copy assignment operator)|"
3675     "function (the implicit move assignment operator)|"
3676     "inherited constructor|"
3677     "inherited constructor }0%1 not viable: "
3678     "%select{%ordinal6|'this'}5 argument (%2) has "
3679     "%select{no|__unsafe_unretained|__strong|__weak|__autoreleasing}3 ownership,"
3680     " but parameter has %select{no|__unsafe_unretained|__strong|__weak|"
3681     "__autoreleasing}4 ownership">;
3682 def note_ovl_candidate_bad_cvr_this : Note<"candidate "
3683     "%select{|function|||function|||||"
3684     "function (the implicit copy assignment operator)|"
3685     "function (the implicit move assignment operator)||}0 not viable: "
3686     "'this' argument has type %2, but method is not marked "
3687     "%select{const|restrict|const or restrict|volatile|const or volatile|"
3688     "volatile or restrict|const, volatile, or restrict}3">;
3689 def note_ovl_candidate_bad_cvr : Note<"candidate "
3690     "%select{function|function|constructor|"
3691     "function |function |constructor |"
3692     "constructor (the implicit default constructor)|"
3693     "constructor (the implicit copy constructor)|"
3694     "constructor (the implicit move constructor)|"
3695     "function (the implicit copy assignment operator)|"
3696     "function (the implicit move assignment operator)|"
3697     "inherited constructor|"
3698     "inherited constructor }0%1 not viable: "
3699     "%ordinal4 argument (%2) would lose "
3700     "%select{const|restrict|const and restrict|volatile|const and volatile|"
3701     "volatile and restrict|const, volatile, and restrict}3 qualifier"
3702     "%select{||s||s|s|s}3">;
3703 def note_ovl_candidate_bad_unaligned : Note<"candidate "
3704     "%select{function|function|constructor|"
3705     "function |function |constructor |"
3706     "constructor (the implicit default constructor)|"
3707     "constructor (the implicit copy constructor)|"
3708     "constructor (the implicit move constructor)|"
3709     "function (the implicit copy assignment operator)|"
3710     "function (the implicit move assignment operator)|"
3711     "inherited constructor|"
3712     "inherited constructor }0%1 not viable: "
3713     "%ordinal4 argument (%2) would lose __unaligned qualifier">;
3714 def note_ovl_candidate_bad_base_to_derived_conv : Note<"candidate "
3715     "%select{function|function|constructor|"
3716     "function |function |constructor |"
3717     "constructor (the implicit default constructor)|"
3718     "constructor (the implicit copy constructor)|"
3719     "constructor (the implicit move constructor)|"
3720     "function (the implicit copy assignment operator)|"
3721     "function (the implicit move assignment operator)|"
3722     "inherited constructor|"
3723     "inherited constructor }0%1 not viable: "
3724     "cannot %select{convert from|convert from|bind}2 "
3725     "%select{base class pointer|superclass|base class object of type}2 %3 to "
3726     "%select{derived class pointer|subclass|derived class reference}2 %4 for "
3727     "%ordinal5 argument">;
3728 def note_ovl_candidate_bad_target : Note<
3729     "candidate %select{function|function|constructor|"
3730     "function|function|constructor|"
3731     "constructor (the implicit default constructor)|"
3732     "constructor (the implicit copy constructor)|"
3733     "constructor (the implicit move constructor)|"
3734     "function (the implicit copy assignment operator)|"
3735     "function (the implicit move assignment operator)|"
3736     "inherited constructor|"
3737     "inherited constructor}0 not viable: "
3738     "call to "
3739     "%select{__device__|__global__|__host__|__host__ __device__|invalid}1 function from"
3740     " %select{__device__|__global__|__host__|__host__ __device__|invalid}2 function">;
3741 def note_implicit_member_target_infer_collision : Note<
3742     "implicit %select{"
3743     "default constructor|"
3744     "copy constructor|"
3745     "move constructor|"
3746     "copy assignment operator|"
3747     "move assignment operator|"
3748     "destructor}0 inferred target collision: call to both "
3749     "%select{__device__|__global__|__host__|__host__ __device__}1 and "
3750     "%select{__device__|__global__|__host__|__host__ __device__}2 members">;
3751
3752 def note_ambiguous_type_conversion: Note<
3753     "because of ambiguity in conversion %diff{of $ to $|between types}0,1">;
3754 def note_ovl_builtin_binary_candidate : Note<
3755     "built-in candidate %0">;
3756 def note_ovl_builtin_unary_candidate : Note<
3757     "built-in candidate %0">;
3758 def err_ovl_no_viable_function_in_init : Error<
3759   "no matching constructor for initialization of %0">;
3760 def err_ovl_no_conversion_in_cast : Error<
3761   "cannot convert %1 to %2 without a conversion operator">;
3762 def err_ovl_no_viable_conversion_in_cast : Error<
3763   "no matching conversion for %select{|static_cast|reinterpret_cast|"
3764   "dynamic_cast|C-style cast|functional-style cast}0 from %1 to %2">;
3765 def err_ovl_ambiguous_conversion_in_cast : Error<
3766   "ambiguous conversion for %select{|static_cast|reinterpret_cast|"
3767   "dynamic_cast|C-style cast|functional-style cast}0 from %1 to %2">;
3768 def err_ovl_deleted_conversion_in_cast : Error<
3769   "%select{|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
3770   "functional-style cast}0 from %1 to %2 uses deleted function">;
3771 def err_ovl_ambiguous_init : Error<"call to constructor of %0 is ambiguous">;
3772 def err_ref_init_ambiguous : Error<
3773   "reference initialization of type %0 with initializer of type %1 is ambiguous">;
3774 def err_ovl_deleted_init : Error<
3775   "call to %select{unavailable|deleted}0 constructor of %1">;
3776 def err_ovl_deleted_special_init : Error<
3777   "call to implicitly-deleted %select{default constructor|copy constructor|"
3778   "move constructor|copy assignment operator|move assignment operator|"
3779   "destructor|function}0 of %1">;
3780 def err_ovl_ambiguous_oper_unary : Error<
3781   "use of overloaded operator '%0' is ambiguous (operand type %1)">;
3782 def err_ovl_ambiguous_oper_binary : Error<
3783   "use of overloaded operator '%0' is ambiguous (with operand types %1 and %2)">;
3784 def err_ovl_no_viable_oper : Error<"no viable overloaded '%0'">;
3785 def note_assign_lhs_incomplete : Note<"type %0 is incomplete">;
3786 def err_ovl_deleted_oper : Error<
3787   "overload resolution selected %select{unavailable|deleted}0 operator '%1'%2">;
3788 def err_ovl_deleted_special_oper : Error<
3789   "object of type %0 cannot be %select{constructed|copied|moved|assigned|"
3790   "assigned|destroyed}1 because its %select{default constructor|"
3791   "copy constructor|move constructor|copy assignment operator|"
3792   "move assignment operator|destructor}1 is implicitly deleted">;
3793 def err_ovl_no_viable_subscript :
3794     Error<"no viable overloaded operator[] for type %0">;
3795 def err_ovl_no_oper :
3796     Error<"type %0 does not provide a %select{subscript|call}1 operator">;
3797 def err_ovl_unresolvable : Error<
3798   "reference to overloaded function could not be resolved; "
3799   "did you mean to call it%select{| with no arguments}0?">;
3800 def err_bound_member_function : Error<
3801   "reference to non-static member function must be called"
3802   "%select{|; did you mean to call it with no arguments?}0">;
3803 def note_possible_target_of_call : Note<"possible target for call">;
3804
3805 def err_ovl_no_viable_object_call : Error<
3806   "no matching function for call to object of type %0">;
3807 def err_ovl_ambiguous_object_call : Error<
3808   "call to object of type %0 is ambiguous">;
3809 def err_ovl_deleted_object_call : Error<
3810   "call to %select{unavailable|deleted}0 function call operator in type %1%2">;
3811 def note_ovl_surrogate_cand : Note<"conversion candidate of type %0">;
3812 def err_member_call_without_object : Error<
3813   "call to non-static member function without an object argument">;
3814
3815 // C++ Address of Overloaded Function
3816 def err_addr_ovl_no_viable : Error<
3817   "address of overloaded function %0 does not match required type %1">;
3818 def err_addr_ovl_ambiguous : Error<
3819   "address of overloaded function %0 is ambiguous">;
3820 def err_addr_ovl_not_func_ptrref : Error<
3821   "address of overloaded function %0 cannot be converted to type %1">;
3822 def err_addr_ovl_no_qualifier : Error<
3823   "cannot form member pointer of type %0 without '&' and class name">;
3824
3825 // C++11 Literal Operators
3826 def err_ovl_no_viable_literal_operator : Error<
3827   "no matching literal operator for call to %0"
3828   "%select{| with argument of type %2| with arguments of types %2 and %3}1"
3829   "%select{| or 'const char *'}4"
3830   "%select{|, and no matching literal operator template}5">;
3831
3832 // C++ Template Declarations
3833 def err_template_param_shadow : Error<
3834   "declaration of %0 shadows template parameter">;
3835 def note_template_param_here : Note<"template parameter is declared here">;
3836 def warn_template_export_unsupported : Warning<
3837   "exported templates are unsupported">;
3838 def err_template_outside_namespace_or_class_scope : Error<
3839   "templates can only be declared in namespace or class scope">;
3840 def err_template_inside_local_class : Error<
3841   "templates cannot be declared inside of a local class">;
3842 def err_template_linkage : Error<"templates must have C++ linkage">;
3843 def err_template_typedef : Error<"a typedef cannot be a template">;
3844 def err_template_unnamed_class : Error<
3845   "cannot declare a class template with no name">;
3846 def err_template_param_list_different_arity : Error<
3847   "%select{too few|too many}0 template parameters in template "
3848   "%select{|template parameter }1redeclaration">;
3849 def note_template_param_list_different_arity : Note<
3850   "%select{too few|too many}0 template parameters in template template "
3851   "argument">;
3852 def note_template_prev_declaration : Note<
3853   "previous template %select{declaration|template parameter}0 is here">;
3854 def err_template_param_different_kind : Error<
3855   "template parameter has a different kind in template "
3856   "%select{|template parameter }0redeclaration">;
3857 def note_template_param_different_kind : Note<
3858   "template parameter has a different kind in template argument">;
3859   
3860 def err_template_nontype_parm_different_type : Error<
3861   "template non-type parameter has a different type %0 in template "
3862   "%select{|template parameter }1redeclaration">;
3863
3864 def note_template_nontype_parm_different_type : Note<
3865   "template non-type parameter has a different type %0 in template argument">;
3866 def note_template_nontype_parm_prev_declaration : Note<
3867   "previous non-type template parameter with type %0 is here">;
3868 def err_template_nontype_parm_bad_type : Error<
3869   "a non-type template parameter cannot have type %0">;
3870 def warn_cxx14_compat_template_nontype_parm_auto_type : Warning<
3871   "non-type template parameters declared with %0 are incompatible with C++ "
3872   "standards before C++1z">,
3873   DefaultIgnore, InGroup<CXXPre1zCompat>;
3874 def err_template_param_default_arg_redefinition : Error<
3875   "template parameter redefines default argument">;
3876 def note_template_param_prev_default_arg : Note<
3877   "previous default template argument defined here">;
3878 def err_template_param_default_arg_missing : Error<
3879   "template parameter missing a default argument">;
3880 def ext_template_parameter_default_in_function_template : ExtWarn<
3881   "default template arguments for a function template are a C++11 extension">,
3882   InGroup<CXX11>;
3883 def warn_cxx98_compat_template_parameter_default_in_function_template : Warning<
3884   "default template arguments for a function template are incompatible with C++98">,
3885   InGroup<CXX98Compat>, DefaultIgnore;
3886 def err_template_parameter_default_template_member : Error<
3887   "cannot add a default template argument to the definition of a member of a "
3888   "class template">;
3889 def err_template_parameter_default_friend_template : Error<
3890   "default template argument not permitted on a friend template">;
3891 def err_template_template_parm_no_parms : Error<
3892   "template template parameter must have its own template parameters">;
3893
3894 def ext_variable_template : ExtWarn<"variable templates are a C++14 extension">,
3895   InGroup<CXX14>;
3896 def warn_cxx11_compat_variable_template : Warning<
3897   "variable templates are incompatible with C++ standards before C++14">,
3898   InGroup<CXXPre14Compat>, DefaultIgnore;
3899 def err_template_variable_noparams : Error<
3900   "extraneous 'template<>' in declaration of variable %0">;
3901 def err_template_member : Error<"member %0 declared as a template">;
3902 def err_template_member_noparams : Error<
3903   "extraneous 'template<>' in declaration of member %0">;
3904 def err_template_tag_noparams : Error<
3905   "extraneous 'template<>' in declaration of %0 %1">;
3906 def err_template_decl_ref : Error<
3907   "cannot refer to %select{class|variable}0 template %1 without a template argument list">;
3908
3909 // C++ Template Argument Lists
3910 def err_template_missing_args : Error<
3911   "use of "
3912   "%select{class template|function template|variable template|alias template|"
3913   "template template parameter|template}0 %1 requires template arguments">;
3914 def err_template_arg_list_different_arity : Error<
3915   "%select{too few|too many}0 template arguments for "
3916   "%select{class template|function template|variable template|alias template|"
3917   "template template parameter|template}1 %2">;
3918 def note_template_decl_here : Note<"template is declared here">;
3919 def err_template_arg_must_be_type : Error<
3920   "template argument for template type parameter must be a type">;
3921 def err_template_arg_must_be_type_suggest : Error<
3922   "template argument for template type parameter must be a type; "
3923   "did you forget 'typename'?">;
3924 def ext_ms_template_type_arg_missing_typename : ExtWarn<
3925   "template argument for template type parameter must be a type; "
3926   "omitted 'typename' is a Microsoft extension">,
3927   InGroup<MicrosoftTemplate>;
3928 def err_template_arg_must_be_expr : Error<
3929   "template argument for non-type template parameter must be an expression">;
3930 def err_template_arg_nontype_ambig : Error<
3931   "template argument for non-type template parameter is treated as function type %0">;
3932 def err_template_arg_must_be_template : Error<
3933   "template argument for template template parameter must be a class template%select{| or type alias template}0">;
3934 def ext_template_arg_local_type : ExtWarn<
3935   "template argument uses local type %0">, InGroup<LocalTypeTemplateArgs>;
3936 def ext_template_arg_unnamed_type : ExtWarn<
3937   "template argument uses unnamed type">, InGroup<UnnamedTypeTemplateArgs>;
3938 def warn_cxx98_compat_template_arg_local_type : Warning<
3939   "local type %0 as template argument is incompatible with C++98">,
3940   InGroup<CXX98CompatLocalTypeTemplateArgs>, DefaultIgnore;
3941 def warn_cxx98_compat_template_arg_unnamed_type : Warning<
3942   "unnamed type as template argument is incompatible with C++98">,
3943   InGroup<CXX98CompatUnnamedTypeTemplateArgs>, DefaultIgnore;
3944 def note_template_unnamed_type_here : Note<
3945   "unnamed type used in template argument was declared here">;
3946 def err_template_arg_overload_type : Error<
3947   "template argument is the type of an unresolved overloaded function">;
3948 def err_template_arg_not_valid_template : Error<
3949   "template argument does not refer to a class or alias template, or template "
3950   "template parameter">;
3951 def note_template_arg_refers_here_func : Note<
3952   "template argument refers to function template %0, here">;
3953 def err_template_arg_template_params_mismatch : Error<
3954   "template template argument has different template parameters than its "
3955   "corresponding template template parameter">;
3956 def err_template_arg_not_integral_or_enumeral : Error<
3957   "non-type template argument of type %0 must have an integral or enumeration"
3958   " type">;
3959 def err_template_arg_not_ice : Error<
3960   "non-type template argument of type %0 is not an integral constant "
3961   "expression">;
3962 def err_template_arg_not_address_constant : Error<
3963   "non-type template argument of type %0 is not a constant expression">;
3964 def warn_cxx98_compat_template_arg_null : Warning<
3965   "use of null pointer as non-type template argument is incompatible with "
3966   "C++98">, InGroup<CXX98Compat>, DefaultIgnore;
3967 def err_template_arg_untyped_null_constant : Error<
3968   "null non-type template argument must be cast to template parameter type %0">;
3969 def err_template_arg_wrongtype_null_constant : Error<
3970   "null non-type template argument of type %0 does not match template parameter "
3971   "of type %1">;
3972 def err_non_type_template_parm_type_deduction_failure : Error<
3973   "non-type template parameter %0 with type %1 has incompatible initializer of type %2">;
3974 def err_deduced_non_type_template_arg_type_mismatch : Error<
3975   "deduced non-type template argument does not have the same type as the "
3976   "corresponding template parameter%diff{ ($ vs $)|}0,1">;
3977 def err_non_type_template_arg_subobject : Error<
3978   "non-type template argument refers to subobject '%0'">;
3979 def err_non_type_template_arg_addr_label_diff : Error<
3980   "template argument / label address difference / what did you expect?">;
3981 def err_template_arg_not_convertible : Error<
3982   "non-type template argument of type %0 cannot be converted to a value "
3983   "of type %1">;
3984 def warn_template_arg_negative : Warning<
3985   "non-type template argument with value '%0' converted to '%1' for unsigned "
3986   "template parameter of type %2">, InGroup<Conversion>, DefaultIgnore;
3987 def warn_template_arg_too_large : Warning<
3988   "non-type template argument value '%0' truncated to '%1' for "
3989   "template parameter of type %2">, InGroup<Conversion>, DefaultIgnore;
3990 def err_template_arg_no_ref_bind : Error<
3991   "non-type template parameter of reference type "
3992   "%diff{$ cannot bind to template argument of type $"
3993   "|cannot bind to template of incompatible argument type}0,1">;
3994 def err_template_arg_ref_bind_ignores_quals : Error<
3995   "reference binding of non-type template parameter "
3996   "%diff{of type $ to template argument of type $|to template argument}0,1 "
3997   "ignores qualifiers">;
3998 def err_template_arg_not_decl_ref : Error<
3999   "non-type template argument does not refer to any declaration">;
4000 def err_template_arg_not_address_of : Error<
4001   "non-type template argument for template parameter of pointer type %0 must "
4002   "have its address taken">;
4003 def err_template_arg_address_of_non_pointer : Error<
4004   "address taken in non-type template argument for template parameter of "
4005   "reference type %0">;
4006 def err_template_arg_reference_var : Error<
4007   "non-type template argument of reference type %0 is not an object">;
4008 def err_template_arg_field : Error<
4009   "non-type template argument refers to non-static data member %0">;
4010 def err_template_arg_method : Error<
4011   "non-type template argument refers to non-static member function %0">;
4012 def err_template_arg_object_no_linkage : Error<
4013   "non-type template argument refers to %select{function|object}0 %1 that "
4014   "does not have linkage">;
4015 def warn_cxx98_compat_template_arg_object_internal : Warning<
4016   "non-type template argument referring to %select{function|object}0 %1 with "
4017   "internal linkage is incompatible with C++98">,
4018   InGroup<CXX98Compat>, DefaultIgnore;
4019 def ext_template_arg_object_internal : ExtWarn<
4020   "non-type template argument referring to %select{function|object}0 %1 with "
4021   "internal linkage is a C++11 extension">, InGroup<CXX11>;
4022 def err_template_arg_thread_local : Error<
4023   "non-type template argument refers to thread-local object">;
4024 def note_template_arg_internal_object : Note<
4025   "non-type template argument refers to %select{function|object}0 here">;
4026 def note_template_arg_refers_here : Note<
4027   "non-type template argument refers here">;
4028 def err_template_arg_not_object_or_func : Error<
4029   "non-type template argument does not refer to an object or function">;
4030 def err_template_arg_not_pointer_to_member_form : Error<
4031   "non-type template argument is not a pointer to member constant">;
4032 def err_template_arg_member_ptr_base_derived_not_supported : Error<
4033   "sorry, non-type template argument of pointer-to-member type %1 that refers "
4034   "to member %q0 of a different class is not supported yet">;
4035 def ext_template_arg_extra_parens : ExtWarn<
4036   "address non-type template argument cannot be surrounded by parentheses">;
4037 def warn_cxx98_compat_template_arg_extra_parens : Warning<
4038   "redundant parentheses surrounding address non-type template argument are "
4039   "incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
4040 def err_pointer_to_member_type : Error<
4041   "invalid use of pointer to member type after %select{.*|->*}0">;
4042 def err_pointer_to_member_call_drops_quals : Error<
4043   "call to pointer to member function of type %0 drops '%1' qualifier%s2">;
4044 def err_pointer_to_member_oper_value_classify: Error<
4045   "pointer-to-member function type %0 can only be called on an "
4046   "%select{rvalue|lvalue}1">;
4047 def ext_ms_deref_template_argument: ExtWarn<
4048   "non-type template argument containing a dereference operation is a "
4049   "Microsoft extension">, InGroup<MicrosoftTemplate>;
4050 def ext_ms_delayed_template_argument: ExtWarn<
4051   "using the undeclared type %0 as a default template argument is a "
4052   "Microsoft extension">, InGroup<MicrosoftTemplate>;
4053 def err_template_arg_deduced_incomplete_pack : Error<
4054   "deduced incomplete pack %0 for template parameter %1">;
4055
4056 // C++ template specialization
4057 def err_template_spec_unknown_kind : Error<
4058   "can only provide an explicit specialization for a class template, function "
4059   "template, variable template, or a member function, static data member, "
4060   "%select{or member class|member class, or member enumeration}0 of a "
4061   "class template">;
4062 def note_specialized_entity : Note<
4063   "explicitly specialized declaration is here">;
4064 def note_explicit_specialization_declared_here : Note<
4065   "explicit specialization declared here">;
4066 def err_template_spec_decl_function_scope : Error<
4067   "explicit specialization of %0 in function scope">;
4068 def err_template_spec_decl_class_scope : Error<
4069   "explicit specialization of %0 in class scope">;
4070 def err_template_spec_decl_friend : Error<
4071   "cannot declare an explicit specialization in a friend">;
4072 def err_template_spec_decl_out_of_scope_global : Error<
4073   "%select{class template|class template partial|variable template|"
4074   "variable template partial|function template|member function|"
4075   "static data member|member class|member enumeration}0 "
4076   "specialization of %1 must originally be declared in the global scope">;
4077 def err_template_spec_decl_out_of_scope : Error<
4078   "%select{class template|class template partial|variable template|"
4079   "variable template partial|function template|member "
4080   "function|static data member|member class|member enumeration}0 "
4081   "specialization of %1 must originally be declared in namespace %2">;
4082 def ext_template_spec_decl_out_of_scope : ExtWarn<
4083   "first declaration of %select{class template|class template partial|"
4084   "variable template|variable template partial|"
4085   "function template|member function|static data member|member class|"
4086   "member enumeration}0 specialization of %1 outside namespace %2 is a "
4087   "C++11 extension">, InGroup<CXX11>;
4088 def warn_cxx98_compat_template_spec_decl_out_of_scope : Warning<
4089   "%select{class template|class template partial|variable template|"
4090   "variable template partial|function template|member "
4091   "function|static data member|member class|member enumeration}0 "
4092   "specialization of %1 outside namespace %2 is incompatible with C++98">,
4093   InGroup<CXX98Compat>, DefaultIgnore;
4094 def err_template_spec_redecl_out_of_scope : Error<
4095   "%select{class template|class template partial|variable template|"
4096   "variable template partial|function template|member "
4097   "function|static data member|member class|member enumeration}0 "
4098   "specialization of %1 not in a namespace enclosing %2">;
4099 def ext_ms_template_spec_redecl_out_of_scope: ExtWarn<
4100   "%select{class template|class template partial|variable template|"
4101   "variable template partial|function template|member "
4102   "function|static data member|member class|member enumeration}0 "
4103   "specialization of %1 outside namespace enclosing %2 "
4104   "is a Microsoft extension">, InGroup<MicrosoftTemplate>;
4105 def err_template_spec_redecl_global_scope : Error<
4106   "%select{class template|class template partial|variable template|"
4107   "variable template partial|function template|member "
4108   "function|static data member|member class|member enumeration}0 "
4109   "specialization of %1 must occur at global scope">;
4110 def err_spec_member_not_instantiated : Error<
4111   "specialization of member %q0 does not specialize an instantiated member">;
4112 def note_specialized_decl : Note<"attempt to specialize declaration here">;
4113 def err_specialization_after_instantiation : Error<
4114   "explicit specialization of %0 after instantiation">;
4115 def note_instantiation_required_here : Note<
4116   "%select{implicit|explicit}0 instantiation first required here">;
4117 def err_template_spec_friend : Error<
4118   "template specialization declaration cannot be a friend">;
4119 def err_template_spec_default_arg : Error<
4120   "default argument not permitted on an explicit "
4121   "%select{instantiation|specialization}0 of function %1">;
4122 def err_not_class_template_specialization : Error<
4123   "cannot specialize a %select{dependent template|template template "
4124   "parameter}0">;
4125 def err_function_specialization_in_class : Error<
4126   "cannot specialize a function %0 within class scope">;
4127 def ext_function_specialization_in_class : ExtWarn<
4128   "explicit specialization of %0 within class scope is a Microsoft extension">,
4129   InGroup<MicrosoftTemplate>;
4130 def ext_explicit_specialization_storage_class : ExtWarn<
4131   "explicit specialization cannot have a storage class">;
4132 def err_explicit_specialization_inconsistent_storage_class : Error<
4133   "explicit specialization has extraneous, inconsistent storage class "
4134   "'%select{none|extern|static|__private_extern__|auto|register}0'">;
4135
4136 // C++ class template specializations and out-of-line definitions
4137 def err_template_spec_needs_header : Error<
4138   "template specialization requires 'template<>'">;
4139 def err_template_spec_needs_template_parameters : Error<
4140   "template specialization or definition requires a template parameter list "
4141   "corresponding to the nested type %0">;
4142 def err_template_param_list_matches_nontemplate : Error<
4143   "template parameter list matching the non-templated nested type %0 should "
4144   "be empty ('template<>')">;
4145 def err_alias_template_extra_headers : Error<
4146   "extraneous template parameter list in alias template declaration">;
4147 def err_template_spec_extra_headers : Error<
4148   "extraneous template parameter list in template specialization or "
4149   "out-of-line template definition">;
4150 def warn_template_spec_extra_headers : Warning<
4151   "extraneous template parameter list in template specialization">;
4152 def note_explicit_template_spec_does_not_need_header : Note<
4153   "'template<>' header not required for explicitly-specialized class %0 "
4154   "declared here">;
4155 def err_template_qualified_declarator_no_match : Error<
4156   "nested name specifier '%0' for declaration does not refer into a class, "
4157   "class template or class template partial specialization">;
4158 def err_specialize_member_of_template : Error<
4159   "cannot specialize %select{|(with 'template<>') }0a member of an "
4160   "unspecialized template">;
4161
4162 // C++ Class Template Partial Specialization
4163 def err_default_arg_in_partial_spec : Error<
4164     "default template argument in a class template partial specialization">;
4165 def err_dependent_non_type_arg_in_partial_spec : Error<
4166     "type of specialized non-type template argument depends on a template "
4167     "parameter of the partial specialization">;
4168 def note_dependent_non_type_default_arg_in_partial_spec : Note<
4169     "template parameter is used in default argument declared here">;
4170 def err_dependent_typed_non_type_arg_in_partial_spec : Error<
4171     "non-type template argument specializes a template parameter with "
4172     "dependent type %0">;
4173 def err_partial_spec_args_match_primary_template : Error<
4174     "%select{class|variable}0 template partial specialization does not "
4175     "specialize any template argument; to %select{declare|define}1 the "
4176     "primary template, remove the template argument list">; 
4177 def ext_partial_spec_not_more_specialized_than_primary : ExtWarn<
4178     "%select{class|variable}0 template partial specialization is not "
4179     "more specialized than the primary template">, DefaultError,
4180     InGroup<DiagGroup<"invalid-partial-specialization">>;
4181 def note_partial_spec_not_more_specialized_than_primary : Note<"%0">;
4182 def ext_partial_specs_not_deducible : ExtWarn<
4183     "%select{class|variable}0 template partial specialization contains "
4184     "%select{a template parameter|template parameters}1 that cannot be "
4185     "deduced; this partial specialization will never be used">,
4186     DefaultError, InGroup<DiagGroup<"unusable-partial-specialization">>;
4187 def note_non_deducible_parameter : Note<
4188     "non-deducible template parameter %0">;
4189 def err_partial_spec_ordering_ambiguous : Error<
4190     "ambiguous partial specializations of %0">;
4191 def note_partial_spec_match : Note<"partial specialization matches %0">;
4192 def err_partial_spec_redeclared : Error<
4193   "class template partial specialization %0 cannot be redeclared">;
4194 def note_partial_specialization_declared_here : Note<
4195   "explicit specialization declared here">;
4196 def note_prev_partial_spec_here : Note<
4197   "previous declaration of class template partial specialization %0 is here">;
4198 def err_partial_spec_fully_specialized : Error<
4199   "partial specialization of %0 does not use any of its template parameters">;
4200
4201 // C++ Variable Template Partial Specialization
4202 def err_var_partial_spec_redeclared : Error<
4203   "variable template partial specialization %0 cannot be redefined">;
4204 def note_var_prev_partial_spec_here : Note<
4205   "previous declaration of variable template partial specialization is here">;
4206 def err_var_spec_no_template : Error<
4207   "no variable template matches%select{| partial}0 specialization">;
4208 def err_var_spec_no_template_but_method : Error<
4209   "no variable template matches specialization; "
4210   "did you mean to use %0 as function template instead?">;
4211   
4212 // C++ Function template specializations
4213 def err_function_template_spec_no_match : Error<
4214     "no function template matches function template specialization %0">;
4215 def err_function_template_spec_ambiguous : Error<
4216     "function template specialization %0 ambiguously refers to more than one "
4217     "function template; explicitly specify%select{| additional}1 template "
4218     "arguments to identify a particular function template">;
4219 def note_function_template_spec_matched : Note<
4220     "function template %q0 matches specialization %1">;
4221 def err_function_template_partial_spec : Error<
4222     "function template partial specialization is not allowed">;
4223
4224 // C++ Template Instantiation
4225 def err_template_recursion_depth_exceeded : Error<
4226   "recursive template instantiation exceeded maximum depth of %0">,
4227   DefaultFatal, NoSFINAE;
4228 def note_template_recursion_depth : Note<
4229   "use -ftemplate-depth=N to increase recursive template instantiation depth">;
4230
4231 def err_template_instantiate_within_definition : Error<
4232   "%select{implicit|explicit}0 instantiation of template %1 within its"
4233   " own definition">;
4234 def err_template_instantiate_undefined : Error<
4235   "%select{implicit|explicit}0 instantiation of undefined template %1">;
4236 def err_implicit_instantiate_member_undefined : Error<
4237   "implicit instantiation of undefined member %0">;
4238 def note_template_class_instantiation_was_here : Note<
4239   "class template %0 was instantiated here">;
4240 def note_template_class_explicit_specialization_was_here : Note<
4241   "class template %0 was explicitly specialized here">;
4242 def note_template_class_instantiation_here : Note<
4243   "in instantiation of template class %q0 requested here">;
4244 def note_template_member_class_here : Note<
4245   "in instantiation of member class %q0 requested here">;
4246 def note_template_member_function_here : Note<
4247   "in instantiation of member function %q0 requested here">;
4248 def note_function_template_spec_here : Note<
4249   "in instantiation of function template specialization %q0 requested here">;
4250 def note_template_static_data_member_def_here : Note<
4251   "in instantiation of static data member %q0 requested here">;
4252 def note_template_variable_def_here : Note<
4253   "in instantiation of variable template specialization %q0 requested here">;
4254 def note_template_enum_def_here : Note<
4255   "in instantiation of enumeration %q0 requested here">;
4256 def note_template_nsdmi_here : Note<
4257   "in instantiation of default member initializer %q0 requested here">;
4258 def note_template_type_alias_instantiation_here : Note<
4259   "in instantiation of template type alias %0 requested here">;
4260 def note_template_exception_spec_instantiation_here : Note<
4261   "in instantiation of exception specification for %0 requested here">;
4262 def warn_var_template_missing : Warning<"instantiation of variable %q0 "
4263   "required here, but no definition is available">,
4264   InGroup<UndefinedVarTemplate>;
4265 def warn_func_template_missing : Warning<"instantiation of function %q0 "
4266   "required here, but no definition is available">,
4267   InGroup<UndefinedFuncTemplate>, DefaultIgnore;
4268 def note_forward_template_decl : Note<
4269   "forward declaration of template entity is here">;
4270 def note_inst_declaration_hint : Note<"add an explicit instantiation "
4271   "declaration to suppress this warning if %q0 is explicitly instantiated in "
4272   "another translation unit">;
4273
4274 def note_default_arg_instantiation_here : Note<
4275   "in instantiation of default argument for '%0' required here">;
4276 def note_default_function_arg_instantiation_here : Note<
4277   "in instantiation of default function argument expression "
4278   "for '%0' required here">;
4279 def note_explicit_template_arg_substitution_here : Note<
4280   "while substituting explicitly-specified template arguments into function "
4281   "template %0 %1">;
4282 def note_function_template_deduction_instantiation_here : Note<
4283   "while substituting deduced template arguments into function template %0 "
4284   "%1">;
4285 def note_deduced_template_arg_substitution_here : Note<
4286   "during template argument deduction for %select{class|variable}0 template "
4287   "%select{partial specialization |}1%2 %3">;
4288 def note_prior_template_arg_substitution : Note<
4289   "while substituting prior template arguments into %select{non-type|template}0"
4290   " template parameter%1 %2">;
4291 def note_template_default_arg_checking : Note<
4292   "while checking a default template argument used here">;
4293 def note_instantiation_contexts_suppressed : Note<
4294   "(skipping %0 context%s0 in backtrace; use -ftemplate-backtrace-limit=0 to "
4295   "see all)">;
4296
4297 def err_field_instantiates_to_function : Error<
4298   "data member instantiated with function type %0">;
4299 def err_variable_instantiates_to_function : Error<
4300   "%select{variable|static data member}0 instantiated with function type %1">;
4301 def err_nested_name_spec_non_tag : Error<
4302   "type %0 cannot be used prior to '::' because it has no members">;
4303
4304 def err_using_pack_expansion_empty : Error<
4305   "%select{|member}0 using declaration %1 instantiates to an empty pack">;
4306
4307 // C++ Explicit Instantiation
4308 def err_explicit_instantiation_duplicate : Error<
4309     "duplicate explicit instantiation of %0">;
4310 def ext_explicit_instantiation_duplicate : ExtWarn<
4311     "duplicate explicit instantiation of %0 ignored as a Microsoft extension">,
4312     InGroup<MicrosoftTemplate>;
4313 def note_previous_explicit_instantiation : Note<
4314     "previous explicit instantiation is here">;
4315 def warn_explicit_instantiation_after_specialization : Warning<
4316   "explicit instantiation of %0 that occurs after an explicit "
4317   "specialization has no effect">,
4318   InGroup<DiagGroup<"instantiation-after-specialization">>;
4319 def note_previous_template_specialization : Note<
4320     "previous template specialization is here">;
4321 def err_explicit_instantiation_nontemplate_type : Error<
4322     "explicit instantiation of non-templated type %0">;
4323 def note_nontemplate_decl_here : Note<
4324     "non-templated declaration is here">;
4325 def err_explicit_instantiation_in_class : Error<
4326   "explicit instantiation of %0 in class scope">;
4327 def err_explicit_instantiation_out_of_scope : Error<
4328   "explicit instantiation of %0 not in a namespace enclosing %1">;
4329 def err_explicit_instantiation_must_be_global : Error<
4330   "explicit instantiation of %0 must occur at global scope">;
4331 def warn_explicit_instantiation_out_of_scope_0x : Warning<
4332   "explicit instantiation of %0 not in a namespace enclosing %1">, 
4333   InGroup<CXX11Compat>, DefaultIgnore;
4334 def warn_explicit_instantiation_must_be_global_0x : Warning<
4335   "explicit instantiation of %0 must occur at global scope">, 
4336   InGroup<CXX11Compat>, DefaultIgnore;
4337   
4338 def err_explicit_instantiation_requires_name : Error<
4339   "explicit instantiation declaration requires a name">;
4340 def err_explicit_instantiation_of_typedef : Error<
4341   "explicit instantiation of typedef %0">;
4342 def err_explicit_instantiation_storage_class : Error<
4343   "explicit instantiation cannot have a storage class">;
4344 def err_explicit_instantiation_not_known : Error<
4345   "explicit instantiation of %0 does not refer to a function template, "
4346   "variable template, member function, member class, or static data member">;
4347 def note_explicit_instantiation_here : Note<
4348   "explicit instantiation refers here">;
4349 def err_explicit_instantiation_data_member_not_instantiated : Error<
4350   "explicit instantiation refers to static data member %q0 that is not an "
4351   "instantiation">;
4352 def err_explicit_instantiation_member_function_not_instantiated : Error<
4353   "explicit instantiation refers to member function %q0 that is not an "
4354   "instantiation">;
4355 def err_explicit_instantiation_ambiguous : Error<
4356   "partial ordering for explicit instantiation of %0 is ambiguous">;
4357 def note_explicit_instantiation_candidate : Note<
4358   "explicit instantiation candidate function %q0 template here %1">;
4359 def err_explicit_instantiation_inline : Error<
4360   "explicit instantiation cannot be 'inline'">;
4361 def warn_explicit_instantiation_inline_0x : Warning<
4362   "explicit instantiation cannot be 'inline'">, InGroup<CXX11Compat>,
4363   DefaultIgnore;
4364 def err_explicit_instantiation_constexpr : Error<
4365   "explicit instantiation cannot be 'constexpr'">;
4366 def ext_explicit_instantiation_without_qualified_id : Extension<
4367   "qualifier in explicit instantiation of %q0 requires a template-id "
4368   "(a typedef is not permitted)">;
4369 def err_explicit_instantiation_without_template_id : Error<
4370   "explicit instantiation of %q0 must specify a template argument list">;
4371 def err_explicit_instantiation_unqualified_wrong_namespace : Error<
4372   "explicit instantiation of %q0 must occur in namespace %1">;
4373 def warn_explicit_instantiation_unqualified_wrong_namespace_0x : Warning<
4374   "explicit instantiation of %q0 must occur in namespace %1">,
4375   InGroup<CXX11Compat>, DefaultIgnore;
4376 def err_explicit_instantiation_undefined_member : Error<
4377   "explicit instantiation of undefined %select{member class|member function|"
4378   "static data member}0 %1 of class template %2">;
4379 def err_explicit_instantiation_undefined_func_template : Error<
4380   "explicit instantiation of undefined function template %0">;
4381 def err_explicit_instantiation_undefined_var_template : Error<
4382   "explicit instantiation of undefined variable template %q0">;
4383 def err_explicit_instantiation_declaration_after_definition : Error<
4384   "explicit instantiation declaration (with 'extern') follows explicit "
4385   "instantiation definition (without 'extern')">;
4386 def note_explicit_instantiation_definition_here : Note<
4387   "explicit instantiation definition is here">;
4388 def err_invalid_var_template_spec_type : Error<"type %2 "
4389   "of %select{explicit instantiation|explicit specialization|"
4390   "partial specialization|redeclaration}0 of %1 does not match"
4391   " expected type %3">;
4392 def err_mismatched_exception_spec_explicit_instantiation : Error<
4393   "exception specification in explicit instantiation does not match "
4394   "instantiated one">;
4395 def ext_mismatched_exception_spec_explicit_instantiation : ExtWarn<
4396   err_mismatched_exception_spec_explicit_instantiation.Text>,
4397   InGroup<MicrosoftExceptionSpec>;
4398   
4399 // C++ typename-specifiers
4400 def err_typename_nested_not_found : Error<"no type named %0 in %1">;
4401 def err_typename_nested_not_found_enable_if : Error<
4402   "no type named 'type' in %0; 'enable_if' cannot be used to disable "
4403   "this declaration">;
4404 def err_typename_nested_not_type : Error<
4405     "typename specifier refers to non-type member %0 in %1">;
4406 def note_typename_refers_here : Note<
4407     "referenced member %0 is declared here">;
4408 def err_typename_missing : Error<
4409   "missing 'typename' prior to dependent type name '%0%1'">;
4410 def err_typename_missing_template : Error<
4411   "missing 'typename' prior to dependent type template name '%0%1'">;
4412 def ext_typename_missing : ExtWarn<
4413   "missing 'typename' prior to dependent type name '%0%1'">,
4414   InGroup<DiagGroup<"typename-missing">>;
4415 def ext_typename_outside_of_template : ExtWarn<
4416   "'typename' occurs outside of a template">, InGroup<CXX11>;
4417 def warn_cxx98_compat_typename_outside_of_template : Warning<
4418   "use of 'typename' outside of a template is incompatible with C++98">,
4419   InGroup<CXX98Compat>, DefaultIgnore;
4420 def err_typename_refers_to_using_value_decl : Error<
4421   "typename specifier refers to a dependent using declaration for a value "
4422   "%0 in %1">;
4423 def note_using_value_decl_missing_typename : Note<
4424   "add 'typename' to treat this using declaration as a type">;
4425
4426 def err_template_kw_refers_to_non_template : Error<
4427   "%0 following the 'template' keyword does not refer to a template">;
4428 def err_template_kw_refers_to_class_template : Error<
4429   "'%0%1' instantiated to a class template, not a function template">;
4430 def note_referenced_class_template : Note<
4431   "class template declared here">;
4432 def err_template_kw_missing : Error<
4433   "missing 'template' keyword prior to dependent template name '%0%1'">;
4434 def ext_template_outside_of_template : ExtWarn<
4435   "'template' keyword outside of a template">, InGroup<CXX11>;
4436 def warn_cxx98_compat_template_outside_of_template : Warning<
4437   "use of 'template' keyword outside of a template is incompatible with C++98">,
4438   InGroup<CXX98Compat>, DefaultIgnore;
4439
4440 def err_non_type_template_in_nested_name_specifier : Error<
4441   "qualified name refers into a specialization of %select{function|variable}0 "
4442   "template %1">;
4443 def err_template_id_not_a_type : Error<
4444   "template name refers to non-type template %0">;
4445 def note_template_declared_here : Note<
4446   "%select{function template|class template|variable template"
4447   "|type alias template|template template parameter}0 "
4448   "%1 declared here">;
4449 def err_alias_template_expansion_into_fixed_list : Error<
4450   "pack expansion used as argument for non-pack parameter of alias template">;
4451 def note_parameter_type : Note<
4452   "parameter of type %0 is declared here">;
4453
4454 // C++11 Variadic Templates
4455 def err_template_param_pack_default_arg : Error<
4456   "template parameter pack cannot have a default argument">;
4457 def err_template_param_pack_must_be_last_template_parameter : Error<
4458   "template parameter pack must be the last template parameter">;
4459
4460 def err_template_parameter_pack_non_pack : Error<
4461   "%select{template type|non-type template|template template}0 parameter"
4462   "%select{| pack}1 conflicts with previous %select{template type|"
4463   "non-type template|template template}0 parameter%select{ pack|}1">;
4464 def note_template_parameter_pack_non_pack : Note<
4465   "%select{template type|non-type template|template template}0 parameter"
4466   "%select{| pack}1 does not match %select{template type|non-type template"
4467   "|template template}0 parameter%select{ pack|}1 in template argument">;
4468 def note_template_parameter_pack_here : Note<
4469   "previous %select{template type|non-type template|template template}0 "
4470   "parameter%select{| pack}1 declared here">;
4471   
4472 def err_unexpanded_parameter_pack : Error<
4473   "%select{expression|base type|declaration type|data member type|bit-field "
4474   "size|static assertion|fixed underlying type|enumerator value|"
4475   "using declaration|friend declaration|qualifier|initializer|default argument|"
4476   "non-type template parameter type|exception type|partial specialization|"
4477   "__if_exists name|__if_not_exists name|lambda|block}0 contains"
4478   "%plural{0: an|:}1 unexpanded parameter pack"
4479   "%plural{0:|1: %2|2:s %2 and %3|:s %2, %3, ...}1">;
4480
4481 def err_pack_expansion_without_parameter_packs : Error<
4482   "pack expansion does not contain any unexpanded parameter packs">;
4483 def err_pack_expansion_length_conflict : Error<
4484   "pack expansion contains parameter packs %0 and %1 that have different "
4485   "lengths (%2 vs. %3)">;
4486 def err_pack_expansion_length_conflict_multilevel : Error<
4487   "pack expansion contains parameter pack %0 that has a different "
4488   "length (%1 vs. %2) from outer parameter packs">;
4489 def err_pack_expansion_member_init : Error<
4490   "pack expansion for initialization of member %0">;
4491
4492 def err_function_parameter_pack_without_parameter_packs : Error<
4493   "type %0 of function parameter pack does not contain any unexpanded "
4494   "parameter packs">;
4495 def err_ellipsis_in_declarator_not_parameter : Error<
4496   "only function and template parameters can be parameter packs">;
4497
4498 def err_sizeof_pack_no_pack_name : Error<
4499   "%0 does not refer to the name of a parameter pack">;
4500
4501 def err_fold_expression_packs_both_sides : Error<
4502   "binary fold expression has unexpanded parameter packs in both operands">;
4503 def err_fold_expression_empty : Error<
4504   "unary fold expression has empty expansion for operator '%0' "
4505   "with no fallback value">;
4506 def err_fold_expression_bad_operand : Error<
4507   "expression not permitted as operand of fold expression">;
4508
4509 def err_unexpected_typedef : Error<
4510   "unexpected type name %0: expected expression">;
4511 def err_unexpected_namespace : Error<
4512   "unexpected namespace name %0: expected expression">;
4513 def err_undeclared_var_use : Error<"use of undeclared identifier %0">;
4514 def ext_undeclared_unqual_id_with_dependent_base : ExtWarn<
4515   "use of undeclared identifier %0; "
4516   "unqualified lookup into dependent bases of class template %1 is a Microsoft extension">,
4517   InGroup<MicrosoftTemplate>;
4518 def ext_found_via_dependent_bases_lookup : ExtWarn<"use of identifier %0 "
4519   "found via unqualified lookup into dependent bases of class templates is a "
4520   "Microsoft extension">, InGroup<MicrosoftTemplate>;
4521 def note_dependent_var_use : Note<"must qualify identifier to find this "
4522     "declaration in dependent base class">;
4523 def err_not_found_by_two_phase_lookup : Error<"call to function %0 that is neither "
4524     "visible in the template definition nor found by argument-dependent lookup">;
4525 def note_not_found_by_two_phase_lookup : Note<"%0 should be declared prior to the "
4526     "call site%select{| or in %2| or in an associated namespace of one of its arguments}1">;
4527 def err_undeclared_use : Error<"use of undeclared %0">;
4528 def warn_deprecated : Warning<"%0 is deprecated">,
4529     InGroup<DeprecatedDeclarations>;
4530 def note_from_diagnose_if : Note<"from 'diagnose_if' attribute on %0:">;
4531 def warn_property_method_deprecated :
4532     Warning<"property access is using %0 method which is deprecated">,
4533     InGroup<DeprecatedDeclarations>;
4534 def warn_deprecated_message : Warning<"%0 is deprecated: %1">,
4535     InGroup<DeprecatedDeclarations>;
4536 def warn_deprecated_anonymous_namespace : Warning<
4537   "'deprecated' attribute on anonymous namespace ignored">,
4538   InGroup<IgnoredAttributes>;
4539 def warn_deprecated_fwdclass_message : Warning<
4540     "%0 may be deprecated because the receiver type is unknown">,
4541     InGroup<DeprecatedDeclarations>;
4542 def warn_deprecated_def : Warning<
4543     "Implementing deprecated %select{method|class|category}0">,
4544     InGroup<DeprecatedImplementations>, DefaultIgnore;
4545 def err_unavailable : Error<"%0 is unavailable">;
4546 def err_property_method_unavailable :
4547     Error<"property access is using %0 method which is unavailable">;
4548 def err_unavailable_message : Error<"%0 is unavailable: %1">;
4549 def warn_unavailable_fwdclass_message : Warning<
4550     "%0 may be unavailable because the receiver type is unknown">,
4551     InGroup<UnavailableDeclarations>;
4552 def note_availability_specified_here : Note<
4553   "%0 has been explicitly marked "
4554   "%select{unavailable|deleted|deprecated|partial}1 here">;
4555 def note_implicitly_deleted : Note<
4556   "explicitly defaulted function was implicitly deleted here">;
4557 def warn_not_enough_argument : Warning<
4558   "not enough variable arguments in %0 declaration to fit a sentinel">,
4559   InGroup<Sentinel>;
4560 def warn_missing_sentinel : Warning <
4561   "missing sentinel in %select{function call|method dispatch|block call}0">,
4562   InGroup<Sentinel>;
4563 def note_sentinel_here : Note<
4564   "%select{function|method|block}0 has been explicitly marked sentinel here">;
4565 def warn_missing_prototype : Warning<
4566   "no previous prototype for function %0">,
4567   InGroup<DiagGroup<"missing-prototypes">>, DefaultIgnore;
4568 def note_declaration_not_a_prototype : Note<
4569   "this declaration is not a prototype; add 'void' to make it a prototype for a zero-parameter function">; 
4570 def warn_strict_prototypes : Warning<
4571   "this %select{function declaration is not|"
4572   "old-style function definition is not preceded by}0 a prototype">,
4573   InGroup<DiagGroup<"strict-prototypes">>, DefaultIgnore;
4574 def warn_missing_variable_declarations : Warning<
4575   "no previous extern declaration for non-static variable %0">,
4576   InGroup<DiagGroup<"missing-variable-declarations">>, DefaultIgnore;
4577 def err_static_data_member_reinitialization :
4578   Error<"static data member %0 already has an initializer">;
4579 def err_redefinition : Error<"redefinition of %0">;
4580 def err_alias_after_tentative :
4581   Error<"alias definition of %0 after tentative definition">;
4582 def err_alias_is_definition :
4583   Error<"definition %0 cannot also be an %select{alias|ifunc}1">;
4584 def err_definition_of_implicitly_declared_member : Error<
4585   "definition of implicitly declared %select{default constructor|copy "
4586   "constructor|move constructor|copy assignment operator|move assignment "
4587   "operator|destructor|function}1">;
4588 def err_definition_of_explicitly_defaulted_member : Error<
4589   "definition of explicitly defaulted %select{default constructor|copy "
4590   "constructor|move constructor|copy assignment operator|move assignment "
4591   "operator|destructor|function}0">;
4592 def err_redefinition_extern_inline : Error<
4593   "redefinition of a 'extern inline' function %0 is not supported in "
4594   "%select{C99 mode|C++}1">;
4595 def warn_attr_abi_tag_namespace : Warning<
4596   "'abi_tag' attribute on %select{non-inline|anonymous}0 namespace ignored">,
4597   InGroup<IgnoredAttributes>;
4598 def err_abi_tag_on_redeclaration : Error<
4599   "cannot add 'abi_tag' attribute in a redeclaration">;
4600 def err_new_abi_tag_on_redeclaration : Error<
4601   "'abi_tag' %0 missing in original declaration">;
4602
4603 def note_deleted_dtor_no_operator_delete : Note<
4604   "virtual destructor requires an unambiguous, accessible 'operator delete'">;
4605 def note_deleted_special_member_class_subobject : Note<
4606   "%select{default constructor of|copy constructor of|move constructor of|"
4607   "copy assignment operator of|move assignment operator of|destructor of|"
4608   "constructor inherited by}0 "
4609   "%1 is implicitly deleted because "
4610   "%select{base class %3|%select{||||variant }4field %3}2 has "
4611   "%select{no|a deleted|multiple|an inaccessible|a non-trivial}4 "
4612   "%select{%select{default constructor|copy constructor|move constructor|copy "
4613   "assignment operator|move assignment operator|destructor|"
4614   "%select{default|corresponding|default|default|default}4 constructor}0|"
4615   "destructor}5"
4616   "%select{||s||}4">;
4617 def note_deleted_default_ctor_uninit_field : Note<
4618   "%select{default constructor of|constructor inherited by}0 "
4619   "%1 is implicitly deleted because field %2 of "
4620   "%select{reference|const-qualified}4 type %3 would not be initialized">;
4621 def note_deleted_default_ctor_all_const : Note<
4622   "%select{default constructor of|constructor inherited by}0 "
4623   "%1 is implicitly deleted because all "
4624   "%select{data members|data members of an anonymous union member}2"
4625   " are const-qualified">;
4626 def note_deleted_copy_ctor_rvalue_reference : Note<
4627   "copy constructor of %0 is implicitly deleted because field %1 is of "
4628   "rvalue reference type %2">;
4629 def note_deleted_copy_user_declared_move : Note<
4630   "copy %select{constructor|assignment operator}0 is implicitly deleted because"
4631   " %1 has a user-declared move %select{constructor|assignment operator}2">;
4632 def note_deleted_assign_field : Note<
4633   "%select{copy|move}0 assignment operator of %1 is implicitly deleted "
4634   "because field %2 is of %select{reference|const-qualified}4 type %3">;
4635
4636 // These should be errors.
4637 def warn_undefined_internal : Warning<
4638   "%select{function|variable}0 %q1 has internal linkage but is not defined">,
4639   InGroup<DiagGroup<"undefined-internal">>;
4640 def warn_undefined_inline : Warning<"inline function %q0 is not defined">,
4641   InGroup<DiagGroup<"undefined-inline">>;
4642 def err_undefined_inline_var : Error<"inline variable %q0 is not defined">;
4643 def note_used_here : Note<"used here">;
4644
4645 def err_internal_linkage_redeclaration : Error<
4646   "'internal_linkage' attribute does not appear on the first declaration of %0">;
4647 def warn_internal_linkage_local_storage : Warning<
4648   "'internal_linkage' attribute on a non-static local variable is ignored">,
4649   InGroup<IgnoredAttributes>;
4650
4651 def ext_internal_in_extern_inline : ExtWarn<
4652   "static %select{function|variable}0 %1 is used in an inline function with "
4653   "external linkage">, InGroup<StaticInInline>;
4654 def ext_internal_in_extern_inline_quiet : Extension<
4655   "static %select{function|variable}0 %1 is used in an inline function with "
4656   "external linkage">, InGroup<StaticInInline>;
4657 def warn_static_local_in_extern_inline : Warning<
4658   "non-constant static local variable in inline function may be different "
4659   "in different files">, InGroup<StaticLocalInInline>;
4660 def note_convert_inline_to_static : Note<
4661   "use 'static' to give inline function %0 internal linkage">;
4662
4663 def ext_redefinition_of_typedef : ExtWarn<
4664   "redefinition of typedef %0 is a C11 feature">,
4665   InGroup<DiagGroup<"typedef-redefinition"> >;
4666 def err_redefinition_variably_modified_typedef : Error<
4667   "redefinition of %select{typedef|type alias}0 for variably-modified type %1">;
4668
4669 def err_inline_decl_follows_def : Error<
4670   "inline declaration of %0 follows non-inline definition">;
4671 def err_inline_declaration_block_scope : Error<
4672   "inline declaration of %0 not allowed in block scope">;
4673 def err_static_non_static : Error<
4674   "static declaration of %0 follows non-static declaration">;
4675 def err_different_language_linkage : Error<
4676   "declaration of %0 has a different language linkage">;
4677 def ext_retained_language_linkage : Extension<
4678   "friend function %0 retaining previous language linkage is an extension">,
4679   InGroup<DiagGroup<"retained-language-linkage">>;
4680 def err_extern_c_global_conflict : Error<
4681   "declaration of %1 %select{with C language linkage|in global scope}0 "
4682   "conflicts with declaration %select{in global scope|with C language linkage}0">;
4683 def note_extern_c_global_conflict : Note<
4684   "declared %select{in global scope|with C language linkage}0 here">;
4685 def note_extern_c_begins_here : Note<
4686   "extern \"C\" language linkage specification begins here">;
4687 def warn_weak_import : Warning <
4688   "an already-declared variable is made a weak_import declaration %0">;
4689 def ext_static_non_static : Extension<
4690   "redeclaring non-static %0 as static is a Microsoft extension">,
4691   InGroup<MicrosoftRedeclareStatic>;
4692 def err_non_static_static : Error<
4693   "non-static declaration of %0 follows static declaration">;
4694 def err_extern_non_extern : Error<
4695   "extern declaration of %0 follows non-extern declaration">;
4696 def err_non_extern_extern : Error<
4697   "non-extern declaration of %0 follows extern declaration">;
4698 def err_non_thread_thread : Error<
4699   "non-thread-local declaration of %0 follows thread-local declaration">;
4700 def err_thread_non_thread : Error<
4701   "thread-local declaration of %0 follows non-thread-local declaration">;
4702 def err_thread_thread_different_kind : Error<
4703   "thread-local declaration of %0 with %select{static|dynamic}1 initialization "
4704   "follows declaration with %select{dynamic|static}1 initialization">;
4705 def err_redefinition_different_type : Error<
4706   "redefinition of %0 with a different type%diff{: $ vs $|}1,2">;
4707 def err_redefinition_different_kind : Error<
4708   "redefinition of %0 as different kind of symbol">;
4709 def err_redefinition_different_namespace_alias : Error<
4710   "redefinition of %0 as an alias for a different namespace">;
4711 def note_previous_namespace_alias : Note<
4712   "previously defined as an alias for %0">;
4713 def warn_forward_class_redefinition : Warning<
4714   "redefinition of forward class %0 of a typedef name of an object type is ignored">,
4715   InGroup<DiagGroup<"objc-forward-class-redefinition">>;
4716 def err_redefinition_different_typedef : Error<
4717   "%select{typedef|type alias|type alias template}0 "
4718   "redefinition with different types%diff{ ($ vs $)|}1,2">;
4719 def err_tag_reference_non_tag : Error<
4720   "%select{non-struct type|non-class type|non-union type|non-enum "
4721   "type|typedef|type alias|template|type alias template|template "
4722   "template argument}1 %0 cannot be referenced with a "
4723   "%select{struct|interface|union|class|enum}2 specifier">;
4724 def err_tag_reference_conflict : Error<
4725   "implicit declaration introduced by elaborated type conflicts with a "
4726   "%select{non-struct type|non-class type|non-union type|non-enum "
4727   "type|typedef|type alias|template|type alias template|template "
4728   "template argument}0 of the same name">;
4729 def err_dependent_tag_decl : Error<
4730   "%select{declaration|definition}0 of "
4731   "%select{struct|interface|union|class|enum}1 in a dependent scope">;
4732 def err_tag_definition_of_typedef : Error<
4733   "definition of type %0 conflicts with %select{typedef|type alias}1 of the same name">;
4734 def err_conflicting_types : Error<"conflicting types for %0">;
4735 def err_different_pass_object_size_params : Error<
4736   "conflicting pass_object_size attributes on parameters">;
4737 def err_late_asm_label_name : Error<
4738   "cannot apply asm label to %select{variable|function}0 after its first use">;
4739 def err_different_asm_label : Error<"conflicting asm label">;
4740 def err_nested_redefinition : Error<"nested redefinition of %0">;
4741 def err_use_with_wrong_tag : Error<
4742   "use of %0 with tag type that does not match previous declaration">;
4743 def warn_struct_class_tag_mismatch : Warning<
4744     "%select{struct|interface|class}0%select{| template}1 %2 was previously "
4745     "declared as a %select{struct|interface|class}3%select{| template}1">,
4746     InGroup<MismatchedTags>, DefaultIgnore;
4747 def warn_struct_class_previous_tag_mismatch : Warning<
4748     "%2 defined as %select{a struct|an interface|a class}0%select{| template}1 "
4749     "here but previously declared as "
4750     "%select{a struct|an interface|a class}3%select{| template}1">,
4751      InGroup<MismatchedTags>, DefaultIgnore;
4752 def note_struct_class_suggestion : Note<
4753     "did you mean %select{struct|interface|class}0 here?">;
4754 def ext_forward_ref_enum : Extension<
4755   "ISO C forbids forward references to 'enum' types">;
4756 def err_forward_ref_enum : Error<
4757   "ISO C++ forbids forward references to 'enum' types">;
4758 def ext_ms_forward_ref_enum : Extension<
4759   "forward references to 'enum' types are a Microsoft extension">,
4760   InGroup<MicrosoftEnumForwardReference>;
4761 def ext_forward_ref_enum_def : Extension<
4762   "redeclaration of already-defined enum %0 is a GNU extension">,
4763   InGroup<GNURedeclaredEnum>;
4764   
4765 def err_redefinition_of_enumerator : Error<"redefinition of enumerator %0">;
4766 def err_duplicate_member : Error<"duplicate member %0">;
4767 def err_misplaced_ivar : Error<
4768   "instance variables may not be placed in %select{categories|class extension}0">;
4769 def warn_ivars_in_interface : Warning<
4770   "declaration of instance variables in the interface is deprecated">,
4771   InGroup<DiagGroup<"objc-interface-ivars">>, DefaultIgnore;
4772 def ext_enum_value_not_int : Extension<
4773   "ISO C restricts enumerator values to range of 'int' (%0 is too "
4774   "%select{small|large}1)">;
4775 def ext_enum_too_large : ExtWarn<
4776   "enumeration values exceed range of largest integer">, InGroup<EnumTooLarge>;
4777 def ext_enumerator_increment_too_large : ExtWarn<
4778   "incremented enumerator value %0 is not representable in the "
4779   "largest integer type">, InGroup<EnumTooLarge>;
4780 def warn_flag_enum_constant_out_of_range : Warning<
4781   "enumeration value %0 is out of range of flags in enumeration type %1">,
4782   InGroup<FlagEnum>;
4783   
4784 def warn_illegal_constant_array_size : Extension<
4785   "size of static array must be an integer constant expression">;
4786 def err_vm_decl_in_file_scope : Error<
4787   "variably modified type declaration not allowed at file scope">;
4788 def err_vm_decl_has_extern_linkage : Error<
4789   "variably modified type declaration cannot have 'extern' linkage">;
4790 def err_typecheck_field_variable_size : Error<
4791   "fields must have a constant size: 'variable length array in structure' "
4792   "extension will never be supported">;
4793 def err_vm_func_decl : Error<
4794   "function declaration cannot have variably modified type">;
4795 def err_array_too_large : Error<
4796   "array is too large (%0 elements)">;
4797
4798 // -Wpadded, -Wpacked
4799 def warn_padded_struct_field : Warning<
4800   "padding %select{struct|interface|class}0 %1 with %2 "
4801   "%select{byte|bit}3%s2 to align %4">,
4802   InGroup<Padded>, DefaultIgnore;
4803 def warn_padded_struct_anon_field : Warning<
4804   "padding %select{struct|interface|class}0 %1 with %2 "
4805   "%select{byte|bit}3%s2 to align anonymous bit-field">,
4806   InGroup<Padded>, DefaultIgnore;
4807 def warn_padded_struct_size : Warning<
4808   "padding size of %0 with %1 %select{byte|bit}2%s1 to alignment boundary">,
4809   InGroup<Padded>, DefaultIgnore;
4810 def warn_unnecessary_packed : Warning<
4811   "packed attribute is unnecessary for %0">, InGroup<Packed>, DefaultIgnore;
4812
4813 def err_typecheck_negative_array_size : Error<"array size is negative">;
4814 def warn_typecheck_function_qualifiers_ignored : Warning<
4815   "'%0' qualifier on function type %1 has no effect">,
4816   InGroup<IgnoredQualifiers>;
4817 def warn_typecheck_function_qualifiers_unspecified : Warning<
4818   "'%0' qualifier on function type %1 has unspecified behavior">;
4819 def warn_typecheck_reference_qualifiers : Warning<
4820   "'%0' qualifier on reference type %1 has no effect">,
4821   InGroup<IgnoredQualifiers>;
4822 def err_typecheck_invalid_restrict_not_pointer : Error<
4823   "restrict requires a pointer or reference (%0 is invalid)">;
4824 def err_typecheck_invalid_restrict_not_pointer_noarg : Error<
4825   "restrict requires a pointer or reference">;
4826 def err_typecheck_invalid_restrict_invalid_pointee : Error<
4827   "pointer to function type %0 may not be 'restrict' qualified">;
4828 def ext_typecheck_zero_array_size : Extension<
4829   "zero size arrays are an extension">, InGroup<ZeroLengthArray>;
4830 def err_typecheck_zero_array_size : Error<
4831   "zero-length arrays are not permitted in C++">;
4832 def warn_typecheck_zero_static_array_size : Warning<
4833   "'static' has no effect on zero-length arrays">,
4834   InGroup<ArrayBounds>;
4835 def err_array_size_non_int : Error<"size of array has non-integer type %0">;
4836 def err_init_element_not_constant : Error<
4837   "initializer element is not a compile-time constant">;
4838 def ext_aggregate_init_not_constant : Extension<
4839   "initializer for aggregate is not a compile-time constant">, InGroup<C99>;
4840 def err_local_cant_init : Error<
4841   "'__local' variable cannot have an initializer">;
4842 def err_block_extern_cant_init : Error<
4843   "'extern' variable cannot have an initializer">;
4844 def warn_extern_init : Warning<"'extern' variable has an initializer">,
4845   InGroup<DiagGroup<"extern-initializer">>;
4846 def err_variable_object_no_init : Error<
4847   "variable-sized object may not be initialized">;
4848 def err_excess_initializers : Error<
4849   "excess elements in %select{array|vector|scalar|union|struct}0 initializer">;
4850 def ext_excess_initializers : ExtWarn<
4851   "excess elements in %select{array|vector|scalar|union|struct}0 initializer">;
4852 def err_excess_initializers_in_char_array_initializer : Error<
4853   "excess elements in char array initializer">;
4854 def ext_excess_initializers_in_char_array_initializer : ExtWarn<
4855   "excess elements in char array initializer">;
4856 def err_initializer_string_for_char_array_too_long : Error<
4857   "initializer-string for char array is too long">;
4858 def ext_initializer_string_for_char_array_too_long : ExtWarn<
4859   "initializer-string for char array is too long">;
4860 def warn_missing_field_initializers : Warning<
4861   "missing field %0 initializer">,
4862   InGroup<MissingFieldInitializers>, DefaultIgnore;
4863 def warn_braces_around_scalar_init : Warning<
4864   "braces around scalar initializer">, InGroup<DiagGroup<"braced-scalar-init">>;
4865 def ext_many_braces_around_scalar_init : ExtWarn<
4866   "too many braces around scalar initializer">,
4867   InGroup<DiagGroup<"many-braces-around-scalar-init">>;
4868 def ext_complex_component_init : Extension<
4869   "complex initialization specifying real and imaginary components "
4870   "is an extension">, InGroup<DiagGroup<"complex-component-init">>;
4871 def err_empty_scalar_initializer : Error<"scalar initializer cannot be empty">;
4872 def warn_cxx98_compat_empty_scalar_initializer : Warning<
4873   "scalar initialized from empty initializer list is incompatible with C++98">,
4874   InGroup<CXX98Compat>, DefaultIgnore;
4875 def warn_cxx98_compat_reference_list_init : Warning<
4876   "reference initialized from initializer list is incompatible with C++98">,
4877   InGroup<CXX98Compat>, DefaultIgnore;
4878 def warn_cxx98_compat_initializer_list_init : Warning<
4879   "initialization of initializer_list object is incompatible with C++98">,
4880   InGroup<CXX98Compat>, DefaultIgnore;
4881 def warn_cxx98_compat_ctor_list_init : Warning<
4882   "constructor call from initializer list is incompatible with C++98">,
4883   InGroup<CXX98Compat>, DefaultIgnore;
4884 def err_illegal_initializer : Error<
4885   "illegal initializer (only variables can be initialized)">;
4886 def err_illegal_initializer_type : Error<"illegal initializer type %0">;
4887 def ext_init_list_type_narrowing : ExtWarn<
4888   "type %0 cannot be narrowed to %1 in initializer list">, 
4889   InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
4890 def ext_init_list_variable_narrowing : ExtWarn<
4891   "non-constant-expression cannot be narrowed from type %0 to %1 in "
4892   "initializer list">, InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
4893 def ext_init_list_constant_narrowing : ExtWarn<
4894   "constant expression evaluates to %0 which cannot be narrowed to type %1">,
4895   InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
4896 def warn_init_list_type_narrowing : Warning<
4897   "type %0 cannot be narrowed to %1 in initializer list in C++11">,
4898   InGroup<CXX11Narrowing>, DefaultIgnore;
4899 def warn_init_list_variable_narrowing : Warning<
4900   "non-constant-expression cannot be narrowed from type %0 to %1 in "
4901   "initializer list in C++11">,
4902   InGroup<CXX11Narrowing>, DefaultIgnore;
4903 def warn_init_list_constant_narrowing : Warning<
4904   "constant expression evaluates to %0 which cannot be narrowed to type %1 in "
4905   "C++11">,
4906   InGroup<CXX11Narrowing>, DefaultIgnore;
4907 def note_init_list_narrowing_silence : Note<
4908   "insert an explicit cast to silence this issue">;
4909 def err_init_objc_class : Error<
4910   "cannot initialize Objective-C class type %0">;
4911 def err_implicit_empty_initializer : Error<
4912   "initializer for aggregate with no elements requires explicit braces">;
4913 def err_bitfield_has_negative_width : Error<
4914   "bit-field %0 has negative width (%1)">;
4915 def err_anon_bitfield_has_negative_width : Error<
4916   "anonymous bit-field has negative width (%0)">;
4917 def err_bitfield_has_zero_width : Error<"named bit-field %0 has zero width">;
4918 def err_bitfield_width_exceeds_type_width : Error<
4919   "width of bit-field %0 (%1 bits) exceeds %select{width|size}2 "
4920   "of its type (%3 bit%s3)">;
4921 def err_anon_bitfield_width_exceeds_type_width : Error<
4922   "width of anonymous bit-field (%0 bits) exceeds %select{width|size}1 "
4923   "of its type (%2 bit%s2)">;
4924 def err_incorrect_number_of_vector_initializers : Error<
4925   "number of elements must be either one or match the size of the vector">;
4926
4927 // Used by C++ which allows bit-fields that are wider than the type.
4928 def warn_bitfield_width_exceeds_type_width: Warning<
4929   "width of bit-field %0 (%1 bits) exceeds the width of its type; value will "
4930   "be truncated to %2 bit%s2">, InGroup<BitFieldWidth>;
4931 def warn_anon_bitfield_width_exceeds_type_width : Warning<
4932   "width of anonymous bit-field (%0 bits) exceeds width of its type; value "
4933   "will be truncated to %1 bit%s1">, InGroup<BitFieldWidth>;
4934 def warn_bitfield_too_small_for_enum : Warning<
4935   "bit-field %0 is not wide enough to store all enumerators of %1">,
4936   InGroup<BitFieldEnumConversion>, DefaultIgnore;
4937 def note_widen_bitfield : Note<
4938   "widen this field to %0 bits to store all values of %1">;
4939 def warn_unsigned_bitfield_assigned_signed_enum : Warning<
4940   "assigning value of signed enum type %1 to unsigned bit-field %0; "
4941   "negative enumerators of enum %1 will be converted to positive values">,
4942   InGroup<BitFieldEnumConversion>, DefaultIgnore;
4943 def warn_signed_bitfield_enum_conversion : Warning<
4944   "signed bit-field %0 needs an extra bit to represent the largest positive "
4945   "enumerators of %1">,
4946   InGroup<BitFieldEnumConversion>, DefaultIgnore;
4947 def note_change_bitfield_sign : Note<
4948   "consider making the bitfield type %select{unsigned|signed}0">;
4949
4950 def warn_missing_braces : Warning<
4951   "suggest braces around initialization of subobject">,
4952   InGroup<MissingBraces>, DefaultIgnore;
4953
4954 def err_redefinition_of_label : Error<"redefinition of label %0">;
4955 def err_undeclared_label_use : Error<"use of undeclared label %0">;
4956 def err_goto_ms_asm_label : Error<
4957   "cannot jump from this goto statement to label %0 inside an inline assembly block">;
4958 def note_goto_ms_asm_label : Note<
4959   "inline assembly label %0 declared here">;
4960 def warn_unused_label : Warning<"unused label %0">,
4961   InGroup<UnusedLabel>, DefaultIgnore;
4962
4963 def err_goto_into_protected_scope : Error<
4964   "cannot jump from this goto statement to its label">;
4965 def ext_goto_into_protected_scope : ExtWarn<
4966   "jump from this goto statement to its label is a Microsoft extension">,
4967   InGroup<MicrosoftGoto>;
4968 def warn_cxx98_compat_goto_into_protected_scope : Warning<
4969   "jump from this goto statement to its label is incompatible with C++98">,
4970   InGroup<CXX98Compat>, DefaultIgnore;
4971 def err_switch_into_protected_scope : Error<
4972   "cannot jump from switch statement to this case label">;
4973 def warn_cxx98_compat_switch_into_protected_scope : Warning<
4974   "jump from switch statement to this case label is incompatible with C++98">,
4975   InGroup<CXX98Compat>, DefaultIgnore;
4976 def err_indirect_goto_without_addrlabel : Error<
4977   "indirect goto in function with no address-of-label expressions">;
4978 def err_indirect_goto_in_protected_scope : Error<
4979   "cannot jump from this indirect goto statement to one of its possible targets">;
4980 def warn_cxx98_compat_indirect_goto_in_protected_scope : Warning<
4981   "jump from this indirect goto statement to one of its possible targets "
4982   "is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
4983 def note_indirect_goto_target : Note<
4984   "possible target of indirect goto statement">;
4985 def note_protected_by_variable_init : Note<
4986   "jump bypasses variable initialization">;
4987 def note_protected_by_variable_nontriv_destructor : Note<
4988   "jump bypasses variable with a non-trivial destructor">;
4989 def note_protected_by_variable_non_pod : Note<
4990   "jump bypasses initialization of non-POD variable">;
4991 def note_protected_by_cleanup : Note<
4992   "jump bypasses initialization of variable with __attribute__((cleanup))">;
4993 def note_protected_by_vla_typedef : Note<
4994   "jump bypasses initialization of VLA typedef">;
4995 def note_protected_by_vla_type_alias : Note<
4996   "jump bypasses initialization of VLA type alias">;
4997 def note_protected_by_constexpr_if : Note<
4998   "jump enters controlled statement of constexpr if">;
4999 def note_protected_by_if_available : Note<
5000   "jump enters controlled statement of if available">;
5001 def note_protected_by_vla : Note<
5002   "jump bypasses initialization of variable length array">;
5003 def note_protected_by_objc_fast_enumeration : Note<
5004   "jump enters Objective-C fast enumeration loop">;
5005 def note_protected_by_objc_try : Note<
5006   "jump bypasses initialization of @try block">;
5007 def note_protected_by_objc_catch : Note<
5008   "jump bypasses initialization of @catch block">;
5009 def note_protected_by_objc_finally : Note<
5010   "jump bypasses initialization of @finally block">;
5011 def note_protected_by_objc_synchronized : Note<
5012   "jump bypasses initialization of @synchronized block">;
5013 def note_protected_by_objc_autoreleasepool : Note<
5014   "jump bypasses auto release push of @autoreleasepool block">;
5015 def note_protected_by_cxx_try : Note<
5016   "jump bypasses initialization of try block">;
5017 def note_protected_by_cxx_catch : Note<
5018   "jump bypasses initialization of catch block">;
5019 def note_protected_by_seh_try : Note<
5020   "jump bypasses initialization of __try block">;
5021 def note_protected_by_seh_except : Note<
5022   "jump bypasses initialization of __except block">;
5023 def note_protected_by_seh_finally : Note<
5024   "jump bypasses initialization of __finally block">;
5025 def note_protected_by___block : Note<
5026   "jump bypasses setup of __block variable">;
5027 def note_protected_by_objc_strong_init : Note<
5028   "jump bypasses initialization of __strong variable">;
5029 def note_protected_by_objc_weak_init : Note<
5030   "jump bypasses initialization of __weak variable">;
5031 def note_enters_block_captures_cxx_obj : Note<
5032   "jump enters lifetime of block which captures a destructible C++ object">;
5033 def note_enters_block_captures_strong : Note<
5034   "jump enters lifetime of block which strongly captures a variable">;
5035 def note_enters_block_captures_weak : Note<
5036   "jump enters lifetime of block which weakly captures a variable">;
5037
5038 def note_exits_cleanup : Note<
5039   "jump exits scope of variable with __attribute__((cleanup))">;
5040 def note_exits_dtor : Note<
5041   "jump exits scope of variable with non-trivial destructor">;
5042 def note_exits_temporary_dtor : Note<
5043   "jump exits scope of lifetime-extended temporary with non-trivial "
5044   "destructor">;
5045 def note_exits___block : Note<
5046   "jump exits scope of __block variable">;
5047 def note_exits_objc_try : Note<
5048   "jump exits @try block">;
5049 def note_exits_objc_catch : Note<
5050   "jump exits @catch block">;
5051 def note_exits_objc_finally : Note<
5052   "jump exits @finally block">;
5053 def note_exits_objc_synchronized : Note<
5054   "jump exits @synchronized block">;
5055 def note_exits_cxx_try : Note<
5056   "jump exits try block">;
5057 def note_exits_cxx_catch : Note<
5058   "jump exits catch block">;
5059 def note_exits_seh_try : Note<
5060   "jump exits __try block">;
5061 def note_exits_seh_except : Note<
5062   "jump exits __except block">;
5063 def note_exits_seh_finally : Note<
5064   "jump exits __finally block">;
5065 def note_exits_objc_autoreleasepool : Note<
5066   "jump exits autoreleasepool block">;
5067 def note_exits_objc_strong : Note<
5068   "jump exits scope of __strong variable">;
5069 def note_exits_objc_weak : Note<
5070   "jump exits scope of __weak variable">;
5071 def note_exits_block_captures_cxx_obj : Note<
5072   "jump exits lifetime of block which captures a destructible C++ object">;
5073 def note_exits_block_captures_strong : Note<
5074   "jump exits lifetime of block which strongly captures a variable">;
5075 def note_exits_block_captures_weak : Note<
5076   "jump exits lifetime of block which weakly captures a variable">;
5077
5078 def err_func_returning_qualified_void : ExtWarn<
5079   "function cannot return qualified void type %0">,
5080   InGroup<DiagGroup<"qualified-void-return-type">>;
5081 def err_func_returning_array_function : Error<
5082   "function cannot return %select{array|function}0 type %1">;
5083 def err_field_declared_as_function : Error<"field %0 declared as a function">;
5084 def err_field_incomplete : Error<"field has incomplete type %0">;
5085 def ext_variable_sized_type_in_struct : ExtWarn<
5086   "field %0 with variable sized type %1 not at the end of a struct or class is"
5087   " a GNU extension">, InGroup<GNUVariableSizedTypeNotAtEnd>;
5088
5089 def ext_c99_flexible_array_member : Extension<
5090   "flexible array members are a C99 feature">, InGroup<C99>;
5091 def err_flexible_array_virtual_base : Error<
5092   "flexible array member %0 not allowed in "
5093   "%select{struct|interface|union|class|enum}1 which has a virtual base class">;
5094 def err_flexible_array_empty_aggregate : Error<
5095   "flexible array member %0 not allowed in otherwise empty "
5096   "%select{struct|interface|union|class|enum}1">;
5097 def err_flexible_array_has_nontrivial_dtor : Error<
5098   "flexible array member %0 of type %1 with non-trivial destruction">;
5099 def ext_flexible_array_in_struct : Extension<
5100   "%0 may not be nested in a struct due to flexible array member">,
5101   InGroup<FlexibleArrayExtensions>;
5102 def ext_flexible_array_in_array : Extension<
5103   "%0 may not be used as an array element due to flexible array member">,
5104   InGroup<FlexibleArrayExtensions>;
5105 def err_flexible_array_init : Error<
5106   "initialization of flexible array member is not allowed">;
5107 def ext_flexible_array_empty_aggregate_ms : Extension<
5108   "flexible array member %0 in otherwise empty "
5109   "%select{struct|interface|union|class|enum}1 is a Microsoft extension">,
5110   InGroup<MicrosoftFlexibleArray>;
5111 def err_flexible_array_union : Error<
5112   "flexible array member %0 in a union is not allowed">;
5113 def ext_flexible_array_union_ms : Extension<
5114   "flexible array member %0 in a union is a Microsoft extension">,
5115   InGroup<MicrosoftFlexibleArray>;
5116 def ext_flexible_array_empty_aggregate_gnu : Extension<
5117   "flexible array member %0 in otherwise empty "
5118   "%select{struct|interface|union|class|enum}1 is a GNU extension">,
5119   InGroup<GNUEmptyStruct>;
5120 def ext_flexible_array_union_gnu : Extension<
5121   "flexible array member %0 in a union is a GNU extension">, InGroup<GNUFlexibleArrayUnionMember>;
5122
5123 let CategoryName = "ARC Semantic Issue" in {
5124
5125 // ARC-mode diagnostics.
5126
5127 let CategoryName = "ARC Weak References" in {
5128
5129 def err_arc_weak_no_runtime : Error<
5130   "cannot create __weak reference because the current deployment target "
5131   "does not support weak references">;
5132 def err_arc_weak_disabled : Error<
5133   "cannot create __weak reference in file using manual reference counting">;
5134 def err_synthesizing_arc_weak_property_disabled : Error<
5135   "cannot synthesize weak property in file using manual reference counting">;
5136 def err_synthesizing_arc_weak_property_no_runtime : Error<
5137   "cannot synthesize weak property because the current deployment target "
5138   "does not support weak references">;
5139 def err_arc_unsupported_weak_class : Error<
5140   "class is incompatible with __weak references">;
5141 def err_arc_weak_unavailable_assign : Error<
5142   "assignment of a weak-unavailable object to a __weak object">;
5143 def err_arc_weak_unavailable_property : Error<
5144   "synthesizing __weak instance variable of type %0, which does not "
5145   "support weak references">;
5146 def note_implemented_by_class : Note<
5147   "when implemented by class %0">;
5148 def err_arc_convesion_of_weak_unavailable : Error<
5149   "%select{implicit conversion|cast}0 of weak-unavailable object of type %1 to"
5150   " a __weak object of type %2">;
5151
5152 } // end "ARC Weak References" category
5153
5154 let CategoryName = "ARC Restrictions" in {
5155
5156 def err_unavailable_in_arc : Error<
5157   "%0 is unavailable in ARC">;
5158 def note_arc_forbidden_type : Note<
5159   "declaration uses type that is ill-formed in ARC">;
5160 def note_performs_forbidden_arc_conversion : Note<
5161   "inline function performs a conversion which is forbidden in ARC">;
5162 def note_arc_init_returns_unrelated : Note<
5163   "init method must return a type related to its receiver type">;
5164 def note_arc_weak_disabled : Note<
5165   "declaration uses __weak, but ARC is disabled">;
5166 def note_arc_weak_no_runtime : Note<"declaration uses __weak, which "
5167   "the current deployment target does not support">;
5168 def note_arc_field_with_ownership : Note<
5169   "field has non-trivial ownership qualification">;
5170
5171 def err_arc_illegal_explicit_message : Error<
5172   "ARC forbids explicit message send of %0">;
5173 def err_arc_unused_init_message : Error<
5174   "the result of a delegate init call must be immediately returned "
5175   "or assigned to 'self'">;
5176 def err_arc_mismatched_cast : Error<
5177   "%select{implicit conversion|cast}0 of "
5178   "%select{%2|a non-Objective-C pointer type %2|a block pointer|"
5179   "an Objective-C pointer|an indirect pointer to an Objective-C pointer}1"
5180   " to %3 is disallowed with ARC">;
5181 def err_arc_nolifetime_behavior : Error<
5182   "explicit ownership qualifier on cast result has no effect">;
5183 def err_arc_objc_object_in_tag : Error<
5184   "ARC forbids %select{Objective-C objects|blocks}0 in "
5185   "%select{struct|interface|union|<<ERROR>>|enum}1">;
5186 def err_arc_objc_property_default_assign_on_object : Error<
5187   "ARC forbids synthesizing a property of an Objective-C object "
5188   "with unspecified ownership or storage attribute">;
5189 def err_arc_illegal_selector : Error<
5190   "ARC forbids use of %0 in a @selector">;
5191 def err_arc_illegal_method_def : Error<
5192   "ARC forbids %select{implementation|synthesis}0 of %1">;
5193 def warn_arc_strong_pointer_objc_pointer : Warning<
5194   "method parameter of type %0 with no explicit ownership">,
5195   InGroup<DiagGroup<"explicit-ownership-type">>, DefaultIgnore;
5196   
5197 } // end "ARC Restrictions" category
5198   
5199 def err_arc_lost_method_convention : Error<
5200   "method was declared as %select{an 'alloc'|a 'copy'|an 'init'|a 'new'}0 "
5201   "method, but its implementation doesn't match because %select{"
5202   "its result type is not an object pointer|"
5203   "its result type is unrelated to its receiver type}1">;
5204 def note_arc_lost_method_convention : Note<"declaration in interface">;
5205 def err_arc_gained_method_convention : Error<
5206   "method implementation does not match its declaration">;
5207 def note_arc_gained_method_convention : Note<
5208   "declaration in interface is not in the '%select{alloc|copy|init|new}0' "
5209   "family because %select{its result type is not an object pointer|"
5210   "its result type is unrelated to its receiver type}1">;
5211 def err_typecheck_arc_assign_self : Error<
5212   "cannot assign to 'self' outside of a method in the init family">;
5213 def err_typecheck_arc_assign_self_class_method : Error<
5214   "cannot assign to 'self' in a class method">;
5215 def err_typecheck_arr_assign_enumeration : Error<
5216   "fast enumeration variables cannot be modified in ARC by default; "
5217   "declare the variable __strong to allow this">;
5218 def warn_arc_retained_assign : Warning<
5219   "assigning retained object to %select{weak|unsafe_unretained}0 "
5220   "%select{property|variable}1"
5221   "; object will be released after assignment">,
5222   InGroup<ARCUnsafeRetainedAssign>;
5223 def warn_arc_retained_property_assign : Warning<
5224   "assigning retained object to unsafe property"
5225   "; object will be released after assignment">,
5226   InGroup<ARCUnsafeRetainedAssign>;
5227 def warn_arc_literal_assign : Warning<
5228   "assigning %select{array literal|dictionary literal|numeric literal|boxed expression|<should not happen>|block literal}0"
5229   " to a weak %select{property|variable}1"
5230   "; object will be released after assignment">,
5231   InGroup<ARCUnsafeRetainedAssign>;
5232 def err_arc_new_array_without_ownership : Error<
5233   "'new' cannot allocate an array of %0 with no explicit ownership">;
5234 def err_arc_autoreleasing_var : Error<
5235   "%select{__block variables|global variables|fields|instance variables}0 cannot have "
5236   "__autoreleasing ownership">;
5237 def err_arc_autoreleasing_capture : Error<
5238   "cannot capture __autoreleasing variable in a "
5239   "%select{block|lambda by copy}0">;
5240 def err_arc_thread_ownership : Error<
5241   "thread-local variable has non-trivial ownership: type is %0">;
5242 def err_arc_indirect_no_ownership : Error<
5243   "%select{pointer|reference}1 to non-const type %0 with no explicit ownership">;
5244 def err_arc_array_param_no_ownership : Error<
5245   "must explicitly describe intended ownership of an object array parameter">;
5246 def err_arc_pseudo_dtor_inconstant_quals : Error<
5247   "pseudo-destructor destroys object of type %0 with inconsistently-qualified "
5248   "type %1">;
5249 def err_arc_init_method_unrelated_result_type : Error<
5250   "init methods must return a type related to the receiver type">;
5251 def err_arc_nonlocal_writeback : Error<
5252   "passing address of %select{non-local|non-scalar}0 object to "
5253   "__autoreleasing parameter for write-back">;
5254 def err_arc_method_not_found : Error<
5255   "no known %select{instance|class}1 method for selector %0">;
5256 def err_arc_receiver_forward_class : Error<
5257   "receiver %0 for class message is a forward declaration">;
5258 def err_arc_may_not_respond : Error<
5259   "no visible @interface for %0 declares the selector %1">;
5260 def err_arc_receiver_forward_instance : Error<
5261   "receiver type %0 for instance message is a forward declaration">;
5262 def warn_receiver_forward_instance : Warning<
5263   "receiver type %0 for instance message is a forward declaration">,
5264   InGroup<ForwardClassReceiver>, DefaultIgnore;
5265 def err_arc_collection_forward : Error<
5266   "collection expression type %0 is a forward declaration">;
5267 def err_arc_multiple_method_decl : Error< 
5268   "multiple methods named %0 found with mismatched result, "
5269   "parameter type or attributes">;
5270 def warn_arc_lifetime_result_type : Warning<
5271   "ARC %select{unused|__unsafe_unretained|__strong|__weak|__autoreleasing}0 "
5272   "lifetime qualifier on return type is ignored">,
5273   InGroup<IgnoredQualifiers>;
5274
5275 let CategoryName = "ARC Retain Cycle" in {
5276
5277 def warn_arc_retain_cycle : Warning<
5278   "capturing %0 strongly in this block is likely to lead to a retain cycle">,
5279   InGroup<ARCRetainCycles>;
5280 def note_arc_retain_cycle_owner : Note<
5281   "block will be retained by %select{the captured object|an object strongly "
5282   "retained by the captured object}0">;
5283
5284 } // end "ARC Retain Cycle" category
5285
5286 def warn_arc_object_memaccess : Warning<
5287   "%select{destination for|source of}0 this %1 call is a pointer to "
5288   "ownership-qualified type %2">, InGroup<ARCNonPodMemAccess>;
5289
5290 let CategoryName = "ARC and @properties" in {
5291
5292 def err_arc_strong_property_ownership : Error<
5293   "existing instance variable %1 for strong property %0 may not be "
5294   "%select{|__unsafe_unretained||__weak}2">;
5295 def err_arc_assign_property_ownership : Error<
5296   "existing instance variable %1 for property %0 with %select{unsafe_unretained|assign}2 "
5297   "attribute must be __unsafe_unretained">;
5298 def err_arc_inconsistent_property_ownership : Error<
5299   "%select{|unsafe_unretained|strong|weak}1 property %0 may not also be "
5300   "declared %select{|__unsafe_unretained|__strong|__weak|__autoreleasing}2">;
5301
5302 } // end "ARC and @properties" category
5303
5304 def warn_block_capture_autoreleasing : Warning<
5305   "block captures an autoreleasing out-parameter, which may result in "
5306   "use-after-free bugs">,
5307   InGroup<BlockCaptureAutoReleasing>;
5308 def note_declare_parameter_autoreleasing : Note<
5309   "declare the parameter __autoreleasing explicitly to suppress this warning">;
5310 def note_declare_parameter_strong : Note<
5311   "declare the parameter __strong or capture a __block __strong variable to "
5312   "keep values alive across autorelease pools">;
5313
5314 def err_arc_atomic_ownership : Error<
5315   "cannot perform atomic operation on a pointer to type %0: type has "
5316   "non-trivial ownership">;
5317
5318 let CategoryName = "ARC Casting Rules" in {
5319
5320 def err_arc_bridge_cast_incompatible : Error<
5321   "incompatible types casting %0 to %1 with a %select{__bridge|"
5322   "__bridge_transfer|__bridge_retained}2 cast">;
5323 def err_arc_bridge_cast_wrong_kind : Error<
5324   "cast of %select{Objective-C|block|C}0 pointer type %1 to "
5325   "%select{Objective-C|block|C}2 pointer type %3 cannot use %select{__bridge|"
5326   "__bridge_transfer|__bridge_retained}4">;
5327 def err_arc_cast_requires_bridge : Error<
5328   "%select{cast|implicit conversion}0 of %select{Objective-C|block|C}1 "
5329   "pointer type %2 to %select{Objective-C|block|C}3 pointer type %4 "
5330   "requires a bridged cast">;
5331 def note_arc_bridge : Note<
5332   "use __bridge to convert directly (no change in ownership)">;
5333 def note_arc_cstyle_bridge : Note<
5334   "use __bridge with C-style cast to convert directly (no change in ownership)">;
5335 def note_arc_bridge_transfer : Note<
5336   "use %select{__bridge_transfer|CFBridgingRelease call}1 to transfer "
5337   "ownership of a +1 %0 into ARC">;
5338 def note_arc_cstyle_bridge_transfer : Note<
5339   "use __bridge_transfer with C-style cast to transfer "
5340   "ownership of a +1 %0 into ARC">;
5341 def note_arc_bridge_retained : Note<
5342   "use %select{__bridge_retained|CFBridgingRetain call}1 to make an "
5343   "ARC object available as a +1 %0">;
5344 def note_arc_cstyle_bridge_retained : Note<
5345   "use __bridge_retained with C-style cast to make an "
5346   "ARC object available as a +1 %0">;
5347
5348 } // ARC Casting category
5349
5350 } // ARC category name
5351
5352 def err_flexible_array_init_needs_braces : Error<
5353   "flexible array requires brace-enclosed initializer">;
5354 def err_illegal_decl_array_of_functions : Error<
5355   "'%0' declared as array of functions of type %1">;
5356 def err_illegal_decl_array_incomplete_type : Error<
5357   "array has incomplete element type %0">;
5358 def err_illegal_message_expr_incomplete_type : Error<
5359   "Objective-C message has incomplete result type %0">;
5360 def err_illegal_decl_array_of_references : Error<
5361   "'%0' declared as array of references of type %1">;
5362 def err_decl_negative_array_size : Error<
5363   "'%0' declared as an array with a negative size">;
5364 def err_array_static_outside_prototype : Error<
5365   "%0 used in array declarator outside of function prototype">;
5366 def err_array_static_not_outermost : Error<
5367   "%0 used in non-outermost array type derivation">;
5368 def err_array_star_outside_prototype : Error<
5369   "star modifier used outside of function prototype">;
5370 def err_illegal_decl_pointer_to_reference : Error<
5371   "'%0' declared as a pointer to a reference of type %1">;
5372 def err_illegal_decl_mempointer_to_reference : Error<
5373   "'%0' declared as a member pointer to a reference of type %1">;
5374 def err_illegal_decl_mempointer_to_void : Error<
5375   "'%0' declared as a member pointer to void">;
5376 def err_illegal_decl_mempointer_in_nonclass : Error<
5377   "'%0' does not point into a class">;
5378 def err_mempointer_in_nonclass_type : Error<
5379   "member pointer refers into non-class type %0">;
5380 def err_reference_to_void : Error<"cannot form a reference to 'void'">;
5381 def err_nonfunction_block_type : Error<
5382   "block pointer to non-function type is invalid">;
5383 def err_return_block_has_expr : Error<"void block should not return a value">;
5384 def err_block_return_missing_expr : Error<
5385   "non-void block should return a value">;
5386 def err_func_def_incomplete_result : Error<
5387   "incomplete result type %0 in function definition">;
5388 def err_atomic_specifier_bad_type : Error<
5389   "_Atomic cannot be applied to "
5390   "%select{incomplete |array |function |reference |atomic |qualified |}0type "
5391   "%1 %select{||||||which is not trivially copyable}0">;
5392
5393 // Expressions.
5394 def ext_sizeof_alignof_function_type : Extension<
5395   "invalid application of '%select{sizeof|alignof|vec_step}0' to a "
5396   "function type">, InGroup<PointerArith>;
5397 def ext_sizeof_alignof_void_type : Extension<
5398   "invalid application of '%select{sizeof|alignof|vec_step}0' to a void "
5399   "type">, InGroup<PointerArith>;
5400 def err_opencl_sizeof_alignof_type : Error<
5401   "invalid application of '%select{sizeof|alignof|vec_step|__builtin_omp_required_simd_align}0' to a void type">;
5402 def err_sizeof_alignof_incomplete_type : Error<
5403   "invalid application of '%select{sizeof|alignof|vec_step|__builtin_omp_required_simd_align}0' to an "
5404   "incomplete type %1">;
5405 def err_sizeof_alignof_function_type : Error<
5406   "invalid application of '%select{sizeof|alignof|vec_step|__builtin_omp_required_simd_align}0' to a "
5407   "function type">;
5408 def err_openmp_default_simd_align_expr : Error<
5409   "invalid application of '__builtin_omp_required_simd_align' to an expression, only type is allowed">;
5410 def err_sizeof_alignof_typeof_bitfield : Error<
5411   "invalid application of '%select{sizeof|alignof|typeof}0' to bit-field">;
5412 def err_alignof_member_of_incomplete_type : Error<
5413   "invalid application of 'alignof' to a field of a class still being defined">;
5414 def err_vecstep_non_scalar_vector_type : Error<
5415   "'vec_step' requires built-in scalar or vector type, %0 invalid">;
5416 def err_offsetof_incomplete_type : Error<
5417   "offsetof of incomplete type %0">;
5418 def err_offsetof_record_type : Error<
5419   "offsetof requires struct, union, or class type, %0 invalid">;
5420 def err_offsetof_array_type : Error<"offsetof requires array type, %0 invalid">;
5421 def ext_offsetof_extended_field_designator : Extension<
5422   "using extended field designator is an extension">,
5423   InGroup<DiagGroup<"extended-offsetof">>;
5424 def ext_offsetof_non_pod_type : ExtWarn<"offset of on non-POD type %0">,
5425   InGroup<InvalidOffsetof>;
5426 def ext_offsetof_non_standardlayout_type : ExtWarn<
5427   "offset of on non-standard-layout type %0">, InGroup<InvalidOffsetof>;
5428 def err_offsetof_bitfield : Error<"cannot compute offset of bit-field %0">;
5429 def err_offsetof_field_of_virtual_base : Error<
5430   "invalid application of 'offsetof' to a field of a virtual base">;
5431 def warn_sub_ptr_zero_size_types : Warning<
5432   "subtraction of pointers to type %0 of zero size has undefined behavior">,
5433   InGroup<PointerArith>;
5434
5435 def warn_floatingpoint_eq : Warning<
5436   "comparing floating point with == or != is unsafe">,
5437   InGroup<DiagGroup<"float-equal">>, DefaultIgnore;
5438
5439 def warn_remainder_division_by_zero : Warning<
5440   "%select{remainder|division}0 by zero is undefined">,
5441   InGroup<DivZero>;
5442 def warn_shift_lhs_negative : Warning<"shifting a negative signed value is undefined">,
5443   InGroup<DiagGroup<"shift-negative-value">>;
5444 def warn_shift_negative : Warning<"shift count is negative">,
5445   InGroup<DiagGroup<"shift-count-negative">>;
5446 def warn_shift_gt_typewidth : Warning<"shift count >= width of type">,
5447   InGroup<DiagGroup<"shift-count-overflow">>;
5448 def warn_shift_result_gt_typewidth : Warning<
5449   "signed shift result (%0) requires %1 bits to represent, but %2 only has "
5450   "%3 bits">, InGroup<DiagGroup<"shift-overflow">>;
5451 def warn_shift_result_sets_sign_bit : Warning<
5452   "signed shift result (%0) sets the sign bit of the shift expression's "
5453   "type (%1) and becomes negative">,
5454   InGroup<DiagGroup<"shift-sign-overflow">>, DefaultIgnore;
5455
5456 def warn_precedence_bitwise_rel : Warning<
5457   "%0 has lower precedence than %1; %1 will be evaluated first">,
5458   InGroup<Parentheses>;
5459 def note_precedence_bitwise_first : Note<
5460   "place parentheses around the %0 expression to evaluate it first">;
5461 def note_precedence_silence : Note<
5462   "place parentheses around the '%0' expression to silence this warning">;
5463
5464 def warn_precedence_conditional : Warning<
5465   "operator '?:' has lower precedence than '%0'; '%0' will be evaluated first">,
5466   InGroup<Parentheses>;
5467 def note_precedence_conditional_first : Note<
5468   "place parentheses around the '?:' expression to evaluate it first">;
5469
5470 def warn_logical_instead_of_bitwise : Warning<
5471   "use of logical '%0' with constant operand">,
5472   InGroup<DiagGroup<"constant-logical-operand">>;
5473 def note_logical_instead_of_bitwise_change_operator : Note<
5474   "use '%0' for a bitwise operation">;
5475 def note_logical_instead_of_bitwise_remove_constant : Note<
5476   "remove constant to silence this warning">;
5477
5478 def warn_bitwise_op_in_bitwise_op : Warning<
5479   "'%0' within '%1'">, InGroup<BitwiseOpParentheses>;
5480
5481 def warn_logical_and_in_logical_or : Warning<
5482   "'&&' within '||'">, InGroup<LogicalOpParentheses>;
5483
5484 def warn_overloaded_shift_in_comparison :Warning<
5485   "overloaded operator %select{>>|<<}0 has higher precedence than "
5486   "comparison operator">,
5487   InGroup<OverloadedShiftOpParentheses>;
5488 def note_evaluate_comparison_first :Note<
5489   "place parentheses around comparison expression to evaluate it first">;
5490
5491 def warn_addition_in_bitshift : Warning<
5492   "operator '%0' has lower precedence than '%1'; "
5493   "'%1' will be evaluated first">, InGroup<ShiftOpParentheses>;
5494
5495 def warn_self_assignment : Warning<
5496   "explicitly assigning value of variable of type %0 to itself">,
5497   InGroup<SelfAssignment>, DefaultIgnore;
5498 def warn_self_move : Warning<
5499   "explicitly moving variable of type %0 to itself">,
5500   InGroup<SelfMove>, DefaultIgnore;
5501
5502 def warn_redundant_move_on_return : Warning<
5503   "redundant move in return statement">,
5504   InGroup<RedundantMove>, DefaultIgnore;
5505 def warn_pessimizing_move_on_return : Warning<
5506   "moving a local object in a return statement prevents copy elision">,
5507   InGroup<PessimizingMove>, DefaultIgnore;
5508 def warn_pessimizing_move_on_initialization : Warning<
5509   "moving a temporary object prevents copy elision">,
5510   InGroup<PessimizingMove>, DefaultIgnore;
5511 def note_remove_move : Note<"remove std::move call here">;
5512
5513 def warn_string_plus_int : Warning<
5514   "adding %0 to a string does not append to the string">,
5515   InGroup<StringPlusInt>;
5516 def warn_string_plus_char : Warning<
5517   "adding %0 to a string pointer does not append to the string">,
5518   InGroup<StringPlusChar>;
5519 def note_string_plus_scalar_silence : Note<
5520   "use array indexing to silence this warning">;
5521
5522 def warn_sizeof_array_param : Warning<
5523   "sizeof on array function parameter will return size of %0 instead of %1">,
5524   InGroup<SizeofArrayArgument>;
5525
5526 def warn_sizeof_array_decay : Warning<
5527   "sizeof on pointer operation will return size of %0 instead of %1">,
5528   InGroup<SizeofArrayDecay>;
5529
5530 def err_sizeof_nonfragile_interface : Error<
5531   "application of '%select{alignof|sizeof}1' to interface %0 is "
5532   "not supported on this architecture and platform">;
5533 def err_atdef_nonfragile_interface : Error<
5534   "use of @defs is not supported on this architecture and platform">;
5535 def err_subscript_nonfragile_interface : Error<
5536   "subscript requires size of interface %0, which is not constant for "
5537   "this architecture and platform">;
5538
5539 def err_arithmetic_nonfragile_interface : Error<
5540   "arithmetic on pointer to interface %0, which is not a constant size for "
5541   "this architecture and platform">;
5542
5543
5544 def ext_subscript_non_lvalue : Extension<
5545   "ISO C90 does not allow subscripting non-lvalue array">;
5546 def err_typecheck_subscript_value : Error<
5547   "subscripted value is not an array, pointer, or vector">;
5548 def err_typecheck_subscript_not_integer : Error<
5549   "array subscript is not an integer">;
5550 def err_subscript_function_type : Error<
5551   "subscript of pointer to function type %0">;
5552 def err_subscript_incomplete_type : Error<
5553   "subscript of pointer to incomplete type %0">;
5554 def err_dereference_incomplete_type : Error<
5555   "dereference of pointer to incomplete type %0">;
5556 def ext_gnu_subscript_void_type : Extension<
5557   "subscript of a pointer to void is a GNU extension">, InGroup<PointerArith>;
5558 def err_typecheck_member_reference_struct_union : Error<
5559   "member reference base type %0 is not a structure or union">;
5560 def err_typecheck_member_reference_ivar : Error<
5561   "%0 does not have a member named %1">;
5562 def err_arc_weak_ivar_access : Error<
5563   "dereferencing a __weak pointer is not allowed due to possible "
5564   "null value caused by race condition, assign it to strong variable first">;
5565 def err_typecheck_member_reference_arrow : Error<
5566   "member reference type %0 is not a pointer">;
5567 def err_typecheck_member_reference_suggestion : Error<
5568   "member reference type %0 is %select{a|not a}1 pointer; did you mean to use '%select{->|.}1'?">;
5569 def note_typecheck_member_reference_suggestion : Note<
5570   "did you mean to use '.' instead?">;
5571 def note_member_reference_arrow_from_operator_arrow : Note<
5572   "'->' applied to return value of the operator->() declared here">;
5573 def err_typecheck_member_reference_type : Error<
5574   "cannot refer to type member %0 in %1 with '%select{.|->}2'">;
5575 def err_typecheck_member_reference_unknown : Error<
5576   "cannot refer to member %0 in %1 with '%select{.|->}2'">;
5577 def err_member_reference_needs_call : Error<
5578   "base of member reference is a function; perhaps you meant to call "
5579   "it%select{| with no arguments}0?">;
5580 def warn_subscript_is_char : Warning<"array subscript is of type 'char'">,
5581   InGroup<CharSubscript>, DefaultIgnore;
5582
5583 def err_typecheck_incomplete_tag : Error<"incomplete definition of type %0">;
5584 def err_no_member : Error<"no member named %0 in %1">;
5585 def err_no_member_overloaded_arrow : Error<
5586   "no member named %0 in %1; did you mean to use '->' instead of '.'?">;
5587
5588 def err_member_not_yet_instantiated : Error<
5589   "no member %0 in %1; it has not yet been instantiated">;
5590 def note_non_instantiated_member_here : Note<
5591   "not-yet-instantiated member is declared here">;
5592
5593 def err_enumerator_does_not_exist : Error<
5594   "enumerator %0 does not exist in instantiation of %1">;
5595 def note_enum_specialized_here : Note<
5596   "enum %0 was explicitly specialized here">;
5597
5598 def err_member_redeclared : Error<"class member cannot be redeclared">;
5599 def ext_member_redeclared : ExtWarn<"class member cannot be redeclared">,
5600   InGroup<RedeclaredClassMember>;
5601 def err_member_redeclared_in_instantiation : Error<
5602   "multiple overloads of %0 instantiate to the same signature %1">;
5603 def err_member_name_of_class : Error<"member %0 has the same name as its class">;
5604 def err_member_def_undefined_record : Error<
5605   "out-of-line definition of %0 from class %1 without definition">;
5606 def err_member_decl_does_not_match : Error<
5607   "out-of-line %select{declaration|definition}2 of %0 "
5608   "does not match any declaration in %1">;
5609 def err_friend_decl_with_def_arg_must_be_def : Error<
5610   "friend declaration specifying a default argument must be a definition">;
5611 def err_friend_decl_with_def_arg_redeclared : Error<
5612   "friend declaration specifying a default argument must be the only declaration">;
5613 def err_friend_decl_does_not_match : Error<
5614   "friend declaration of %0 does not match any declaration in %1">;
5615 def err_member_decl_does_not_match_suggest : Error<
5616   "out-of-line %select{declaration|definition}2 of %0 "
5617   "does not match any declaration in %1; did you mean %3?">;
5618 def err_member_def_does_not_match_ret_type : Error<
5619   "return type of out-of-line definition of %q0 differs from "
5620   "that in the declaration">;
5621 def err_nonstatic_member_out_of_line : Error<
5622   "non-static data member defined out-of-line">;
5623 def err_qualified_typedef_declarator : Error<
5624   "typedef declarator cannot be qualified">;
5625 def err_qualified_param_declarator : Error<
5626   "parameter declarator cannot be qualified">;
5627 def ext_out_of_line_declaration : ExtWarn<
5628   "out-of-line declaration of a member must be a definition">,
5629   InGroup<OutOfLineDeclaration>, DefaultError;
5630 def err_member_extra_qualification : Error<
5631   "extra qualification on member %0">;
5632 def warn_member_extra_qualification : Warning<
5633   err_member_extra_qualification.Text>, InGroup<MicrosoftExtraQualification>;
5634 def warn_namespace_member_extra_qualification : Warning<
5635   "extra qualification on member %0">,
5636   InGroup<DiagGroup<"extra-qualification">>;
5637 def err_member_qualification : Error<
5638   "non-friend class member %0 cannot have a qualified name">;  
5639 def note_member_def_close_match : Note<"member declaration nearly matches">;
5640 def note_member_def_close_const_match : Note<
5641   "member declaration does not match because "
5642   "it %select{is|is not}0 const qualified">;
5643 def note_member_def_close_param_match : Note<
5644   "type of %ordinal0 parameter of member declaration does not match definition"
5645   "%diff{ ($ vs $)|}1,2">;
5646 def note_local_decl_close_match : Note<"local declaration nearly matches">;
5647 def note_local_decl_close_param_match : Note<
5648   "type of %ordinal0 parameter of local declaration does not match definition"
5649   "%diff{ ($ vs $)|}1,2">;
5650 def err_typecheck_ivar_variable_size : Error<
5651   "instance variables must have a constant size">;
5652 def err_ivar_reference_type : Error<
5653   "instance variables cannot be of reference type">;
5654 def err_typecheck_illegal_increment_decrement : Error<
5655   "cannot %select{decrement|increment}1 value of type %0">;
5656 def err_typecheck_expect_int : Error<
5657   "used type %0 where integer is required">;
5658 def err_typecheck_arithmetic_incomplete_type : Error<
5659   "arithmetic on a pointer to an incomplete type %0">;
5660 def err_typecheck_pointer_arith_function_type : Error<
5661   "arithmetic on%select{ a|}0 pointer%select{|s}0 to%select{ the|}2 "
5662   "function type%select{|s}2 %1%select{| and %3}2">;
5663 def err_typecheck_pointer_arith_void_type : Error<
5664   "arithmetic on%select{ a|}0 pointer%select{|s}0 to void">;
5665 def err_typecheck_decl_incomplete_type : Error<
5666   "variable has incomplete type %0">;
5667 def ext_typecheck_decl_incomplete_type : ExtWarn<
5668   "tentative definition of variable with internal linkage has incomplete non-array type %0">,
5669   InGroup<DiagGroup<"tentative-definition-incomplete-type">>;
5670 def err_tentative_def_incomplete_type : Error<
5671   "tentative definition has type %0 that is never completed">;
5672 def warn_tentative_incomplete_array : Warning<
5673   "tentative array definition assumed to have one element">;
5674 def err_typecheck_incomplete_array_needs_initializer : Error<
5675   "definition of variable with array type needs an explicit size "
5676   "or an initializer">;
5677 def err_array_init_not_init_list : Error<
5678   "array initializer must be an initializer "
5679   "list%select{| or string literal| or wide string literal}0">;
5680 def err_array_init_narrow_string_into_wchar : Error<
5681   "initializing wide char array with non-wide string literal">;
5682 def err_array_init_wide_string_into_char : Error<
5683   "initializing char array with wide string literal">;
5684 def err_array_init_incompat_wide_string_into_wchar : Error<
5685   "initializing wide char array with incompatible wide string literal">;
5686 def err_array_init_different_type : Error<
5687   "cannot initialize array %diff{of type $ with array of type $|"
5688   "with different type of array}0,1">;
5689 def err_array_init_non_constant_array : Error<
5690   "cannot initialize array %diff{of type $ with non-constant array of type $|"
5691   "with different type of array}0,1">;
5692 def ext_array_init_copy : Extension<
5693   "initialization of an array "
5694   "%diff{of type $ from a compound literal of type $|"
5695   "from a compound literal}0,1 is a GNU extension">, InGroup<GNUCompoundLiteralInitializer>;
5696 // This is intentionally not disabled by -Wno-gnu.
5697 def ext_array_init_parens : ExtWarn<
5698   "parenthesized initialization of a member array is a GNU extension">,
5699   InGroup<DiagGroup<"gnu-array-member-paren-init">>, DefaultError;
5700 def warn_deprecated_string_literal_conversion : Warning<
5701   "conversion from string literal to %0 is deprecated">,
5702   InGroup<CXX11CompatDeprecatedWritableStr>;
5703 def ext_deprecated_string_literal_conversion : ExtWarn<
5704   "ISO C++11 does not allow conversion from string literal to %0">,
5705   InGroup<WritableStrings>, SFINAEFailure;
5706 def err_realimag_invalid_type : Error<"invalid type %0 to %1 operator">;
5707 def err_typecheck_sclass_fscope : Error<
5708   "illegal storage class on file-scoped variable">;
5709 def warn_standalone_specifier : Warning<"'%0' ignored on this declaration">,
5710   InGroup<MissingDeclarations>;
5711 def ext_standalone_specifier : ExtWarn<"'%0' is not permitted on a declaration "
5712   "of a type">, InGroup<MissingDeclarations>;
5713 def err_standalone_class_nested_name_specifier : Error<
5714   "forward declaration of %select{class|struct|interface|union|enum}0 cannot "
5715   "have a nested name specifier">;
5716 def err_typecheck_sclass_func : Error<"illegal storage class on function">;
5717 def err_static_block_func : Error<
5718   "function declared in block scope cannot have 'static' storage class">;
5719 def err_typecheck_address_of : Error<"address of %select{bit-field"
5720   "|vector element|property expression|register variable}0 requested">;
5721 def ext_typecheck_addrof_void : Extension<
5722   "ISO C forbids taking the address of an expression of type 'void'">;
5723 def err_unqualified_pointer_member_function : Error<
5724   "must explicitly qualify name of member function when taking its address">;
5725 def err_invalid_form_pointer_member_function : Error<
5726   "cannot create a non-constant pointer to member function">;
5727 def err_address_of_function_with_pass_object_size_params: Error<
5728   "cannot take address of function %0 because parameter %1 has "
5729   "pass_object_size attribute">;
5730 def err_parens_pointer_member_function : Error<
5731   "cannot parenthesize the name of a method when forming a member pointer">;
5732 def err_typecheck_invalid_lvalue_addrof_addrof_function : Error<
5733   "extra '&' taking address of overloaded function">;
5734 def err_typecheck_invalid_lvalue_addrof : Error<
5735   "cannot take the address of an rvalue of type %0">;
5736 def ext_typecheck_addrof_temporary : ExtWarn<
5737   "taking the address of a temporary object of type %0">, 
5738   InGroup<AddressOfTemporary>, DefaultError;
5739 def err_typecheck_addrof_temporary : Error<
5740   "taking the address of a temporary object of type %0">;
5741 def err_typecheck_addrof_dtor : Error<
5742   "taking the address of a destructor">;
5743 def err_typecheck_unary_expr : Error<
5744   "invalid argument type %0 to unary expression">;
5745 def err_typecheck_indirection_requires_pointer : Error<
5746   "indirection requires pointer operand (%0 invalid)">;
5747 def ext_typecheck_indirection_through_void_pointer : ExtWarn<
5748   "ISO C++ does not allow indirection on operand of type %0">,
5749   InGroup<DiagGroup<"void-ptr-dereference">>;
5750 def warn_indirection_through_null : Warning<
5751   "indirection of non-volatile null pointer will be deleted, not trap">,
5752   InGroup<NullDereference>;
5753 def warn_binding_null_to_reference : Warning<
5754   "binding dereferenced null pointer to reference has undefined behavior">,
5755   InGroup<NullDereference>;
5756 def note_indirection_through_null : Note<
5757   "consider using __builtin_trap() or qualifying pointer with 'volatile'">;
5758 def warn_pointer_indirection_from_incompatible_type : Warning<
5759   "dereference of type %1 that was reinterpret_cast from type %0 has undefined "
5760   "behavior">,
5761   InGroup<UndefinedReinterpretCast>, DefaultIgnore;
5762 def warn_taking_address_of_packed_member : Warning<
5763   "taking address of packed member %0 of class or structure %q1 may result in an unaligned pointer value">,
5764   InGroup<DiagGroup<"address-of-packed-member">>;
5765
5766 def err_objc_object_assignment : Error<
5767   "cannot assign to class object (%0 invalid)">;
5768 def err_typecheck_invalid_operands : Error<
5769   "invalid operands to binary expression (%0 and %1)">;
5770 def err_typecheck_sub_ptr_compatible : Error<
5771   "%diff{$ and $ are not pointers to compatible types|"
5772   "pointers to incompatible types}0,1">;
5773 def ext_typecheck_ordered_comparison_of_pointer_integer : ExtWarn<
5774   "ordered comparison between pointer and integer (%0 and %1)">;
5775 def ext_typecheck_ordered_comparison_of_pointer_and_zero : Extension<
5776   "ordered comparison between pointer and zero (%0 and %1) is an extension">;
5777 def err_typecheck_ordered_comparison_of_pointer_and_zero : Error<
5778   "ordered comparison between pointer and zero (%0 and %1)">;
5779 def ext_typecheck_ordered_comparison_of_function_pointers : ExtWarn<
5780   "ordered comparison of function pointers (%0 and %1)">;
5781 def ext_typecheck_comparison_of_fptr_to_void : Extension<
5782   "equality comparison between function pointer and void pointer (%0 and %1)">;
5783 def err_typecheck_comparison_of_fptr_to_void : Error<
5784   "equality comparison between function pointer and void pointer (%0 and %1)">;
5785 def ext_typecheck_comparison_of_pointer_integer : ExtWarn<
5786   "comparison between pointer and integer (%0 and %1)">;
5787 def err_typecheck_comparison_of_pointer_integer : Error<
5788   "comparison between pointer and integer (%0 and %1)">;
5789 def ext_typecheck_comparison_of_distinct_pointers : ExtWarn<
5790   "comparison of distinct pointer types%diff{ ($ and $)|}0,1">,
5791   InGroup<CompareDistinctPointerType>;
5792 def ext_typecheck_cond_incompatible_operands : ExtWarn<
5793   "incompatible operand types (%0 and %1)">;
5794 def err_cond_voidptr_arc : Error <
5795   "operands to conditional of types%diff{ $ and $|}0,1 are incompatible "
5796   "in ARC mode">;
5797 def err_typecheck_comparison_of_distinct_pointers : Error<
5798   "comparison of distinct pointer types%diff{ ($ and $)|}0,1">;
5799 def err_typecheck_op_on_nonoverlapping_address_space_pointers : Error<
5800   "%select{comparison between %diff{ ($ and $)|}0,1"
5801   "|arithmetic operation with operands of type %diff{ ($ and $)|}0,1"
5802   "|conditional operator with the second and third operands of type "
5803   "%diff{ ($ and $)|}0,1}2"
5804   " which are pointers to non-overlapping address spaces">;
5805
5806 def err_typecheck_assign_const : Error<
5807   "%select{"
5808   "cannot assign to return value because function %1 returns a const value|"
5809   "cannot assign to variable %1 with const-qualified type %2|"
5810   "cannot assign to %select{non-|}1static data member %2 "
5811   "with const-qualified type %3|"
5812   "cannot assign to non-static data member within const member function %1|"
5813   "read-only variable is not assignable}0">;
5814
5815 def note_typecheck_assign_const : Note<
5816   "%select{"
5817   "function %1 which returns const-qualified type %2 declared here|"
5818   "variable %1 declared const here|"
5819   "%select{non-|}1static data member %2 declared const here|"
5820   "member function %q1 is declared const here}0">;
5821
5822 def warn_mixed_sign_comparison : Warning<
5823   "comparison of integers of different signs: %0 and %1">,
5824   InGroup<SignCompare>, DefaultIgnore;
5825 def warn_lunsigned_always_true_comparison : Warning<
5826   "comparison of unsigned%select{| enum}2 expression %0 is always %1">,
5827   InGroup<TautologicalCompare>;
5828 def warn_out_of_range_compare : Warning<
5829   "comparison of %select{constant %0|true|false}1 with " 
5830   "%select{expression of type %2|boolean expression}3 is always "
5831   "%select{false|true}4">, InGroup<TautologicalOutOfRangeCompare>;
5832 def warn_runsigned_always_true_comparison : Warning<
5833   "comparison of %0 unsigned%select{| enum}2 expression is always %1">,
5834   InGroup<TautologicalCompare>;
5835 def warn_comparison_of_mixed_enum_types : Warning<
5836   "comparison of two values with different enumeration types"
5837   "%diff{ ($ and $)|}0,1">,
5838   InGroup<DiagGroup<"enum-compare">>;
5839 def warn_null_in_arithmetic_operation : Warning<
5840   "use of NULL in arithmetic operation">,
5841   InGroup<NullArithmetic>;
5842 def warn_null_in_comparison_operation : Warning<
5843   "comparison between NULL and non-pointer "
5844   "%select{(%1 and NULL)|(NULL and %1)}0">,
5845   InGroup<NullArithmetic>;
5846 def err_shift_rhs_only_vector : Error<
5847   "requested shift is a vector of type %0 but the first operand is not a "
5848   "vector (%1)">;
5849
5850 def warn_logical_not_on_lhs_of_check : Warning<
5851   "logical not is only applied to the left hand side of this "
5852   "%select{comparison|bitwise operator}0">,
5853   InGroup<LogicalNotParentheses>;
5854 def note_logical_not_fix : Note<
5855   "add parentheses after the '!' to evaluate the "
5856   "%select{comparison|bitwise operator}0 first">;
5857 def note_logical_not_silence_with_parens : Note<
5858   "add parentheses around left hand side expression to silence this warning">;
5859
5860 def err_invalid_this_use : Error<
5861   "invalid use of 'this' outside of a non-static member function">;
5862 def err_this_static_member_func : Error<
5863   "'this' cannot be%select{| implicitly}0 used in a static member function "
5864   "declaration">;
5865 def err_invalid_member_use_in_static_method : Error<
5866   "invalid use of member %0 in static member function">;
5867 def err_invalid_qualified_function_type : Error<
5868   "%select{non-member function|static member function|deduction guide}0 "
5869   "%select{of type %2 |}1cannot have '%3' qualifier">;
5870 def err_compound_qualified_function_type : Error<
5871   "%select{block pointer|pointer|reference}0 to function type %select{%2 |}1"
5872   "cannot have '%3' qualifier">;
5873
5874 def err_ref_qualifier_overload : Error<
5875   "cannot overload a member function %select{without a ref-qualifier|with "
5876   "ref-qualifier '&'|with ref-qualifier '&&'}0 with a member function %select{"
5877   "without a ref-qualifier|with ref-qualifier '&'|with ref-qualifier '&&'}1">;
5878
5879 def err_invalid_non_static_member_use : Error<
5880   "invalid use of non-static data member %0">;
5881 def err_nested_non_static_member_use : Error<
5882   "%select{call to non-static member function|use of non-static data member}0 "
5883   "%2 of %1 from nested type %3">;
5884 def warn_cxx98_compat_non_static_member_use : Warning<
5885   "use of non-static data member %0 in an unevaluated context is "
5886   "incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
5887 def err_invalid_incomplete_type_use : Error<
5888   "invalid use of incomplete type %0">;
5889 def err_builtin_func_cast_more_than_one_arg : Error<
5890   "function-style cast to a builtin type can only take one argument">;
5891 def err_value_init_for_array_type : Error<
5892   "array types cannot be value-initialized">;
5893 def err_init_for_function_type : Error<
5894   "cannot create object of function type %0">;
5895 def warn_format_nonliteral_noargs : Warning<
5896   "format string is not a string literal (potentially insecure)">,
5897   InGroup<FormatSecurity>;
5898 def warn_format_nonliteral : Warning<
5899   "format string is not a string literal">,
5900   InGroup<FormatNonLiteral>, DefaultIgnore;
5901
5902 def err_unexpected_interface : Error<
5903   "unexpected interface name %0: expected expression">;
5904 def err_ref_non_value : Error<"%0 does not refer to a value">;
5905 def err_ref_vm_type : Error<
5906   "cannot refer to declaration with a variably modified type inside block">;
5907 def err_ref_flexarray_type : Error<
5908   "cannot refer to declaration of structure variable with flexible array member "
5909   "inside block">;
5910 def err_ref_array_type : Error<
5911   "cannot refer to declaration with an array type inside block">;
5912 def err_property_not_found : Error<
5913   "property %0 not found on object of type %1">;
5914 def err_invalid_property_name : Error<
5915   "%0 is not a valid property name (accessing an object of type %1)">;
5916 def err_getter_not_found : Error<
5917   "no getter method for read from property">;
5918 def err_objc_subscript_method_not_found : Error<
5919   "expected method to %select{read|write}1 %select{dictionary|array}2 element not "
5920   "found on object of type %0">;
5921 def err_objc_subscript_index_type : Error<
5922   "method index parameter type %0 is not integral type">;
5923 def err_objc_subscript_key_type : Error<
5924   "method key parameter type %0 is not object type">;
5925 def err_objc_subscript_dic_object_type : Error<
5926   "method object parameter type %0 is not object type">;
5927 def err_objc_subscript_object_type : Error<
5928   "cannot assign to this %select{dictionary|array}1 because assigning method's "
5929   "2nd parameter of type %0 is not an Objective-C pointer type">;
5930 def err_objc_subscript_base_type : Error<
5931   "%select{dictionary|array}1 subscript base type %0 is not an Objective-C object">;
5932 def err_objc_multiple_subscript_type_conversion : Error<
5933   "indexing expression is invalid because subscript type %0 has "
5934   "multiple type conversion functions">;
5935 def err_objc_subscript_type_conversion : Error<
5936   "indexing expression is invalid because subscript type %0 is not an integral"
5937   " or Objective-C pointer type">;
5938 def err_objc_subscript_pointer : Error<
5939   "indexing expression is invalid because subscript type %0 is not an"
5940   " Objective-C pointer">;
5941 def err_objc_indexing_method_result_type : Error<
5942   "method for accessing %select{dictionary|array}1 element must have Objective-C"
5943   " object return type instead of %0">;
5944 def err_objc_index_incomplete_class_type : Error<
5945   "Objective-C index expression has incomplete class type %0">;
5946 def err_illegal_container_subscripting_op : Error<
5947   "illegal operation on Objective-C container subscripting">;
5948 def err_property_not_found_forward_class : Error<
5949   "property %0 cannot be found in forward class object %1">;
5950 def err_property_not_as_forward_class : Error<
5951   "property %0 refers to an incomplete Objective-C class %1 "
5952   "(with no @interface available)">;
5953 def note_forward_class : Note<
5954   "forward declaration of class here">;
5955 def err_duplicate_property : Error<
5956   "property has a previous declaration">;
5957 def ext_gnu_void_ptr : Extension<
5958   "arithmetic on%select{ a|}0 pointer%select{|s}0 to void is a GNU extension">,
5959   InGroup<PointerArith>;
5960 def ext_gnu_ptr_func_arith : Extension<
5961   "arithmetic on%select{ a|}0 pointer%select{|s}0 to%select{ the|}2 function "
5962   "type%select{|s}2 %1%select{| and %3}2 is a GNU extension">,
5963   InGroup<PointerArith>;
5964 def err_readonly_message_assignment : Error<
5965   "assigning to 'readonly' return result of an Objective-C message not allowed">;
5966 def ext_integer_increment_complex : Extension<
5967   "ISO C does not support '++'/'--' on complex integer type %0">;
5968 def ext_integer_complement_complex : Extension<
5969   "ISO C does not support '~' for complex conjugation of %0">;
5970 def err_nosetter_property_assignment : Error<
5971   "%select{assignment to readonly property|"
5972   "no setter method %1 for assignment to property}0">;
5973 def err_nosetter_property_incdec : Error<
5974   "%select{%select{increment|decrement}1 of readonly property|"
5975   "no setter method %2 for %select{increment|decrement}1 of property}0">;
5976 def err_nogetter_property_compound_assignment : Error<
5977   "a getter method is needed to perform a compound assignment on a property">;
5978 def err_nogetter_property_incdec : Error<
5979   "no getter method %1 for %select{increment|decrement}0 of property">;
5980 def err_no_subobject_property_setting : Error<
5981   "expression is not assignable">;
5982 def err_qualified_objc_access : Error<
5983   "%select{property|instance variable}0 access cannot be qualified with '%1'">;
5984   
5985 def ext_freestanding_complex : Extension<
5986   "complex numbers are an extension in a freestanding C99 implementation">;
5987
5988 // FIXME: Remove when we support imaginary.
5989 def err_imaginary_not_supported : Error<"imaginary types are not supported">;
5990
5991 // Obj-c expressions
5992 def warn_root_inst_method_not_found : Warning<
5993   "instance method %0 is being used on 'Class' which is not in the root class">,
5994   InGroup<MethodAccess>;
5995 def warn_class_method_not_found : Warning<
5996   "class method %objcclass0 not found (return type defaults to 'id')">,
5997   InGroup<MethodAccess>;
5998 def warn_instance_method_on_class_found : Warning<
5999   "instance method %0 found instead of class method %1">,
6000   InGroup<MethodAccess>;
6001 def warn_inst_method_not_found : Warning<
6002   "instance method %objcinstance0 not found (return type defaults to 'id')">,
6003   InGroup<MethodAccess>;
6004 def warn_instance_method_not_found_with_typo : Warning<
6005   "instance method %objcinstance0 not found (return type defaults to 'id')"
6006   "; did you mean %objcinstance2?">, InGroup<MethodAccess>;
6007 def warn_class_method_not_found_with_typo : Warning<
6008   "class method %objcclass0 not found (return type defaults to 'id')"
6009   "; did you mean %objcclass2?">, InGroup<MethodAccess>;
6010 def err_method_not_found_with_typo : Error<
6011   "%select{instance|class}1 method %0 not found "
6012   "; did you mean %2?">;
6013 def err_no_super_class_message : Error<
6014   "no @interface declaration found in class messaging of %0">;
6015 def err_root_class_cannot_use_super : Error<
6016   "%0 cannot use 'super' because it is a root class">;
6017 def err_invalid_receiver_to_message_super : Error<
6018   "'super' is only valid in a method body">;
6019 def err_invalid_receiver_class_message : Error<
6020   "receiver type %0 is not an Objective-C class">;
6021 def err_missing_open_square_message_send : Error<
6022   "missing '[' at start of message send expression">;
6023 def warn_bad_receiver_type : Warning<
6024   "receiver type %0 is not 'id' or interface pointer, consider "
6025   "casting it to 'id'">,InGroup<ObjCReceiver>;
6026 def err_bad_receiver_type : Error<"bad receiver type %0">;
6027 def err_incomplete_receiver_type : Error<"incomplete receiver type %0">;
6028 def err_unknown_receiver_suggest : Error<
6029   "unknown receiver %0; did you mean %1?">;
6030 def err_objc_throw_expects_object : Error<
6031   "@throw requires an Objective-C object type (%0 invalid)">;
6032 def err_objc_synchronized_expects_object : Error<
6033   "@synchronized requires an Objective-C object type (%0 invalid)">;
6034 def err_rethrow_used_outside_catch : Error<
6035   "@throw (rethrow) used outside of a @catch block">;
6036 def err_attribute_multiple_objc_gc : Error<
6037   "multiple garbage collection attributes specified for type">;
6038 def err_catch_param_not_objc_type : Error<
6039   "@catch parameter is not a pointer to an interface type">;
6040 def err_illegal_qualifiers_on_catch_parm : Error<
6041   "illegal qualifiers on @catch parameter">;
6042 def err_storage_spec_on_catch_parm : Error<
6043   "@catch parameter cannot have storage specifier '%0'">;
6044 def warn_register_objc_catch_parm : Warning<
6045   "'register' storage specifier on @catch parameter will be ignored">;
6046 def err_qualified_objc_catch_parm : Error<
6047   "@catch parameter declarator cannot be qualified">;
6048 def warn_objc_pointer_cxx_catch_fragile : Warning<
6049   "cannot catch an exception thrown with @throw in C++ in the non-unified "
6050   "exception model">, InGroup<ObjCNonUnifiedException>;
6051 def err_objc_object_catch : Error<
6052   "cannot catch an Objective-C object by value">;
6053 def err_incomplete_type_objc_at_encode : Error<
6054   "'@encode' of incomplete type %0">;
6055 def warn_objc_circular_container : Warning<
6056   "adding '%0' to '%1' might cause circular dependency in container">,
6057   InGroup<DiagGroup<"objc-circular-container">>;
6058 def note_objc_circular_container_declared_here : Note<"'%0' declared here">;
6059 def warn_objc_unsafe_perform_selector : Warning<
6060   "%0 is incompatible with selectors that return a "
6061   "%select{struct|union|vector}1 type">,
6062   InGroup<DiagGroup<"objc-unsafe-perform-selector">>;
6063 def note_objc_unsafe_perform_selector_method_declared_here :  Note<
6064   "method %0 that returns %1 declared here">;
6065
6066 def warn_setter_getter_impl_required : Warning<
6067   "property %0 requires method %1 to be defined - "
6068   "use @synthesize, @dynamic or provide a method implementation "
6069   "in this class implementation">,
6070   InGroup<ObjCPropertyImpl>;
6071 def warn_setter_getter_impl_required_in_category : Warning<
6072   "property %0 requires method %1 to be defined - "
6073   "use @dynamic or provide a method implementation in this category">,
6074   InGroup<ObjCPropertyImpl>;
6075 def note_parameter_named_here : Note<
6076   "passing argument to parameter %0 here">;
6077 def note_parameter_here : Note<
6078   "passing argument to parameter here">;
6079 def note_method_return_type_change : Note<
6080   "compiler has implicitly changed method %0 return type">;
6081
6082 def warn_impl_required_for_class_property : Warning<
6083   "class property %0 requires method %1 to be defined - "
6084   "use @dynamic or provide a method implementation "
6085   "in this class implementation">,
6086   InGroup<ObjCPropertyImpl>;
6087 def warn_impl_required_in_category_for_class_property : Warning<
6088   "class property %0 requires method %1 to be defined - "
6089   "use @dynamic or provide a method implementation in this category">,
6090   InGroup<ObjCPropertyImpl>;
6091
6092 // C++ casts
6093 // These messages adhere to the TryCast pattern: %0 is an int specifying the
6094 // cast type, %1 is the source type, %2 is the destination type.
6095 def err_bad_reinterpret_cast_overload : Error<
6096   "reinterpret_cast cannot resolve overloaded function %0 to type %1">;
6097
6098 def warn_reinterpret_different_from_static : Warning<
6099   "'reinterpret_cast' %select{from|to}3 class %0 %select{to|from}3 its "
6100   "%select{virtual base|base at non-zero offset}2 %1 behaves differently from "
6101   "'static_cast'">, InGroup<ReinterpretBaseClass>;
6102 def note_reinterpret_updowncast_use_static: Note<
6103   "use 'static_cast' to adjust the pointer correctly while "
6104   "%select{upcasting|downcasting}0">;
6105
6106 def err_bad_static_cast_overload : Error<
6107   "address of overloaded function %0 cannot be static_cast to type %1">;
6108
6109 def err_bad_cstyle_cast_overload : Error<
6110   "address of overloaded function %0 cannot be cast to type %1">;
6111
6112
6113 def err_bad_cxx_cast_generic : Error<
6114   "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
6115   "functional-style cast}0 from %1 to %2 is not allowed">;
6116 def err_bad_cxx_cast_unrelated_class : Error<
6117   "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
6118   "functional-style cast}0 from %1 to %2, which are not related by "
6119   "inheritance, is not allowed">;
6120 def note_type_incomplete : Note<"%0 is incomplete">;
6121 def err_bad_cxx_cast_rvalue : Error<
6122   "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
6123   "functional-style cast}0 from rvalue to reference type %2">;
6124 def err_bad_cxx_cast_bitfield : Error<
6125   "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
6126   "functional-style cast}0 from bit-field lvalue to reference type %2">;
6127 def err_bad_cxx_cast_qualifiers_away : Error<
6128   "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
6129   "functional-style cast}0 from %1 to %2 casts away qualifiers">;
6130 def err_bad_const_cast_dest : Error<
6131   "%select{const_cast||||C-style cast|functional-style cast}0 to %2, "
6132   "which is not a reference, pointer-to-object, or pointer-to-data-member">;
6133 def ext_cast_fn_obj : Extension<
6134   "cast between pointer-to-function and pointer-to-object is an extension">;
6135 def ext_ms_cast_fn_obj : ExtWarn<
6136   "static_cast between pointer-to-function and pointer-to-object is a "
6137   "Microsoft extension">, InGroup<MicrosoftCast>;
6138 def warn_cxx98_compat_cast_fn_obj : Warning<
6139   "cast between pointer-to-function and pointer-to-object is incompatible with C++98">,
6140   InGroup<CXX98CompatPedantic>, DefaultIgnore;
6141 def err_bad_reinterpret_cast_small_int : Error<
6142   "cast from pointer to smaller type %2 loses information">;
6143 def err_bad_cxx_cast_vector_to_scalar_different_size : Error<
6144   "%select{||reinterpret_cast||C-style cast|}0 from vector %1 " 
6145   "to scalar %2 of different size">;
6146 def err_bad_cxx_cast_scalar_to_vector_different_size : Error<
6147   "%select{||reinterpret_cast||C-style cast|}0 from scalar %1 " 
6148   "to vector %2 of different size">;
6149 def err_bad_cxx_cast_vector_to_vector_different_size : Error<
6150   "%select{||reinterpret_cast||C-style cast|}0 from vector %1 " 
6151   "to vector %2 of different size">;
6152 def err_bad_lvalue_to_rvalue_cast : Error<
6153   "cannot cast from lvalue of type %1 to rvalue reference type %2; types are "
6154   "not compatible">;
6155 def err_bad_rvalue_to_rvalue_cast : Error<
6156   "cannot cast from rvalue of type %1 to rvalue reference type %2; types are "
6157   "not compatible">;
6158 def err_bad_static_cast_pointer_nonpointer : Error<
6159   "cannot cast from type %1 to pointer type %2">;
6160 def err_bad_static_cast_member_pointer_nonmp : Error<
6161   "cannot cast from type %1 to member pointer type %2">;
6162 def err_bad_cxx_cast_member_pointer_size : Error<
6163   "cannot %select{||reinterpret_cast||C-style cast|}0 from member pointer "
6164   "type %1 to member pointer type %2 of different size">;
6165 def err_bad_reinterpret_cast_reference : Error<
6166   "reinterpret_cast of a %0 to %1 needs its address, which is not allowed">;
6167 def warn_undefined_reinterpret_cast : Warning<
6168   "reinterpret_cast from %0 to %1 has undefined behavior">,
6169   InGroup<UndefinedReinterpretCast>, DefaultIgnore;
6170
6171 // These messages don't adhere to the pattern.
6172 // FIXME: Display the path somehow better.
6173 def err_ambiguous_base_to_derived_cast : Error<
6174   "ambiguous cast from base %0 to derived %1:%2">;
6175 def err_static_downcast_via_virtual : Error<
6176   "cannot cast %0 to %1 via virtual base %2">;
6177 def err_downcast_from_inaccessible_base : Error<
6178   "cannot cast %select{private|protected}2 base class %1 to %0">;
6179 def err_upcast_to_inaccessible_base : Error<
6180   "cannot cast %0 to its %select{private|protected}2 base class %1">;
6181 def err_bad_dynamic_cast_not_ref_or_ptr : Error<
6182   "%0 is not a reference or pointer">;
6183 def err_bad_dynamic_cast_not_class : Error<"%0 is not a class">;
6184 def err_bad_dynamic_cast_incomplete : Error<"%0 is an incomplete type">;
6185 def err_bad_dynamic_cast_not_ptr : Error<"%0 is not a pointer">;
6186 def err_bad_dynamic_cast_not_polymorphic : Error<"%0 is not polymorphic">;
6187
6188 // Other C++ expressions
6189 def err_need_header_before_typeid : Error<
6190   "you need to include <typeinfo> before using the 'typeid' operator">;
6191 def err_need_header_before_ms_uuidof : Error<
6192   "you need to include <guiddef.h> before using the '__uuidof' operator">;
6193 def err_ms___leave_not_in___try : Error<
6194   "'__leave' statement not in __try block">;
6195 def err_uuidof_without_guid : Error<
6196   "cannot call operator __uuidof on a type with no GUID">;
6197 def err_uuidof_with_multiple_guids : Error<
6198   "cannot call operator __uuidof on a type with multiple GUIDs">;
6199 def err_incomplete_typeid : Error<"'typeid' of incomplete type %0">;
6200 def err_variably_modified_typeid : Error<"'typeid' of variably modified type %0">;
6201 def err_static_illegal_in_new : Error<
6202   "the 'static' modifier for the array size is not legal in new expressions">;
6203 def err_array_new_needs_size : Error<
6204   "array size must be specified in new expressions">;
6205 def err_bad_new_type : Error<
6206   "cannot allocate %select{function|reference}1 type %0 with new">;
6207 def err_new_incomplete_type : Error<
6208   "allocation of incomplete type %0">;
6209 def err_new_array_nonconst : Error<
6210   "only the first dimension of an allocated array may have dynamic size">;
6211 def err_new_array_init_args : Error<
6212   "array 'new' cannot have initialization arguments">;
6213 def ext_new_paren_array_nonconst : ExtWarn<
6214   "when type is in parentheses, array cannot have dynamic size">;
6215 def err_placement_new_non_placement_delete : Error<
6216   "'new' expression with placement arguments refers to non-placement "
6217   "'operator delete'">;
6218 def err_array_size_not_integral : Error<
6219   "array size expression must have integral or %select{|unscoped }0"
6220   "enumeration type, not %1">;
6221 def err_array_size_incomplete_type : Error<
6222   "array size expression has incomplete class type %0">;
6223 def err_array_size_explicit_conversion : Error<
6224   "array size expression of type %0 requires explicit conversion to type %1">;
6225 def note_array_size_conversion : Note<
6226   "conversion to %select{integral|enumeration}0 type %1 declared here">;
6227 def err_array_size_ambiguous_conversion : Error<
6228   "ambiguous conversion of array size expression of type %0 to an integral or "
6229   "enumeration type">;
6230 def ext_array_size_conversion : Extension<
6231   "implicit conversion from array size expression of type %0 to "
6232   "%select{integral|enumeration}1 type %2 is a C++11 extension">,
6233   InGroup<CXX11>;
6234 def warn_cxx98_compat_array_size_conversion : Warning<
6235   "implicit conversion from array size expression of type %0 to "
6236   "%select{integral|enumeration}1 type %2 is incompatible with C++98">,
6237   InGroup<CXX98CompatPedantic>, DefaultIgnore;
6238 def err_address_space_qualified_new : Error<
6239   "'new' cannot allocate objects of type %0 in address space '%1'">;
6240 def err_address_space_qualified_delete : Error<
6241   "'delete' cannot delete objects of type %0 in address space '%1'">;
6242
6243 def err_default_init_const : Error<
6244   "default initialization of an object of const type %0"
6245   "%select{| without a user-provided default constructor}1">;
6246 def ext_default_init_const : ExtWarn<
6247   "default initialization of an object of const type %0"
6248   "%select{| without a user-provided default constructor}1 "
6249   "is a Microsoft extension">,
6250   InGroup<MicrosoftConstInit>;
6251 def err_delete_operand : Error<"cannot delete expression of type %0">;
6252 def ext_delete_void_ptr_operand : ExtWarn<
6253   "cannot delete expression with pointer-to-'void' type %0">,
6254   InGroup<DeleteIncomplete>;
6255 def err_ambiguous_delete_operand : Error<
6256   "ambiguous conversion of delete expression of type %0 to a pointer">;
6257 def warn_delete_incomplete : Warning<
6258   "deleting pointer to incomplete type %0 may cause undefined behavior">,
6259   InGroup<DeleteIncomplete>;
6260 def err_delete_incomplete_class_type : Error<
6261   "deleting incomplete class type %0; no conversions to pointer type">;
6262 def err_delete_explicit_conversion : Error<
6263   "converting delete expression from type %0 to type %1 invokes an explicit "
6264   "conversion function">;
6265 def note_delete_conversion : Note<"conversion to pointer type %0">;
6266 def warn_delete_array_type : Warning<
6267   "'delete' applied to a pointer-to-array type %0 treated as 'delete[]'">;
6268 def warn_mismatched_delete_new : Warning<
6269   "'delete%select{|[]}0' applied to a pointer that was allocated with "
6270   "'new%select{[]|}0'; did you mean 'delete%select{[]|}0'?">,
6271   InGroup<DiagGroup<"mismatched-new-delete">>;
6272 def note_allocated_here : Note<"allocated with 'new%select{[]|}0' here">;
6273 def err_no_suitable_delete_member_function_found : Error<
6274   "no suitable member %0 in %1">;
6275 def err_ambiguous_suitable_delete_member_function_found : Error<
6276   "multiple suitable %0 functions in %1">;
6277 def warn_ambiguous_suitable_delete_function_found : Warning<
6278   "multiple suitable %0 functions for %1; no 'operator delete' function "
6279   "will be invoked if initialization throws an exception">,
6280   InGroup<DiagGroup<"ambiguous-delete">>;
6281 def note_member_declared_here : Note<
6282   "member %0 declared here">;
6283 def err_decrement_bool : Error<"cannot decrement expression of type bool">;
6284 def warn_increment_bool : Warning<
6285   "incrementing expression of type bool is deprecated and "
6286   "incompatible with C++1z">, InGroup<DeprecatedIncrementBool>;
6287 def ext_increment_bool : ExtWarn<
6288   "ISO C++1z does not allow incrementing expression of type bool">,
6289   DefaultError, InGroup<IncrementBool>;
6290 def err_increment_decrement_enum : Error<
6291   "cannot %select{decrement|increment}0 expression of enum type %1">;
6292 def err_catch_incomplete_ptr : Error<
6293   "cannot catch pointer to incomplete type %0">;
6294 def err_catch_incomplete_ref : Error<
6295   "cannot catch reference to incomplete type %0">;
6296 def err_catch_incomplete : Error<"cannot catch incomplete type %0">;
6297 def err_catch_rvalue_ref : Error<"cannot catch exceptions by rvalue reference">;
6298 def err_catch_variably_modified : Error<
6299   "cannot catch variably modified type %0">;
6300 def err_qualified_catch_declarator : Error<
6301   "exception declarator cannot be qualified">;
6302 def err_early_catch_all : Error<"catch-all handler must come last">;
6303 def err_bad_memptr_rhs : Error<
6304   "right hand operand to %0 has non-pointer-to-member type %1">;
6305 def err_bad_memptr_lhs : Error<
6306   "left hand operand to %0 must be a %select{|pointer to }1class "
6307   "compatible with the right hand operand, but is %2">;
6308 def warn_exception_caught_by_earlier_handler : Warning<
6309   "exception of type %0 will be caught by earlier handler">,
6310   InGroup<Exceptions>;
6311 def note_previous_exception_handler : Note<"for type %0">;
6312 def err_exceptions_disabled : Error<
6313   "cannot use '%0' with exceptions disabled">;
6314 def err_objc_exceptions_disabled : Error<
6315   "cannot use '%0' with Objective-C exceptions disabled">;
6316 def err_seh_try_outside_functions : Error<
6317   "cannot use SEH '__try' in blocks, captured regions, or Obj-C method decls">;
6318 def err_mixing_cxx_try_seh_try : Error<
6319   "cannot use C++ 'try' in the same function as SEH '__try'">;
6320 def err_seh_try_unsupported : Error<
6321   "SEH '__try' is not supported on this target">;
6322 def note_conflicting_try_here : Note<
6323   "conflicting %0 here">;
6324 def warn_jump_out_of_seh_finally : Warning<
6325   "jump out of __finally block has undefined behavior">,
6326   InGroup<DiagGroup<"jump-seh-finally">>;
6327 def warn_non_virtual_dtor : Warning<
6328   "%0 has virtual functions but non-virtual destructor">,
6329   InGroup<NonVirtualDtor>, DefaultIgnore;
6330 def warn_delete_non_virtual_dtor : Warning<
6331   "%select{delete|destructor}0 called on non-final %1 that has "
6332   "virtual functions but non-virtual destructor">,
6333   InGroup<DeleteNonVirtualDtor>, DefaultIgnore;
6334 def note_delete_non_virtual : Note<
6335   "qualify call to silence this warning">;
6336 def warn_delete_abstract_non_virtual_dtor : Warning<
6337   "%select{delete|destructor}0 called on %1 that is abstract but has "
6338   "non-virtual destructor">, InGroup<DeleteNonVirtualDtor>;
6339 def warn_overloaded_virtual : Warning<
6340   "%q0 hides overloaded virtual %select{function|functions}1">,
6341   InGroup<OverloadedVirtual>, DefaultIgnore;
6342 def note_hidden_overloaded_virtual_declared_here : Note<
6343   "hidden overloaded virtual function %q0 declared here"
6344   "%select{|: different classes%diff{ ($ vs $)|}2,3"
6345   "|: different number of parameters (%2 vs %3)"
6346   "|: type mismatch at %ordinal2 parameter%diff{ ($ vs $)|}3,4"
6347   "|: different return type%diff{ ($ vs $)|}2,3"
6348   "|: different qualifiers ("
6349   "%select{none|const|restrict|const and restrict|volatile|const and volatile|"
6350   "volatile and restrict|const, volatile, and restrict}2 vs "
6351   "%select{none|const|restrict|const and restrict|volatile|const and volatile|"
6352   "volatile and restrict|const, volatile, and restrict}3)"
6353   "|: different exception specifications}1">;
6354 def warn_using_directive_in_header : Warning<
6355   "using namespace directive in global context in header">,
6356   InGroup<HeaderHygiene>, DefaultIgnore;
6357 def warn_overaligned_type : Warning<
6358   "type %0 requires %1 bytes of alignment and the default allocator only "
6359   "guarantees %2 bytes">,
6360   InGroup<OveralignedType>, DefaultIgnore;
6361
6362 def err_conditional_void_nonvoid : Error<
6363   "%select{left|right}1 operand to ? is void, but %select{right|left}1 operand "
6364   "is of type %0">;
6365 def err_conditional_ambiguous : Error<
6366   "conditional expression is ambiguous; "
6367   "%diff{$ can be converted to $ and vice versa|"
6368   "types can be convert to each other}0,1">;
6369 def err_conditional_ambiguous_ovl : Error<
6370   "conditional expression is ambiguous; %diff{$ and $|types}0,1 "
6371   "can be converted to several common types">;
6372 def err_conditional_vector_size : Error<
6373   "vector condition type %0 and result type %1 do not have the same number "
6374   "of elements">;
6375 def err_conditional_vector_element_size : Error<
6376   "vector condition type %0 and result type %1 do not have elements of the "
6377   "same size">;
6378
6379 def err_throw_incomplete : Error<
6380   "cannot throw object of incomplete type %0">;
6381 def err_throw_incomplete_ptr : Error<
6382   "cannot throw pointer to object of incomplete type %0">;
6383 def err_return_in_constructor_handler : Error<
6384   "return in the catch of a function try block of a constructor is illegal">;
6385 def warn_cdtor_function_try_handler_mem_expr : Warning<
6386   "cannot refer to a non-static member from the handler of a "
6387   "%select{constructor|destructor}0 function try block">, InGroup<Exceptions>;
6388
6389 let CategoryName = "Lambda Issue" in {
6390   def err_capture_more_than_once : Error<
6391     "%0 can appear only once in a capture list">;
6392   def err_reference_capture_with_reference_default : Error<
6393     "'&' cannot precede a capture when the capture default is '&'">;
6394   def err_this_capture_with_copy_default : Error<
6395     "'this' cannot be explicitly captured when the capture default is '='">;
6396   def err_copy_capture_with_copy_default : Error<
6397     "'&' must precede a capture when the capture default is '='">;
6398   def err_capture_does_not_name_variable : Error<
6399     "%0 in capture list does not name a variable">;
6400   def err_capture_non_automatic_variable : Error<
6401     "%0 cannot be captured because it does not have automatic storage "
6402     "duration">;
6403   def err_this_capture : Error<
6404     "'this' cannot be %select{implicitly |}0captured in this context">;
6405   def err_lambda_capture_anonymous_var : Error<
6406     "unnamed variable cannot be implicitly captured in a lambda expression">;
6407   def err_lambda_capture_flexarray_type : Error<
6408     "variable %0 with flexible array member cannot be captured in "
6409     "a lambda expression">;
6410   def err_lambda_impcap : Error<
6411     "variable %0 cannot be implicitly captured in a lambda with no "
6412     "capture-default specified">;
6413   def note_lambda_decl : Note<"lambda expression begins here">;
6414   def err_lambda_unevaluated_operand : Error<
6415     "lambda expression in an unevaluated operand">;
6416   def err_lambda_in_constant_expression : Error<
6417     "a lambda expression may not appear inside of a constant expression">;
6418   def err_lambda_return_init_list : Error<
6419     "cannot deduce lambda return type from initializer list">;
6420   def err_lambda_capture_default_arg : Error<
6421     "lambda expression in default argument cannot capture any entity">;
6422   def err_lambda_incomplete_result : Error<
6423     "incomplete result type %0 in lambda expression">;
6424   def err_noreturn_lambda_has_return_expr : Error<
6425     "lambda declared 'noreturn' should not return">;
6426   def warn_maybe_falloff_nonvoid_lambda : Warning<
6427     "control may reach end of non-void lambda">,
6428     InGroup<ReturnType>;
6429   def warn_falloff_nonvoid_lambda : Warning<
6430     "control reaches end of non-void lambda">,
6431     InGroup<ReturnType>;
6432   def err_access_lambda_capture : Error<
6433     // The ERRORs represent other special members that aren't constructors, in
6434     // hopes that someone will bother noticing and reporting if they appear
6435     "capture of variable '%0' as type %1 calls %select{private|protected}3 "
6436     "%select{default |copy |move |*ERROR* |*ERROR* |*ERROR* |}2constructor">,
6437     AccessControl;
6438   def note_lambda_to_block_conv : Note<
6439     "implicit capture of lambda object due to conversion to block pointer "
6440     "here">;
6441   def note_var_explicitly_captured_here : Note<"variable %0 is"
6442     "%select{| explicitly}1 captured here">;
6443
6444   // C++14 lambda init-captures.
6445   def warn_cxx11_compat_init_capture : Warning<
6446     "initialized lambda captures are incompatible with C++ standards "
6447     "before C++14">, InGroup<CXXPre14Compat>, DefaultIgnore;
6448   def ext_init_capture : ExtWarn<
6449     "initialized lambda captures are a C++14 extension">, InGroup<CXX14>;
6450   def err_init_capture_no_expression : Error<
6451     "initializer missing for lambda capture %0">;
6452   def err_init_capture_multiple_expressions : Error<
6453     "initializer for lambda capture %0 contains multiple expressions">;
6454   def err_init_capture_paren_braces : Error<
6455     "cannot deduce type for lambda capture %1 from "
6456     "%select{parenthesized|nested}0 initializer list">;
6457   def err_init_capture_deduction_failure : Error<
6458     "cannot deduce type for lambda capture %0 from initializer of type %2">;
6459   def err_init_capture_deduction_failure_from_init_list : Error<
6460     "cannot deduce type for lambda capture %0 from initializer list">;
6461
6462   // C++1z '*this' captures.
6463   def warn_cxx14_compat_star_this_lambda_capture : Warning<
6464     "by value capture of '*this' is incompatible with C++ standards before C++1z">,
6465      InGroup<CXXPre1zCompat>, DefaultIgnore;
6466   def ext_star_this_lambda_capture_cxx1z : ExtWarn<
6467     "capture of '*this' by copy is a C++1z extension">, InGroup<CXX1z>;
6468 }
6469
6470 def err_return_in_captured_stmt : Error<
6471   "cannot return from %0">;
6472 def err_capture_block_variable : Error<
6473   "__block variable %0 cannot be captured in a "
6474   "%select{lambda expression|captured statement}1">;
6475
6476 def err_operator_arrow_circular : Error<
6477   "circular pointer delegation detected">;
6478 def err_operator_arrow_depth_exceeded : Error<
6479   "use of 'operator->' on type %0 would invoke a sequence of more than %1 "
6480   "'operator->' calls">;
6481 def note_operator_arrow_here : Note<
6482   "'operator->' declared here produces an object of type %0">;
6483 def note_operator_arrows_suppressed : Note<
6484   "(skipping %0 'operator->'%s0 in backtrace)">;
6485 def note_operator_arrow_depth : Note<
6486   "use -foperator-arrow-depth=N to increase 'operator->' limit">;
6487
6488 def err_pseudo_dtor_base_not_scalar : Error<
6489   "object expression of non-scalar type %0 cannot be used in a "
6490   "pseudo-destructor expression">;
6491 def ext_pseudo_dtor_on_void : ExtWarn<
6492   "pseudo-destructors on type void are a Microsoft extension">,
6493   InGroup<MicrosoftVoidPseudoDtor>;
6494 def err_pseudo_dtor_type_mismatch : Error<
6495   "the type of object expression "
6496   "%diff{($) does not match the type being destroyed ($)|"
6497   "does not match the type being destroyed}0,1 "
6498   "in pseudo-destructor expression">;
6499 def err_pseudo_dtor_call_with_args : Error<
6500   "call to pseudo-destructor cannot have any arguments">;
6501 def err_dtor_expr_without_call : Error<
6502   "reference to %select{destructor|pseudo-destructor}0 must be called"
6503   "%select{|; did you mean to call it with no arguments?}1">;
6504 def err_pseudo_dtor_destructor_non_type : Error<
6505   "%0 does not refer to a type name in pseudo-destructor expression; expected "
6506   "the name of type %1">;
6507 def err_invalid_use_of_function_type : Error<
6508   "a function type is not allowed here">;
6509 def err_invalid_use_of_array_type : Error<"an array type is not allowed here">;
6510 def err_typecheck_bool_condition : Error<
6511   "value of type %0 is not contextually convertible to 'bool'">;
6512 def err_typecheck_ambiguous_condition : Error<
6513   "conversion %diff{from $ to $|between types}0,1 is ambiguous">;
6514 def err_typecheck_nonviable_condition : Error<
6515   "no viable conversion%select{%diff{ from $ to $|}1,2|"
6516   "%diff{ from returned value of type $ to function return type $|}1,2}0">;
6517 def err_typecheck_nonviable_condition_incomplete : Error<
6518   "no viable conversion%diff{ from $ to incomplete type $|}0,1">;
6519 def err_typecheck_deleted_function : Error<
6520   "conversion function %diff{from $ to $|between types}0,1 "
6521   "invokes a deleted function">;
6522   
6523 def err_expected_class_or_namespace : Error<"%0 is not a class"
6524   "%select{ or namespace|, namespace, or enumeration}1">;
6525 def err_invalid_declarator_scope : Error<"cannot define or redeclare %0 here "
6526   "because namespace %1 does not enclose namespace %2">;
6527 def err_invalid_declarator_global_scope : Error<
6528   "definition or redeclaration of %0 cannot name the global scope">;
6529 def err_invalid_declarator_in_function : Error<
6530   "definition or redeclaration of %0 not allowed inside a function">;
6531 def err_invalid_declarator_in_block : Error<
6532   "definition or redeclaration of %0 not allowed inside a block">;
6533 def err_not_tag_in_scope : Error<
6534   "no %select{struct|interface|union|class|enum}0 named %1 in %2">;
6535
6536 def err_no_typeid_with_fno_rtti : Error<
6537   "cannot use typeid with -fno-rtti">;
6538 def err_no_dynamic_cast_with_fno_rtti : Error<
6539   "cannot use dynamic_cast with -fno-rtti">;
6540
6541 def err_cannot_form_pointer_to_member_of_reference_type : Error<
6542   "cannot form a pointer-to-member to member %0 of reference type %1">;
6543 def err_incomplete_object_call : Error<
6544   "incomplete type in call to object of type %0">;
6545
6546 def warn_condition_is_assignment : Warning<"using the result of an "
6547   "assignment as a condition without parentheses">,
6548   InGroup<Parentheses>;
6549 // Completely identical except off by default.
6550 def warn_condition_is_idiomatic_assignment : Warning<"using the result "
6551   "of an assignment as a condition without parentheses">,
6552   InGroup<DiagGroup<"idiomatic-parentheses">>, DefaultIgnore;
6553 def note_condition_assign_to_comparison : Note<
6554   "use '==' to turn this assignment into an equality comparison">;
6555 def note_condition_or_assign_to_comparison : Note<
6556   "use '!=' to turn this compound assignment into an inequality comparison">;
6557 def note_condition_assign_silence : Note<
6558   "place parentheses around the assignment to silence this warning">;
6559
6560 def warn_equality_with_extra_parens : Warning<"equality comparison with "
6561   "extraneous parentheses">, InGroup<ParenthesesOnEquality>;
6562 def note_equality_comparison_to_assign : Note<
6563   "use '=' to turn this equality comparison into an assignment">;
6564 def note_equality_comparison_silence : Note<
6565   "remove extraneous parentheses around the comparison to silence this warning">;
6566
6567 // assignment related diagnostics (also for argument passing, returning, etc).
6568 // In most of these diagnostics the %2 is a value from the
6569 // Sema::AssignmentAction enumeration
6570 def err_typecheck_convert_incompatible : Error<
6571   "%select{%diff{assigning to $ from incompatible type $|"
6572   "assigning to type from incompatible type}0,1"
6573   "|%diff{passing $ to parameter of incompatible type $|"
6574   "passing type to parameter of incompatible type}0,1"
6575   "|%diff{returning $ from a function with incompatible result type $|"
6576   "returning type from a function with incompatible result type}0,1"
6577   "|%diff{converting $ to incompatible type $|"
6578   "converting type to incompatible type}0,1"
6579   "|%diff{initializing $ with an expression of incompatible type $|"
6580   "initializing type with an expression of incompatible type}0,1"
6581   "|%diff{sending $ to parameter of incompatible type $|"
6582   "sending type to parameter of incompatible type}0,1"
6583   "|%diff{casting $ to incompatible type $|"
6584   "casting type to incompatible type}0,1}2"
6585   "%select{|; dereference with *|"
6586   "; take the address with &|"
6587   "; remove *|"
6588   "; remove &}3"
6589   "%select{|: different classes%diff{ ($ vs $)|}5,6"
6590   "|: different number of parameters (%5 vs %6)"
6591   "|: type mismatch at %ordinal5 parameter%diff{ ($ vs $)|}6,7"
6592   "|: different return type%diff{ ($ vs $)|}5,6"
6593   "|: different qualifiers ("
6594   "%select{none|const|restrict|const and restrict|volatile|const and volatile|"
6595   "volatile and restrict|const, volatile, and restrict}5 vs "
6596   "%select{none|const|restrict|const and restrict|volatile|const and volatile|"
6597   "volatile and restrict|const, volatile, and restrict}6)"
6598   "|: different exception specifications}4">;
6599 def err_typecheck_missing_return_type_incompatible : Error<
6600   "%diff{return type $ must match previous return type $|"
6601   "return type must match previous return type}0,1 when %select{block "
6602   "literal|lambda expression}2 has unspecified explicit return type">;
6603
6604 def note_incomplete_class_and_qualified_id : Note<
6605   "conformance of forward class %0 to protocol %1 can not be confirmed">;
6606 def warn_incompatible_qualified_id : Warning<
6607   "%select{%diff{assigning to $ from incompatible type $|"
6608   "assigning to type from incompatible type}0,1"
6609   "|%diff{passing $ to parameter of incompatible type $|"
6610   "passing type to parameter of incompatible type}0,1"
6611   "|%diff{returning $ from a function with incompatible result type $|"
6612   "returning type from a function with incompatible result type}0,1"
6613   "|%diff{converting $ to incompatible type $|"
6614   "converting type to incompatible type}0,1"
6615   "|%diff{initializing $ with an expression of incompatible type $|"
6616   "initializing type with an expression of incompatible type}0,1"
6617   "|%diff{sending $ to parameter of incompatible type $|"
6618   "sending type to parameter of incompatible type}0,1"
6619   "|%diff{casting $ to incompatible type $|"
6620   "casting type to incompatible type}0,1}2">;
6621 def ext_typecheck_convert_pointer_int : ExtWarn<
6622   "incompatible pointer to integer conversion "
6623   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6624   "|%diff{passing $ to parameter of type $|"
6625   "passing to parameter of different type}0,1"
6626   "|%diff{returning $ from a function with result type $|"
6627   "returning from function with different return type}0,1"
6628   "|%diff{converting $ to type $|converting between types}0,1"
6629   "|%diff{initializing $ with an expression of type $|"
6630   "initializing with expression of different type}0,1"
6631   "|%diff{sending $ to parameter of type $|"
6632   "sending to parameter of different type}0,1"
6633   "|%diff{casting $ to type $|casting between types}0,1}2"
6634   "%select{|; dereference with *|"
6635   "; take the address with &|"
6636   "; remove *|"
6637   "; remove &}3">,
6638   InGroup<IntConversion>;
6639 def ext_typecheck_convert_int_pointer : ExtWarn<
6640   "incompatible integer to pointer conversion "
6641   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6642   "|%diff{passing $ to parameter of type $|"
6643   "passing to parameter of different type}0,1"
6644   "|%diff{returning $ from a function with result type $|"
6645   "returning from function with different return type}0,1"
6646   "|%diff{converting $ to type $|converting between types}0,1"
6647   "|%diff{initializing $ with an expression of type $|"
6648   "initializing with expression of different type}0,1"
6649   "|%diff{sending $ to parameter of type $|"
6650   "sending to parameter of different type}0,1"
6651   "|%diff{casting $ to type $|casting between types}0,1}2"
6652   "%select{|; dereference with *|"
6653   "; take the address with &|"
6654   "; remove *|"
6655   "; remove &}3">,
6656   InGroup<IntConversion>;
6657 def ext_typecheck_convert_pointer_void_func : Extension<
6658   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6659   "|%diff{passing $ to parameter of type $|"
6660   "passing to parameter of different type}0,1"
6661   "|%diff{returning $ from a function with result type $|"
6662   "returning from function with different return type}0,1"
6663   "|%diff{converting $ to type $|converting between types}0,1"
6664   "|%diff{initializing $ with an expression of type $|"
6665   "initializing with expression of different type}0,1"
6666   "|%diff{sending $ to parameter of type $|"
6667   "sending to parameter of different type}0,1"
6668   "|%diff{casting $ to type $|casting between types}0,1}2"
6669   " converts between void pointer and function pointer">;
6670 def ext_typecheck_convert_incompatible_pointer_sign : ExtWarn<
6671   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6672   "|%diff{passing $ to parameter of type $|"
6673   "passing to parameter of different type}0,1"
6674   "|%diff{returning $ from a function with result type $|"
6675   "returning from function with different return type}0,1"
6676   "|%diff{converting $ to type $|converting between types}0,1"
6677   "|%diff{initializing $ with an expression of type $|"
6678   "initializing with expression of different type}0,1"
6679   "|%diff{sending $ to parameter of type $|"
6680   "sending to parameter of different type}0,1"
6681   "|%diff{casting $ to type $|casting between types}0,1}2"
6682   " converts between pointers to integer types with different sign">,
6683   InGroup<DiagGroup<"pointer-sign">>;
6684 def ext_typecheck_convert_incompatible_pointer : ExtWarn<
6685   "incompatible pointer types "
6686   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6687   "|%diff{passing $ to parameter of type $|"
6688   "passing to parameter of different type}0,1"
6689   "|%diff{returning $ from a function with result type $|"
6690   "returning from function with different return type}0,1"
6691   "|%diff{converting $ to type $|converting between types}0,1"
6692   "|%diff{initializing $ with an expression of type $|"
6693   "initializing with expression of different type}0,1"
6694   "|%diff{sending $ to parameter of type $|"
6695   "sending to parameter of different type}0,1"
6696   "|%diff{casting $ to type $|casting between types}0,1}2"
6697   "%select{|; dereference with *|"
6698   "; take the address with &|"
6699   "; remove *|"
6700   "; remove &}3">,
6701   InGroup<IncompatiblePointerTypes>;
6702 def ext_typecheck_convert_incompatible_function_pointer : ExtWarn<
6703   "incompatible function pointer types "
6704   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6705   "|%diff{passing $ to parameter of type $|"
6706   "passing to parameter of different type}0,1"
6707   "|%diff{returning $ from a function with result type $|"
6708   "returning from function with different return type}0,1"
6709   "|%diff{converting $ to type $|converting between types}0,1"
6710   "|%diff{initializing $ with an expression of type $|"
6711   "initializing with expression of different type}0,1"
6712   "|%diff{sending $ to parameter of type $|"
6713   "sending to parameter of different type}0,1"
6714   "|%diff{casting $ to type $|casting between types}0,1}2"
6715   "%select{|; dereference with *|"
6716   "; take the address with &|"
6717   "; remove *|"
6718   "; remove &}3">,
6719   InGroup<IncompatibleFunctionPointerTypes>;
6720 def ext_typecheck_convert_discards_qualifiers : ExtWarn<
6721   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6722   "|%diff{passing $ to parameter of type $|"
6723   "passing to parameter of different type}0,1"
6724   "|%diff{returning $ from a function with result type $|"
6725   "returning from function with different return type}0,1"
6726   "|%diff{converting $ to type $|converting between types}0,1"
6727   "|%diff{initializing $ with an expression of type $|"
6728   "initializing with expression of different type}0,1"
6729   "|%diff{sending $ to parameter of type $|"
6730   "sending to parameter of different type}0,1"
6731   "|%diff{casting $ to type $|casting between types}0,1}2"
6732   " discards qualifiers">,
6733   InGroup<IncompatiblePointerTypesDiscardsQualifiers>;
6734 def ext_nested_pointer_qualifier_mismatch : ExtWarn<
6735   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6736   "|%diff{passing $ to parameter of type $|"
6737   "passing to parameter of different type}0,1"
6738   "|%diff{returning $ from a function with result type $|"
6739   "returning from function with different return type}0,1"
6740   "|%diff{converting $ to type $|converting between types}0,1"
6741   "|%diff{initializing $ with an expression of type $|"
6742   "initializing with expression of different type}0,1"
6743   "|%diff{sending $ to parameter of type $|"
6744   "sending to parameter of different type}0,1"
6745   "|%diff{casting $ to type $|casting between types}0,1}2"
6746   " discards qualifiers in nested pointer types">,
6747   InGroup<IncompatiblePointerTypesDiscardsQualifiers>;
6748 def warn_incompatible_vectors : Warning<
6749   "incompatible vector types "
6750   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6751   "|%diff{passing $ to parameter of type $|"
6752   "passing to parameter of different type}0,1"
6753   "|%diff{returning $ from a function with result type $|"
6754   "returning from function with different return type}0,1"
6755   "|%diff{converting $ to type $|converting between types}0,1"
6756   "|%diff{initializing $ with an expression of type $|"
6757   "initializing with expression of different type}0,1"
6758   "|%diff{sending $ to parameter of type $|"
6759   "sending to parameter of different type}0,1"
6760   "|%diff{casting $ to type $|casting between types}0,1}2">,
6761   InGroup<VectorConversion>, DefaultIgnore;
6762 def err_int_to_block_pointer : Error<
6763   "invalid block pointer conversion "
6764   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6765   "|%diff{passing $ to parameter of type $|"
6766   "passing to parameter of different type}0,1"
6767   "|%diff{returning $ from a function with result type $|"
6768   "returning from function with different return type}0,1"
6769   "|%diff{converting $ to type $|converting between types}0,1"
6770   "|%diff{initializing $ with an expression of type $|"
6771   "initializing with expression of different type}0,1"
6772   "|%diff{sending $ to parameter of type $|"
6773   "sending to parameter of different type}0,1"
6774   "|%diff{casting $ to type $|casting between types}0,1}2">;
6775 def err_typecheck_convert_incompatible_block_pointer : Error<
6776   "incompatible block pointer types "
6777   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6778   "|%diff{passing $ to parameter of type $|"
6779   "passing to parameter of different type}0,1"
6780   "|%diff{returning $ from a function with result type $|"
6781   "returning from function with different return type}0,1"
6782   "|%diff{converting $ to type $|converting between types}0,1"
6783   "|%diff{initializing $ with an expression of type $|"
6784   "initializing with expression of different type}0,1"
6785   "|%diff{sending $ to parameter of type $|"
6786   "sending to parameter of different type}0,1"
6787   "|%diff{casting $ to type $|casting between types}0,1}2">;
6788 def err_typecheck_incompatible_address_space : Error<
6789   "%select{%diff{assigning $ to $|assigning to different types}1,0"
6790   "|%diff{passing $ to parameter of type $|"
6791   "passing to parameter of different type}0,1"
6792   "|%diff{returning $ from a function with result type $|"
6793   "returning from function with different return type}0,1"
6794   "|%diff{converting $ to type $|converting between types}0,1"
6795   "|%diff{initializing $ with an expression of type $|"
6796   "initializing with expression of different type}0,1"
6797   "|%diff{sending $ to parameter of type $|"
6798   "sending to parameter of different type}0,1"
6799   "|%diff{casting $ to type $|casting between types}0,1}2"
6800   " changes address space of pointer">;
6801 def err_typecheck_incompatible_ownership : Error<
6802   "%select{%diff{assigning $ to $|assigning to different types}1,0"
6803   "|%diff{passing $ to parameter of type $|"
6804   "passing to parameter of different type}0,1"
6805   "|%diff{returning $ from a function with result type $|"
6806   "returning from function with different return type}0,1"
6807   "|%diff{converting $ to type $|converting between types}0,1"
6808   "|%diff{initializing $ with an expression of type $|"
6809   "initializing with expression of different type}0,1"
6810   "|%diff{sending $ to parameter of type $|"
6811   "sending to parameter of different type}0,1"
6812   "|%diff{casting $ to type $|casting between types}0,1}2"
6813   " changes retain/release properties of pointer">;
6814 def err_typecheck_comparison_of_distinct_blocks : Error<
6815   "comparison of distinct block types%diff{ ($ and $)|}0,1">;
6816
6817 def err_typecheck_array_not_modifiable_lvalue : Error<
6818   "array type %0 is not assignable">;
6819 def err_typecheck_non_object_not_modifiable_lvalue : Error<
6820   "non-object type %0 is not assignable">;
6821 def err_typecheck_expression_not_modifiable_lvalue : Error<
6822   "expression is not assignable">;
6823 def err_typecheck_incomplete_type_not_modifiable_lvalue : Error<
6824   "incomplete type %0 is not assignable">;
6825 def err_typecheck_lvalue_casts_not_supported : Error<
6826   "assignment to cast is illegal, lvalue casts are not supported">;
6827
6828 def err_typecheck_duplicate_vector_components_not_mlvalue : Error<
6829   "vector is not assignable (contains duplicate components)">;
6830 def err_block_decl_ref_not_modifiable_lvalue : Error<
6831   "variable is not assignable (missing __block type specifier)">;
6832 def err_lambda_decl_ref_not_modifiable_lvalue : Error<
6833   "cannot assign to a variable captured by copy in a non-mutable lambda">;
6834 def err_typecheck_call_not_function : Error<
6835   "called object type %0 is not a function or function pointer">;
6836 def err_call_incomplete_return : Error<
6837   "calling function with incomplete return type %0">;
6838 def err_call_function_incomplete_return : Error<
6839   "calling %0 with incomplete return type %1">;
6840 def err_call_incomplete_argument : Error<
6841   "argument type %0 is incomplete">;
6842 def err_typecheck_call_too_few_args : Error<
6843   "too few %select{|||execution configuration }0arguments to "
6844   "%select{function|block|method|kernel function}0 call, "
6845   "expected %1, have %2">;
6846 def err_typecheck_call_too_few_args_one : Error<
6847   "too few %select{|||execution configuration }0arguments to "
6848   "%select{function|block|method|kernel function}0 call, "
6849   "single argument %1 was not specified">;
6850 def err_typecheck_call_too_few_args_at_least : Error<
6851   "too few %select{|||execution configuration }0arguments to "
6852   "%select{function|block|method|kernel function}0 call, "
6853   "expected at least %1, have %2">;
6854 def err_typecheck_call_too_few_args_at_least_one : Error<
6855   "too few %select{|||execution configuration }0arguments to "
6856   "%select{function|block|method|kernel function}0 call, "
6857   "at least argument %1 must be specified">;
6858 def err_typecheck_call_too_few_args_suggest : Error<
6859   "too few %select{|||execution configuration }0arguments to "
6860   "%select{function|block|method|kernel function}0 call, "
6861   "expected %1, have %2; did you mean %3?">;
6862 def err_typecheck_call_too_few_args_at_least_suggest : Error<
6863   "too few %select{|||execution configuration }0arguments to "
6864   "%select{function|block|method|kernel function}0 call, "
6865   "expected at least %1, have %2; did you mean %3?">;
6866 def err_typecheck_call_too_many_args : Error<
6867   "too many %select{|||execution configuration }0arguments to "
6868   "%select{function|block|method|kernel function}0 call, "
6869   "expected %1, have %2">;
6870 def err_typecheck_call_too_many_args_one : Error<
6871   "too many %select{|||execution configuration }0arguments to "
6872   "%select{function|block|method|kernel function}0 call, "
6873   "expected single argument %1, have %2 arguments">;
6874 def err_typecheck_call_too_many_args_at_most : Error<
6875   "too many %select{|||execution configuration }0arguments to "
6876   "%select{function|block|method|kernel function}0 call, "
6877   "expected at most %1, have %2">;
6878 def err_typecheck_call_too_many_args_at_most_one : Error<
6879   "too many %select{|||execution configuration }0arguments to "
6880   "%select{function|block|method|kernel function}0 call, "
6881   "expected at most single argument %1, have %2 arguments">;
6882 def err_typecheck_call_too_many_args_suggest : Error<
6883   "too many %select{|||execution configuration }0arguments to "
6884   "%select{function|block|method|kernel function}0 call, "
6885   "expected %1, have %2; did you mean %3?">;
6886 def err_typecheck_call_too_many_args_at_most_suggest : Error<
6887   "too many %select{|||execution configuration }0arguments to "
6888   "%select{function|block|method|kernel function}0 call, "
6889   "expected at most %1, have %2; did you mean %3?">;
6890   
6891 def err_arc_typecheck_convert_incompatible_pointer : Error<
6892   "incompatible pointer types passing retainable parameter of type %0"
6893   "to a CF function expecting %1 type">;
6894   
6895 def err_builtin_fn_use : Error<"builtin functions must be directly called">;
6896
6897 def warn_call_wrong_number_of_arguments : Warning<
6898   "too %select{few|many}0 arguments in call to %1">;
6899 def err_atomic_builtin_must_be_pointer : Error<
6900   "address argument to atomic builtin must be a pointer (%0 invalid)">;
6901 def err_atomic_builtin_must_be_pointer_intptr : Error<
6902   "address argument to atomic builtin must be a pointer to integer or pointer"
6903   " (%0 invalid)">;
6904 def err_atomic_builtin_must_be_pointer_intfltptr : Error<
6905   "address argument to atomic builtin must be a pointer to integer,"
6906   " floating-point or pointer (%0 invalid)">;
6907 def err_atomic_builtin_pointer_size : Error<
6908   "address argument to atomic builtin must be a pointer to 1,2,4,8 or 16 byte "
6909   "type (%0 invalid)">;
6910 def err_atomic_exclusive_builtin_pointer_size : Error<
6911   "address argument to load or store exclusive builtin must be a pointer to"
6912   " 1,2,4 or 8 byte type (%0 invalid)">;
6913 def err_atomic_op_needs_atomic : Error<
6914   "address argument to atomic operation must be a pointer to _Atomic "
6915   "type (%0 invalid)">;
6916 def err_atomic_op_needs_non_const_atomic : Error<
6917   "address argument to atomic operation must be a pointer to non-const _Atomic "
6918   "type (%0 invalid)">;
6919 def err_atomic_op_needs_non_const_pointer : Error<
6920   "address argument to atomic operation must be a pointer to non-const "
6921   "type (%0 invalid)">;
6922 def err_atomic_op_needs_trivial_copy : Error<
6923   "address argument to atomic operation must be a pointer to a "
6924   "trivially-copyable type (%0 invalid)">;
6925 def err_atomic_op_needs_atomic_int_or_ptr : Error<
6926   "address argument to atomic operation must be a pointer to %select{|atomic }0"
6927   "integer or pointer (%1 invalid)">;
6928 def err_atomic_op_bitwise_needs_atomic_int : Error<
6929   "address argument to bitwise atomic operation must be a pointer to "
6930   "%select{|atomic }0integer (%1 invalid)">;
6931 def warn_atomic_op_has_invalid_memory_order : Warning<
6932   "memory order argument to atomic operation is invalid">,
6933   InGroup<DiagGroup<"atomic-memory-ordering">>;
6934
6935 def err_overflow_builtin_must_be_int : Error<
6936   "operand argument to overflow builtin must be an integer (%0 invalid)">;
6937 def err_overflow_builtin_must_be_ptr_int : Error<
6938   "result argument to overflow builtin must be a pointer "
6939   "to a non-const integer (%0 invalid)">;
6940
6941 def err_atomic_load_store_uses_lib : Error<
6942   "atomic %select{load|store}0 requires runtime support that is not "
6943   "available for this target">;
6944
6945 def err_nontemporal_builtin_must_be_pointer : Error<
6946   "address argument to nontemporal builtin must be a pointer (%0 invalid)">;
6947 def err_nontemporal_builtin_must_be_pointer_intfltptr_or_vector : Error<
6948   "address argument to nontemporal builtin must be a pointer to integer, float, "
6949   "pointer, or a vector of such types (%0 invalid)">;
6950
6951 def err_deleted_function_use : Error<"attempt to use a deleted function">;
6952 def err_deleted_inherited_ctor_use : Error<
6953   "constructor inherited by %0 from base class %1 is implicitly deleted">;
6954
6955 def note_called_by : Note<"called by %0">;
6956 def err_kern_type_not_void_return : Error<
6957   "kernel function type %0 must have void return type">;
6958 def err_kern_is_nonstatic_method : Error<
6959   "kernel function %0 must be a free function or static member function">;
6960 def err_config_scalar_return : Error<
6961   "CUDA special function 'cudaConfigureCall' must have scalar return type">;
6962 def err_kern_call_not_global_function : Error<
6963   "kernel call to non-global function %0">;
6964 def err_global_call_not_config : Error<
6965   "call to global function %0 not configured">;
6966 def err_ref_bad_target : Error<
6967   "reference to %select{__device__|__global__|__host__|__host__ __device__}0 "
6968   "function %1 in %select{__device__|__global__|__host__|__host__ __device__}2 function">;
6969 def err_ref_bad_target_global_initializer : Error<
6970   "reference to %select{__device__|__global__|__host__|__host__ __device__}0 "
6971   "function %1 in global initializer">;
6972 def warn_kern_is_method : Extension<
6973   "kernel function %0 is a member function; this may not be accepted by nvcc">,
6974   InGroup<CudaCompat>;
6975 def warn_kern_is_inline : Warning<
6976   "ignored 'inline' attribute on kernel function %0">,
6977   InGroup<CudaCompat>;
6978 def err_variadic_device_fn : Error<
6979   "CUDA device code does not support variadic functions">;
6980 def err_va_arg_in_device : Error<
6981   "CUDA device code does not support va_arg">;
6982 def err_alias_not_supported_on_nvptx : Error<"CUDA does not support aliases">;
6983 def err_cuda_unattributed_constexpr_cannot_overload_device : Error<
6984   "constexpr function '%0' without __host__ or __device__ attributes cannot "
6985   "overload __device__ function with same signature.  Add a __host__ "
6986   "attribute, or build with -fno-cuda-host-device-constexpr.">;
6987 def note_cuda_conflicting_device_function_declared_here : Note<
6988   "conflicting __device__ function declared here">;
6989 def err_cuda_device_exceptions : Error<
6990   "cannot use '%0' in "
6991   "%select{__device__|__global__|__host__|__host__ __device__}1 function">;
6992 def err_dynamic_var_init : Error<
6993     "dynamic initialization is not supported for "
6994     "__device__, __constant__, and __shared__ variables.">;
6995 def err_shared_var_init : Error<
6996     "initialization is not supported for __shared__ variables.">;
6997 def err_device_static_local_var : Error<
6998     "within a %select{__device__|__global__|__host__|__host__ __device__}0 "
6999     "function, only __shared__ variables may be marked 'static'">;
7000 def err_cuda_vla : Error<
7001     "cannot use variable-length arrays in "
7002     "%select{__device__|__global__|__host__|__host__ __device__}0 functions">;
7003 def err_cuda_extern_shared : Error<"__shared__ variable %0 cannot be 'extern'">;
7004 def err_cuda_host_shared : Error<
7005     "__shared__ local variables not allowed in "
7006     "%select{__device__|__global__|__host__|__host__ __device__}0 functions">;
7007 def err_cuda_nonglobal_constant : Error<"__constant__ variables must be global">;
7008 def err_cuda_ovl_target : Error<
7009   "%select{__device__|__global__|__host__|__host__ __device__}0 function %1 "
7010   "cannot overload %select{__device__|__global__|__host__|__host__ __device__}2 function %3">;
7011 def note_cuda_ovl_candidate_target_mismatch : Note<
7012     "candidate template ignored: target attributes do not match">;
7013
7014 def warn_non_pod_vararg_with_format_string : Warning<
7015   "cannot pass %select{non-POD|non-trivial}0 object of type %1 to variadic "
7016   "%select{function|block|method|constructor}2; expected type from format "
7017   "string was %3">, InGroup<NonPODVarargs>, DefaultError;
7018 // The arguments to this diagnostic should match the warning above.
7019 def err_cannot_pass_objc_interface_to_vararg_format : Error<
7020   "cannot pass object with interface type %1 by value to variadic "
7021   "%select{function|block|method|constructor}2; expected type from format "
7022   "string was %3">;
7023
7024 def err_cannot_pass_objc_interface_to_vararg : Error<
7025   "cannot pass object with interface type %0 by value through variadic "
7026   "%select{function|block|method|constructor}1">;
7027 def warn_cannot_pass_non_pod_arg_to_vararg : Warning<
7028   "cannot pass object of %select{non-POD|non-trivial}0 type %1 through variadic"
7029   " %select{function|block|method|constructor}2; call will abort at runtime">,
7030   InGroup<NonPODVarargs>, DefaultError;
7031 def warn_cxx98_compat_pass_non_pod_arg_to_vararg : Warning<
7032   "passing object of trivial but non-POD type %0 through variadic"
7033   " %select{function|block|method|constructor}1 is incompatible with C++98">,
7034   InGroup<CXX98Compat>, DefaultIgnore;
7035 def warn_pass_class_arg_to_vararg : Warning<
7036   "passing object of class type %0 through variadic "
7037   "%select{function|block|method|constructor}1"
7038   "%select{|; did you mean to call '%3'?}2">,
7039   InGroup<ClassVarargs>, DefaultIgnore;
7040 def err_cannot_pass_to_vararg : Error<
7041   "cannot pass %select{expression of type %1|initializer list}0 to variadic "
7042   "%select{function|block|method|constructor}2">;
7043 def err_cannot_pass_to_vararg_format : Error<
7044   "cannot pass %select{expression of type %1|initializer list}0 to variadic "
7045   "%select{function|block|method|constructor}2; expected type from format "
7046   "string was %3">;
7047
7048 def err_typecheck_call_invalid_ordered_compare : Error<
7049   "ordered compare requires two args of floating point type"
7050   "%diff{ ($ and $)|}0,1">;
7051 def err_typecheck_call_invalid_unary_fp : Error<
7052   "floating point classification requires argument of floating point type "
7053   "(passed in %0)">;
7054 def err_typecheck_cond_expect_int_float : Error<
7055   "used type %0 where integer or floating point type is required">;
7056 def err_typecheck_cond_expect_scalar : Error<
7057   "used type %0 where arithmetic or pointer type is required">;
7058 def err_typecheck_cond_expect_nonfloat : Error<
7059   "used type %0 where floating point type is not allowed">;
7060 def ext_typecheck_cond_one_void : Extension<
7061   "C99 forbids conditional expressions with only one void side">;
7062 def err_typecheck_cast_to_incomplete : Error<
7063   "cast to incomplete type %0">;
7064 def ext_typecheck_cast_nonscalar : Extension<
7065   "C99 forbids casting nonscalar type %0 to the same type">;
7066 def ext_typecheck_cast_to_union : Extension<
7067   "cast to union type is a GNU extension">,
7068   InGroup<GNUUnionCast>;
7069 def err_typecheck_cast_to_union_no_type : Error<
7070   "cast to union type from type %0 not present in union">;
7071 def err_cast_pointer_from_non_pointer_int : Error<
7072   "operand of type %0 cannot be cast to a pointer type">;
7073 def warn_cast_pointer_from_sel : Warning<
7074   "cast of type %0 to %1 is deprecated; use sel_getName instead">,
7075   InGroup<SelTypeCast>;
7076 def warn_function_def_in_objc_container : Warning<
7077   "function definition inside an Objective-C container is deprecated">,
7078   InGroup<FunctionDefInObjCContainer>;
7079
7080 def warn_cast_calling_conv : Warning<
7081   "cast between incompatible calling conventions '%0' and '%1'; "
7082   "calls through this pointer may abort at runtime">,
7083   InGroup<DiagGroup<"cast-calling-convention">>;
7084 def note_change_calling_conv_fixit : Note<
7085   "consider defining %0 with the '%1' calling convention">;
7086 def warn_bad_function_cast : Warning<
7087   "cast from function call of type %0 to non-matching type %1">,
7088   InGroup<BadFunctionCast>, DefaultIgnore;
7089 def err_cast_pointer_to_non_pointer_int : Error<
7090   "pointer cannot be cast to type %0">;
7091 def err_typecheck_expect_scalar_operand : Error<
7092   "operand of type %0 where arithmetic or pointer type is required">;
7093 def err_typecheck_cond_incompatible_operands : Error<
7094   "incompatible operand types%diff{ ($ and $)|}0,1">;
7095 def err_cast_selector_expr : Error<
7096   "cannot type cast @selector expression">;
7097 def ext_typecheck_cond_incompatible_pointers : ExtWarn<
7098   "pointer type mismatch%diff{ ($ and $)|}0,1">,
7099   InGroup<DiagGroup<"pointer-type-mismatch">>;
7100 def ext_typecheck_cond_pointer_integer_mismatch : ExtWarn<
7101   "pointer/integer type mismatch in conditional expression"
7102   "%diff{ ($ and $)|}0,1">,
7103   InGroup<DiagGroup<"conditional-type-mismatch">>;
7104 def err_typecheck_choose_expr_requires_constant : Error<
7105   "'__builtin_choose_expr' requires a constant expression">;
7106 def warn_unused_expr : Warning<"expression result unused">,
7107   InGroup<UnusedValue>;
7108 def warn_unused_voidptr : Warning<
7109   "expression result unused; should this cast be to 'void'?">,
7110   InGroup<UnusedValue>;
7111 def warn_unused_property_expr : Warning<
7112  "property access result unused - getters should not be used for side effects">,
7113   InGroup<UnusedGetterReturnValue>;
7114 def warn_unused_container_subscript_expr : Warning<
7115  "container access result unused - container access should not be used for side effects">,
7116   InGroup<UnusedValue>;
7117 def warn_unused_call : Warning<
7118   "ignoring return value of function declared with %0 attribute">,
7119   InGroup<UnusedValue>;
7120 def warn_side_effects_unevaluated_context : Warning<
7121   "expression with side effects has no effect in an unevaluated context">,
7122   InGroup<UnevaluatedExpression>;
7123 def warn_side_effects_typeid : Warning<
7124   "expression with side effects will be evaluated despite being used as an "
7125   "operand to 'typeid'">, InGroup<PotentiallyEvaluatedExpression>;
7126 def warn_unused_result : Warning<
7127   "ignoring return value of function declared with %0 attribute">,
7128   InGroup<UnusedResult>;
7129 def warn_unused_volatile : Warning<
7130   "expression result unused; assign into a variable to force a volatile load">,
7131   InGroup<DiagGroup<"unused-volatile-lvalue">>;
7132
7133 def ext_cxx14_attr : Extension<
7134   "use of the %0 attribute is a C++14 extension">, InGroup<CXX14>;
7135 def ext_cxx1z_attr : Extension<
7136   "use of the %0 attribute is a C++1z extension">, InGroup<CXX1z>;
7137
7138 def warn_unused_comparison : Warning<
7139   "%select{%select{|in}1equality|relational}0 comparison result unused">,
7140   InGroup<UnusedComparison>;
7141 def note_inequality_comparison_to_or_assign : Note<
7142   "use '|=' to turn this inequality comparison into an or-assignment">;
7143
7144 def err_incomplete_type_used_in_type_trait_expr : Error<
7145   "incomplete type %0 used in type trait expression">;
7146
7147 def err_require_constant_init_failed : Error<
7148   "variable does not have a constant initializer">;
7149 def note_declared_required_constant_init_here : Note<
7150   "required by 'require_constant_initialization' attribute here">;
7151
7152 def err_dimension_expr_not_constant_integer : Error<
7153   "dimension expression does not evaluate to a constant unsigned int">;
7154
7155 def err_typecheck_cond_incompatible_operands_null : Error<
7156   "non-pointer operand type %0 incompatible with %select{NULL|nullptr}1">;
7157 def ext_empty_struct_union : Extension<
7158   "empty %select{struct|union}0 is a GNU extension">, InGroup<GNUEmptyStruct>;
7159 def ext_no_named_members_in_struct_union : Extension<
7160   "%select{struct|union}0 without named members is a GNU extension">, InGroup<GNUEmptyStruct>;
7161 def warn_zero_size_struct_union_compat : Warning<"%select{|empty }0"
7162   "%select{struct|union}1 has size 0 in C, %select{size 1|non-zero size}2 in C++">,
7163   InGroup<CXXCompat>, DefaultIgnore;
7164 def warn_zero_size_struct_union_in_extern_c : Warning<"%select{|empty }0"
7165   "%select{struct|union}1 has size 0 in C, %select{size 1|non-zero size}2 in C++">,
7166   InGroup<ExternCCompat>;
7167 def warn_cast_qual : Warning<"cast from %0 to %1 drops %select{const and "
7168   "volatile qualifiers|const qualifier|volatile qualifier}2">,
7169   InGroup<CastQual>, DefaultIgnore;
7170 def warn_cast_qual2 : Warning<"cast from %0 to %1 must have all intermediate "
7171   "pointers const qualified to be safe">, InGroup<CastQual>, DefaultIgnore;
7172 def warn_redefine_extname_not_applied : Warning<
7173   "#pragma redefine_extname is applicable to external C declarations only; "
7174   "not applied to %select{function|variable}0 %1">,
7175   InGroup<Pragmas>;
7176 } // End of general sema category.
7177
7178 // inline asm.
7179 let CategoryName = "Inline Assembly Issue" in {
7180   def err_asm_invalid_lvalue_in_output : Error<"invalid lvalue in asm output">;
7181   def err_asm_invalid_output_constraint : Error<
7182     "invalid output constraint '%0' in asm">;
7183   def err_asm_invalid_lvalue_in_input : Error<
7184     "invalid lvalue in asm input for constraint '%0'">;
7185   def err_asm_invalid_input_constraint : Error<
7186     "invalid input constraint '%0' in asm">;
7187   def err_asm_immediate_expected : Error<"constraint '%0' expects "
7188     "an integer constant expression">;
7189   def err_asm_invalid_type_in_input : Error<
7190     "invalid type %0 in asm input for constraint '%1'">;
7191   def err_asm_tying_incompatible_types : Error<
7192     "unsupported inline asm: input with type "
7193     "%diff{$ matching output with type $|}0,1">;
7194   def err_asm_unexpected_constraint_alternatives : Error<
7195     "asm constraint has an unexpected number of alternatives: %0 vs %1">;
7196   def err_asm_incomplete_type : Error<"asm operand has incomplete type %0">;
7197   def err_asm_unknown_register_name : Error<"unknown register name '%0' in asm">;
7198   def err_asm_invalid_global_var_reg : Error<"register '%0' unsuitable for "
7199     "global register variables on this target">;
7200   def err_asm_register_size_mismatch : Error<"size of register '%0' does not "
7201     "match variable size">;
7202   def err_asm_bad_register_type : Error<"bad type for named register variable">;
7203   def err_asm_invalid_input_size : Error<
7204     "invalid input size for constraint '%0'">;
7205   def err_asm_invalid_output_size : Error<
7206     "invalid output size for constraint '%0'">;
7207   def err_invalid_asm_cast_lvalue : Error<
7208     "invalid use of a cast in a inline asm context requiring an l-value: "
7209     "remove the cast or build with -fheinous-gnu-extensions">;
7210   def err_invalid_asm_value_for_constraint
7211       : Error <"value '%0' out of range for constraint '%1'">;
7212   def err_asm_non_addr_value_in_memory_constraint : Error <
7213     "reference to a %select{bit-field|vector element|global register variable}0"
7214     " in asm %select{input|output}1 with a memory constraint '%2'">;
7215   def err_asm_input_duplicate_match : Error<
7216     "more than one input constraint matches the same output '%0'">;
7217
7218   def warn_asm_label_on_auto_decl : Warning<
7219     "ignored asm label '%0' on automatic variable">;
7220   def warn_invalid_asm_cast_lvalue : Warning<
7221     "invalid use of a cast in an inline asm context requiring an l-value: "
7222     "accepted due to -fheinous-gnu-extensions, but clang may remove support "
7223     "for this in the future">;
7224   def warn_asm_mismatched_size_modifier : Warning<
7225     "value size does not match register size specified by the constraint "
7226     "and modifier">,
7227     InGroup<ASMOperandWidths>;
7228
7229   def note_asm_missing_constraint_modifier : Note<
7230     "use constraint modifier \"%0\"">;
7231   def note_asm_input_duplicate_first : Note<
7232     "constraint '%0' is already present here">;
7233 }
7234
7235   def error_inoutput_conflict_with_clobber : Error<
7236     "asm-specifier for input or output variable conflicts with asm"
7237     " clobber list">;
7238
7239 let CategoryName = "Semantic Issue" in {
7240
7241 def err_invalid_conversion_between_vectors : Error<
7242   "invalid conversion between vector type%diff{ $ and $|}0,1 of different "
7243   "size">;
7244 def err_invalid_conversion_between_vector_and_integer : Error<
7245   "invalid conversion between vector type %0 and integer type %1 "
7246   "of different size">;
7247
7248 def err_opencl_function_pointer_variable : Error<
7249   "pointers to functions are not allowed">;
7250
7251 def err_opencl_taking_function_address : Error<
7252   "taking address of function is not allowed">;
7253
7254 def err_invalid_conversion_between_vector_and_scalar : Error<
7255   "invalid conversion between vector type %0 and scalar type %1">;
7256
7257 // C++ member initializers.
7258 def err_only_constructors_take_base_inits : Error<
7259   "only constructors take base initializers">;
7260
7261 def err_multiple_mem_initialization : Error <
7262   "multiple initializations given for non-static member %0">;
7263 def err_multiple_mem_union_initialization : Error <
7264   "initializing multiple members of union">;
7265 def err_multiple_base_initialization : Error <
7266   "multiple initializations given for base %0">;
7267
7268 def err_mem_init_not_member_or_class : Error<
7269   "member initializer %0 does not name a non-static data member or base "
7270   "class">;
7271
7272 def warn_initializer_out_of_order : Warning<
7273   "%select{field|base class}0 %1 will be initialized after "
7274   "%select{field|base}2 %3">,
7275   InGroup<Reorder>, DefaultIgnore;
7276 def warn_abstract_vbase_init_ignored : Warning<
7277   "initializer for virtual base class %0 of abstract class %1 "
7278   "will never be used">,
7279   InGroup<DiagGroup<"abstract-vbase-init">>, DefaultIgnore;
7280
7281 def err_base_init_does_not_name_class : Error<
7282   "constructor initializer %0 does not name a class">;
7283 def err_base_init_direct_and_virtual : Error<
7284   "base class initializer %0 names both a direct base class and an "
7285   "inherited virtual base class">;
7286 def err_not_direct_base_or_virtual : Error<
7287   "type %0 is not a direct or virtual base of %1">;
7288
7289 def err_in_class_initializer_non_const : Error<
7290   "non-const static data member must be initialized out of line">;
7291 def err_in_class_initializer_volatile : Error<
7292   "static const volatile data member must be initialized out of line">;
7293 def err_in_class_initializer_bad_type : Error<
7294   "static data member of type %0 must be initialized out of line">;
7295 def ext_in_class_initializer_float_type : ExtWarn<
7296   "in-class initializer for static data member of type %0 is a GNU extension">,
7297   InGroup<GNUStaticFloatInit>;
7298 def ext_in_class_initializer_float_type_cxx11 : ExtWarn<
7299   "in-class initializer for static data member of type %0 requires "
7300   "'constexpr' specifier">, InGroup<StaticFloatInit>, DefaultError;
7301 def note_in_class_initializer_float_type_cxx11 : Note<"add 'constexpr'">;
7302 def err_in_class_initializer_literal_type : Error<
7303   "in-class initializer for static data member of type %0 requires "
7304   "'constexpr' specifier">;
7305 def err_in_class_initializer_non_constant : Error<
7306   "in-class initializer for static data member is not a constant expression">;
7307 def err_in_class_initializer_not_yet_parsed : Error<
7308   "default member initializer for %1 needed within definition of enclosing "
7309   "class %0 outside of member functions">;
7310 def note_in_class_initializer_not_yet_parsed : Note<
7311   "default member initializer declared here">;
7312 def err_in_class_initializer_cycle
7313     : Error<"default member initializer for %0 uses itself">;
7314 def err_exception_spec_cycle
7315     : Error<"exception specification of %0 uses itself">;
7316
7317 def ext_in_class_initializer_non_constant : Extension<
7318   "in-class initializer for static data member is not a constant expression; "
7319   "folding it to a constant is a GNU extension">, InGroup<GNUFoldingConstant>;
7320
7321 def err_thread_dynamic_init : Error<
7322   "initializer for thread-local variable must be a constant expression">;
7323 def err_thread_nontrivial_dtor : Error<
7324   "type of thread-local variable has non-trivial destruction">;
7325 def note_use_thread_local : Note<
7326   "use 'thread_local' to allow this">;
7327
7328 // C++ anonymous unions and GNU anonymous structs/unions
7329 def ext_anonymous_union : Extension<
7330   "anonymous unions are a C11 extension">, InGroup<C11>;
7331 def ext_gnu_anonymous_struct : Extension<
7332   "anonymous structs are a GNU extension">, InGroup<GNUAnonymousStruct>;
7333 def ext_c11_anonymous_struct : Extension<
7334   "anonymous structs are a C11 extension">, InGroup<C11>;
7335 def err_anonymous_union_not_static : Error<
7336   "anonymous unions at namespace or global scope must be declared 'static'">;
7337 def err_anonymous_union_with_storage_spec : Error<
7338   "anonymous union at class scope must not have a storage specifier">;
7339 def err_anonymous_struct_not_member : Error<
7340   "anonymous %select{structs|structs and classes}0 must be "
7341   "%select{struct or union|class}0 members">;
7342 def err_anonymous_record_member_redecl : Error<
7343   "member of anonymous %select{struct|union}0 redeclares %1">;
7344 def err_anonymous_record_with_type : Error<
7345   "types cannot be declared in an anonymous %select{struct|union}0">;
7346 def ext_anonymous_record_with_type : Extension<
7347   "types declared in an anonymous %select{struct|union}0 are a Microsoft "
7348   "extension">, InGroup<MicrosoftAnonTag>;
7349 def ext_anonymous_record_with_anonymous_type : Extension<
7350   "anonymous types declared in an anonymous %select{struct|union}0 "
7351   "are an extension">, InGroup<DiagGroup<"nested-anon-types">>;
7352 def err_anonymous_record_with_function : Error<
7353   "functions cannot be declared in an anonymous %select{struct|union}0">;
7354 def err_anonymous_record_with_static : Error<
7355   "static members cannot be declared in an anonymous %select{struct|union}0">;
7356 def err_anonymous_record_bad_member : Error<
7357   "anonymous %select{struct|union}0 can only contain non-static data members">;
7358 def err_anonymous_record_nonpublic_member : Error<
7359   "anonymous %select{struct|union}0 cannot contain a "
7360   "%select{private|protected}1 data member">;
7361 def ext_ms_anonymous_record : ExtWarn<
7362   "anonymous %select{structs|unions}0 are a Microsoft extension">,
7363   InGroup<MicrosoftAnonTag>;
7364
7365 // C++ local classes
7366 def err_reference_to_local_in_enclosing_context : Error<
7367   "reference to local %select{variable|binding}1 %0 declared in enclosing "
7368   "%select{%3|block literal|lambda expression|context}2">;
7369
7370 def err_static_data_member_not_allowed_in_local_class : Error<
7371   "static data member %0 not allowed in local class %1">; 
7372   
7373 // C++ derived classes
7374 def err_base_clause_on_union : Error<"unions cannot have base classes">;
7375 def err_base_must_be_class : Error<"base specifier must name a class">;
7376 def err_union_as_base_class : Error<"unions cannot be base classes">;
7377 def err_circular_inheritance : Error<
7378   "circular inheritance between %0 and %1">;
7379 def err_base_class_has_flexible_array_member : Error<
7380   "base class %0 has a flexible array member">;
7381 def err_incomplete_base_class : Error<"base class has incomplete type">;
7382 def err_duplicate_base_class : Error<
7383   "base class %0 specified more than once as a direct base class">;
7384 def warn_inaccessible_base_class : Warning<
7385   "direct base %0 is inaccessible due to ambiguity:%1">,
7386   InGroup<DiagGroup<"inaccessible-base">>;
7387 // FIXME: better way to display derivation?  Pass entire thing into diagclient?
7388 def err_ambiguous_derived_to_base_conv : Error<
7389   "ambiguous conversion from derived class %0 to base class %1:%2">;
7390 def err_ambiguous_memptr_conv : Error<
7391   "ambiguous conversion from pointer to member of %select{base|derived}0 "
7392   "class %1 to pointer to member of %select{derived|base}0 class %2:%3">;
7393
7394 def err_memptr_conv_via_virtual : Error<
7395   "conversion from pointer to member of class %0 to pointer to member "
7396   "of class %1 via virtual base %2 is not allowed">;
7397
7398 // C++ member name lookup
7399 def err_ambiguous_member_multiple_subobjects : Error<
7400   "non-static member %0 found in multiple base-class subobjects of type %1:%2">;
7401 def err_ambiguous_member_multiple_subobject_types : Error<
7402   "member %0 found in multiple base classes of different types">;
7403 def note_ambiguous_member_found : Note<"member found by ambiguous name lookup">;
7404 def err_ambiguous_reference : Error<"reference to %0 is ambiguous">;
7405 def note_ambiguous_candidate : Note<"candidate found by name lookup is %q0">;
7406 def err_ambiguous_tag_hiding : Error<"a type named %0 is hidden by a "
7407   "declaration in a different namespace">;
7408 def note_hidden_tag : Note<"type declaration hidden">;
7409 def note_hiding_object : Note<"declaration hides type">;
7410
7411 // C++ operator overloading
7412 def err_operator_overload_needs_class_or_enum : Error<
7413   "overloaded %0 must have at least one parameter of class "
7414   "or enumeration type">;
7415
7416 def err_operator_overload_variadic : Error<"overloaded %0 cannot be variadic">;
7417 def err_operator_overload_static : Error<
7418   "overloaded %0 cannot be a static member function">;
7419 def err_operator_overload_default_arg : Error<
7420   "parameter of overloaded %0 cannot have a default argument">;
7421 def err_operator_overload_must_be : Error<
7422   "overloaded %0 must be a %select{unary|binary|unary or binary}2 operator "
7423   "(has %1 parameter%s1)">;
7424
7425 def err_operator_overload_must_be_member : Error<
7426   "overloaded %0 must be a non-static member function">;
7427 def err_operator_overload_post_incdec_must_be_int : Error<
7428   "parameter of overloaded post-%select{increment|decrement}1 operator must "
7429   "have type 'int' (not %0)">;
7430
7431 // C++ allocation and deallocation functions.
7432 def err_operator_new_delete_declared_in_namespace : Error<
7433   "%0 cannot be declared inside a namespace">;
7434 def err_operator_new_delete_declared_static : Error<
7435   "%0 cannot be declared static in global scope">;
7436 def ext_operator_new_delete_declared_inline : ExtWarn<
7437   "replacement function %0 cannot be declared 'inline'">,
7438   InGroup<DiagGroup<"inline-new-delete">>;
7439 def err_operator_new_delete_invalid_result_type : Error<
7440   "%0 must return type %1">;
7441 def err_operator_new_delete_dependent_result_type : Error<
7442   "%0 cannot have a dependent return type; use %1 instead">;
7443 def err_operator_new_delete_too_few_parameters : Error<
7444   "%0 must have at least one parameter">;
7445 def err_operator_new_delete_template_too_few_parameters : Error<
7446   "%0 template must have at least two parameters">;
7447 def warn_operator_new_returns_null : Warning<
7448   "%0 should not return a null pointer unless it is declared 'throw()'"
7449   "%select{| or 'noexcept'}1">, InGroup<OperatorNewReturnsNull>;
7450
7451 def err_operator_new_dependent_param_type : Error<
7452   "%0 cannot take a dependent type as first parameter; "
7453   "use size_t (%1) instead">;
7454 def err_operator_new_param_type : Error<
7455   "%0 takes type size_t (%1) as first parameter">;
7456 def err_operator_new_default_arg: Error<
7457   "parameter of %0 cannot have a default argument">;
7458 def err_operator_delete_dependent_param_type : Error<
7459   "%0 cannot take a dependent type as first parameter; use %1 instead">;
7460 def err_operator_delete_param_type : Error<
7461   "first parameter of %0 must have type %1">;
7462
7463 // C++ literal operators
7464 def err_literal_operator_outside_namespace : Error<
7465   "literal operator %0 must be in a namespace or global scope">;
7466 def err_literal_operator_id_outside_namespace : Error<
7467   "non-namespace scope '%0' cannot have a literal operator member">;
7468 def err_literal_operator_default_argument : Error<
7469   "literal operator cannot have a default argument">;
7470 def err_literal_operator_bad_param_count : Error<
7471   "non-template literal operator must have one or two parameters">;
7472 def err_literal_operator_invalid_param : Error<
7473   "parameter of literal operator must have type 'unsigned long long', 'long double', 'char', 'wchar_t', 'char16_t', 'char32_t', or 'const char *'">;
7474 def err_literal_operator_param : Error<
7475   "invalid literal operator parameter type %0, did you mean %1?">;
7476 def err_literal_operator_template_with_params : Error<
7477   "literal operator template cannot have any parameters">;
7478 def err_literal_operator_template : Error<
7479   "template parameter list for literal operator must be either 'char...' or 'typename T, T...'">;
7480 def err_literal_operator_extern_c : Error<
7481   "literal operator must have C++ linkage">;
7482 def ext_string_literal_operator_template : ExtWarn<
7483   "string literal operator templates are a GNU extension">,
7484   InGroup<GNUStringLiteralOperatorTemplate>;
7485 def warn_user_literal_reserved : Warning<
7486   "user-defined literal suffixes not starting with '_' are reserved"
7487   "%select{; no literal will invoke this operator|}0">,
7488   InGroup<UserDefinedLiterals>;
7489
7490 // C++ conversion functions
7491 def err_conv_function_not_member : Error<
7492   "conversion function must be a non-static member function">;
7493 def err_conv_function_return_type : Error<
7494   "conversion function cannot have a return type">;
7495 def err_conv_function_with_params : Error<
7496   "conversion function cannot have any parameters">;
7497 def err_conv_function_variadic : Error<
7498   "conversion function cannot be variadic">;
7499 def err_conv_function_to_array : Error<
7500   "conversion function cannot convert to an array type">;
7501 def err_conv_function_to_function : Error<
7502   "conversion function cannot convert to a function type">;
7503 def err_conv_function_with_complex_decl : Error<
7504   "cannot specify any part of a return type in the "
7505   "declaration of a conversion function"
7506   "%select{"
7507   "; put the complete type after 'operator'|"
7508   "; use a typedef to declare a conversion to %1|"
7509   "; use an alias template to declare a conversion to %1|"
7510   "}0">;
7511 def err_conv_function_redeclared : Error<
7512   "conversion function cannot be redeclared">;
7513 def warn_conv_to_self_not_used : Warning<
7514   "conversion function converting %0 to itself will never be used">;
7515 def warn_conv_to_base_not_used : Warning<
7516   "conversion function converting %0 to its base class %1 will never be used">;
7517 def warn_conv_to_void_not_used : Warning<
7518   "conversion function converting %0 to %1 will never be used">;
7519
7520 def warn_not_compound_assign : Warning<
7521   "use of unary operator that may be intended as compound assignment (%0=)">;
7522
7523 // C++11 explicit conversion operators
7524 def ext_explicit_conversion_functions : ExtWarn<
7525   "explicit conversion functions are a C++11 extension">, InGroup<CXX11>;
7526 def warn_cxx98_compat_explicit_conversion_functions : Warning<
7527   "explicit conversion functions are incompatible with C++98">,
7528   InGroup<CXX98Compat>, DefaultIgnore;
7529
7530 // C++11 defaulted functions
7531 def err_defaulted_special_member_params : Error<
7532   "an explicitly-defaulted %select{|copy |move }0constructor cannot "
7533   "have default arguments">;
7534 def err_defaulted_special_member_variadic : Error<
7535   "an explicitly-defaulted %select{|copy |move }0constructor cannot "
7536   "be variadic">;
7537 def err_defaulted_special_member_return_type : Error<
7538   "explicitly-defaulted %select{copy|move}0 assignment operator must "
7539   "return %1">;
7540 def err_defaulted_special_member_quals : Error<
7541   "an explicitly-defaulted %select{copy|move}0 assignment operator may not "
7542   "have 'const'%select{, 'constexpr'|}1 or 'volatile' qualifiers">;
7543 def err_defaulted_special_member_volatile_param : Error<
7544   "the parameter for an explicitly-defaulted %select{<<ERROR>>|"
7545   "copy constructor|move constructor|copy assignment operator|"
7546   "move assignment operator|<<ERROR>>}0 may not be volatile">;
7547 def err_defaulted_special_member_move_const_param : Error<
7548   "the parameter for an explicitly-defaulted move "
7549   "%select{constructor|assignment operator}0 may not be const">;
7550 def err_defaulted_special_member_copy_const_param : Error<
7551   "the parameter for this explicitly-defaulted copy "
7552   "%select{constructor|assignment operator}0 is const, but a member or base "
7553   "requires it to be non-const">;
7554 def err_defaulted_copy_assign_not_ref : Error<
7555   "the parameter for an explicitly-defaulted copy assignment operator must be an "
7556   "lvalue reference type">;
7557 def err_incorrect_defaulted_exception_spec : Error<
7558   "exception specification of explicitly defaulted %select{default constructor|"
7559   "copy constructor|move constructor|copy assignment operator|move assignment "
7560   "operator|destructor}0 does not match the "
7561   "calculated one">;
7562 def err_incorrect_defaulted_constexpr : Error<
7563   "defaulted definition of %select{default constructor|copy constructor|"
7564   "move constructor|copy assignment operator|move assignment operator}0 "
7565   "is not constexpr">;
7566 def err_out_of_line_default_deletes : Error<
7567   "defaulting this %select{default constructor|copy constructor|move "
7568   "constructor|copy assignment operator|move assignment operator|destructor}0 "
7569   "would delete it after its first declaration">;
7570 def warn_vbase_moved_multiple_times : Warning<
7571   "defaulted move assignment operator of %0 will move assign virtual base "
7572   "class %1 multiple times">, InGroup<DiagGroup<"multiple-move-vbase">>;
7573 def note_vbase_moved_here : Note<
7574   "%select{%1 is a virtual base class of base class %2 declared here|"
7575   "virtual base class %1 declared here}0">;
7576
7577 def ext_implicit_exception_spec_mismatch : ExtWarn<
7578   "function previously declared with an %select{explicit|implicit}0 exception "
7579   "specification redeclared with an %select{implicit|explicit}0 exception "
7580   "specification">, InGroup<DiagGroup<"implicit-exception-spec-mismatch">>;
7581
7582 def warn_ptr_arith_precedes_bounds : Warning<
7583   "the pointer decremented by %0 refers before the beginning of the array">,
7584   InGroup<ArrayBoundsPointerArithmetic>, DefaultIgnore;
7585 def warn_ptr_arith_exceeds_bounds : Warning<
7586   "the pointer incremented by %0 refers past the end of the array (that "
7587   "contains %1 element%s2)">,
7588   InGroup<ArrayBoundsPointerArithmetic>, DefaultIgnore;
7589 def warn_array_index_precedes_bounds : Warning<
7590   "array index %0 is before the beginning of the array">,
7591   InGroup<ArrayBounds>;
7592 def warn_array_index_exceeds_bounds : Warning<
7593   "array index %0 is past the end of the array (which contains %1 "
7594   "element%s2)">, InGroup<ArrayBounds>;
7595 def note_array_index_out_of_bounds : Note<
7596   "array %0 declared here">;
7597
7598 def warn_printf_insufficient_data_args : Warning<
7599   "more '%%' conversions than data arguments">, InGroup<Format>;
7600 def warn_printf_data_arg_not_used : Warning<
7601   "data argument not used by format string">, InGroup<FormatExtraArgs>;
7602 def warn_format_invalid_conversion : Warning<
7603   "invalid conversion specifier '%0'">, InGroup<FormatInvalidSpecifier>;
7604 def warn_printf_incomplete_specifier : Warning<
7605   "incomplete format specifier">, InGroup<Format>;
7606 def warn_missing_format_string : Warning<
7607   "format string missing">, InGroup<Format>;
7608 def warn_scanf_nonzero_width : Warning<
7609   "zero field width in scanf format string is unused">,
7610   InGroup<Format>;
7611 def warn_format_conversion_argument_type_mismatch : Warning<
7612   "format specifies type %0 but the argument has "
7613   "%select{type|underlying type}2 %1">,
7614   InGroup<Format>;
7615 def warn_format_conversion_argument_type_mismatch_pedantic : Extension<
7616   "format specifies type %0 but the argument has "
7617   "%select{type|underlying type}2 %1">,
7618   InGroup<FormatPedantic>;
7619 def warn_format_argument_needs_cast : Warning<
7620   "%select{values of type|enum values with underlying type}2 '%0' should not "
7621   "be used as format arguments; add an explicit cast to %1 instead">,
7622   InGroup<Format>;
7623 def warn_printf_positional_arg_exceeds_data_args : Warning <
7624   "data argument position '%0' exceeds the number of data arguments (%1)">,
7625   InGroup<Format>;
7626 def warn_format_zero_positional_specifier : Warning<
7627   "position arguments in format strings start counting at 1 (not 0)">,
7628   InGroup<Format>;
7629 def warn_format_invalid_positional_specifier : Warning<
7630   "invalid position specified for %select{field width|field precision}0">,
7631   InGroup<Format>;
7632 def warn_format_mix_positional_nonpositional_args : Warning<
7633   "cannot mix positional and non-positional arguments in format string">,
7634   InGroup<Format>;
7635 def warn_static_array_too_small : Warning<
7636   "array argument is too small; contains %0 elements, callee requires at least %1">,
7637   InGroup<ArrayBounds>;
7638 def note_callee_static_array : Note<
7639   "callee declares array parameter as static here">;
7640 def warn_empty_format_string : Warning<
7641   "format string is empty">, InGroup<FormatZeroLength>;
7642 def warn_format_string_is_wide_literal : Warning<
7643   "format string should not be a wide string">, InGroup<Format>;
7644 def warn_printf_format_string_contains_null_char : Warning<
7645   "format string contains '\\0' within the string body">, InGroup<Format>;
7646 def warn_printf_format_string_not_null_terminated : Warning<
7647   "format string is not null-terminated">, InGroup<Format>;
7648 def warn_printf_asterisk_missing_arg : Warning<
7649   "'%select{*|.*}0' specified field %select{width|precision}0 is missing a matching 'int' argument">,
7650   InGroup<Format>;
7651 def warn_printf_asterisk_wrong_type : Warning<
7652   "field %select{width|precision}0 should have type %1, but argument has type %2">,
7653   InGroup<Format>;
7654 def warn_printf_nonsensical_optional_amount: Warning<
7655   "%select{field width|precision}0 used with '%1' conversion specifier, resulting in undefined behavior">,
7656   InGroup<Format>;
7657 def warn_printf_nonsensical_flag: Warning<
7658   "flag '%0' results in undefined behavior with '%1' conversion specifier">,
7659   InGroup<Format>;
7660 def warn_format_nonsensical_length: Warning<
7661   "length modifier '%0' results in undefined behavior or no effect with '%1' conversion specifier">,
7662   InGroup<Format>;
7663 def warn_format_non_standard_positional_arg: Warning<
7664   "positional arguments are not supported by ISO C">, InGroup<FormatNonStandard>, DefaultIgnore;
7665 def warn_format_non_standard: Warning<
7666   "'%0' %select{length modifier|conversion specifier}1 is not supported by ISO C">,
7667   InGroup<FormatNonStandard>, DefaultIgnore;
7668 def warn_format_non_standard_conversion_spec: Warning<
7669   "using length modifier '%0' with conversion specifier '%1' is not supported by ISO C">,
7670   InGroup<FormatNonStandard>, DefaultIgnore;
7671 def warn_format_invalid_annotation : Warning<
7672   "using '%0' format specifier annotation outside of os_log()/os_trace()">,
7673   InGroup<Format>;
7674 def warn_format_P_no_precision : Warning<
7675   "using '%%P' format specifier without precision">,
7676   InGroup<Format>;
7677 def warn_printf_ignored_flag: Warning<
7678   "flag '%0' is ignored when flag '%1' is present">,
7679   InGroup<Format>;
7680 def warn_printf_empty_objc_flag: Warning<
7681   "missing object format flag">,
7682   InGroup<Format>;
7683 def warn_printf_ObjCflags_without_ObjCConversion: Warning<
7684   "object format flags cannot be used with '%0' conversion specifier">,
7685   InGroup<Format>;
7686 def warn_printf_invalid_objc_flag: Warning<
7687     "'%0' is not a valid object format flag">,
7688     InGroup<Format>;
7689 def warn_scanf_scanlist_incomplete : Warning<
7690   "no closing ']' for '%%[' in scanf format string">,
7691   InGroup<Format>;
7692 def note_format_string_defined : Note<"format string is defined here">;
7693 def note_format_fix_specifier : Note<"did you mean to use '%0'?">;
7694 def note_printf_c_str: Note<"did you mean to call the %0 method?">;
7695 def note_format_security_fixit: Note<
7696   "treat the string as an argument to avoid this">;
7697
7698 def warn_null_arg : Warning<
7699   "null passed to a callee that requires a non-null argument">,
7700   InGroup<NonNull>;
7701 def warn_null_ret : Warning<
7702   "null returned from %select{function|method}0 that requires a non-null return value">,
7703   InGroup<NonNull>;
7704
7705 // CHECK: returning address/reference of stack memory
7706 def warn_ret_stack_addr_ref : Warning<
7707   "%select{address of|reference to}0 stack memory associated with local "
7708   "variable %1 returned">,
7709   InGroup<ReturnStackAddress>;
7710 def warn_ret_local_temp_addr_ref : Warning<
7711   "returning %select{address of|reference to}0 local temporary object">,
7712   InGroup<ReturnStackAddress>;
7713 def warn_ret_addr_label : Warning<
7714   "returning address of label, which is local">,
7715   InGroup<ReturnStackAddress>;
7716 def err_ret_local_block : Error<
7717   "returning block that lives on the local stack">;
7718 def note_ref_var_local_bind : Note<
7719   "binding reference variable %0 here">;
7720
7721 // Check for initializing a member variable with the address or a reference to
7722 // a constructor parameter.
7723 def warn_bind_ref_member_to_parameter : Warning<
7724   "binding reference member %0 to stack allocated parameter %1">,
7725   InGroup<DanglingField>;
7726 def warn_init_ptr_member_to_parameter_addr : Warning<
7727   "initializing pointer member %0 with the stack address of parameter %1">,
7728   InGroup<DanglingField>;
7729 def warn_bind_ref_member_to_temporary : Warning<
7730   "binding reference %select{|subobject of }1member %0 to a temporary value">,
7731   InGroup<DanglingField>;
7732 def note_ref_or_ptr_member_declared_here : Note<
7733   "%select{reference|pointer}0 member declared here">;
7734 def note_ref_subobject_of_member_declared_here : Note<
7735   "member with reference subobject declared here">;
7736
7737 // For non-floating point, expressions of the form x == x or x != x
7738 // should result in a warning, since these always evaluate to a constant.
7739 // Array comparisons have similar warnings
7740 def warn_comparison_always : Warning<
7741   "%select{self-|array }0comparison always evaluates to %select{false|true|a constant}1">,
7742   InGroup<TautologicalCompare>;
7743 def warn_comparison_bitwise_always : Warning<
7744   "bitwise comparison always evaluates to %select{false|true}0">,
7745   InGroup<TautologicalCompare>;
7746 def warn_tautological_overlap_comparison : Warning<
7747   "overlapping comparisons always evaluate to %select{false|true}0">,
7748   InGroup<TautologicalOverlapCompare>, DefaultIgnore;
7749
7750 def warn_stringcompare : Warning<
7751   "result of comparison against %select{a string literal|@encode}0 is "
7752   "unspecified (use strncmp instead)">,
7753   InGroup<StringCompare>;
7754
7755 def warn_identity_field_assign : Warning<
7756   "assigning %select{field|instance variable}0 to itself">,
7757   InGroup<SelfAssignmentField>;
7758
7759 // Type safety attributes
7760 def err_type_tag_for_datatype_not_ice : Error<
7761   "'type_tag_for_datatype' attribute requires the initializer to be "
7762   "an %select{integer|integral}0 constant expression">;
7763 def err_type_tag_for_datatype_too_large : Error<
7764   "'type_tag_for_datatype' attribute requires the initializer to be "
7765   "an %select{integer|integral}0 constant expression "
7766   "that can be represented by a 64 bit integer">;
7767 def warn_type_tag_for_datatype_wrong_kind : Warning<
7768   "this type tag was not designed to be used with this function">,
7769   InGroup<TypeSafety>;
7770 def warn_type_safety_type_mismatch : Warning<
7771   "argument type %0 doesn't match specified %1 type tag "
7772   "%select{that requires %3|}2">, InGroup<TypeSafety>;
7773 def warn_type_safety_null_pointer_required : Warning<
7774   "specified %0 type tag requires a null pointer">, InGroup<TypeSafety>;
7775
7776 // Generic selections.
7777 def err_assoc_type_incomplete : Error<
7778   "type %0 in generic association incomplete">;
7779 def err_assoc_type_nonobject : Error<
7780   "type %0 in generic association not an object type">;
7781 def err_assoc_type_variably_modified : Error<
7782   "type %0 in generic association is a variably modified type">;
7783 def err_assoc_compatible_types : Error<
7784   "type %0 in generic association compatible with previously specified type %1">;
7785 def note_compat_assoc : Note<
7786   "compatible type %0 specified here">;
7787 def err_generic_sel_no_match : Error<
7788   "controlling expression type %0 not compatible with any generic association type">;
7789 def err_generic_sel_multi_match : Error<
7790   "controlling expression type %0 compatible with %1 generic association types">;
7791
7792
7793 // Blocks
7794 def err_blocks_disable : Error<"blocks support disabled - compile with -fblocks"
7795   " or %select{pick a deployment target that supports them|for OpenCL 2.0 or above}0">;
7796 def err_block_returning_array_function : Error<
7797   "block cannot return %select{array|function}0 type %1">;
7798
7799 // Builtin annotation
7800 def err_builtin_annotation_first_arg : Error<
7801   "first argument to __builtin_annotation must be an integer">;
7802 def err_builtin_annotation_second_arg : Error<
7803   "second argument to __builtin_annotation must be a non-wide string constant">;
7804
7805 // CFString checking
7806 def err_cfstring_literal_not_string_constant : Error<
7807   "CFString literal is not a string constant">;
7808 def warn_cfstring_truncated : Warning<
7809   "input conversion stopped due to an input byte that does not "
7810   "belong to the input codeset UTF-8">,
7811   InGroup<DiagGroup<"CFString-literal">>;
7812
7813 // os_log checking
7814 // TODO: separate diagnostic for os_trace()
7815 def err_os_log_format_not_string_constant : Error<
7816   "os_log() format argument is not a string constant">;
7817 def err_os_log_argument_too_big : Error<
7818   "os_log() argument %0 is too big (%1 bytes, max %2)">;
7819 def warn_os_log_format_narg : Error<
7820  "os_log() '%%n' format specifier is not allowed">, DefaultError;
7821
7822 // Statements.
7823 def err_continue_not_in_loop : Error<
7824   "'continue' statement not in loop statement">;
7825 def err_break_not_in_loop_or_switch : Error<
7826   "'break' statement not in loop or switch statement">;
7827 def warn_loop_ctrl_binds_to_inner : Warning<
7828   "'%0' is bound to current loop, GCC binds it to the enclosing loop">,
7829   InGroup<GccCompat>;
7830 def warn_break_binds_to_switch : Warning<
7831   "'break' is bound to loop, GCC binds it to switch">,
7832   InGroup<GccCompat>;
7833 def err_default_not_in_switch : Error<
7834   "'default' statement not in switch statement">;
7835 def err_case_not_in_switch : Error<"'case' statement not in switch statement">;
7836 def warn_bool_switch_condition : Warning<
7837   "switch condition has boolean value">, InGroup<SwitchBool>;
7838 def warn_case_value_overflow : Warning<
7839   "overflow converting case value to switch condition type (%0 to %1)">,
7840   InGroup<Switch>;
7841 def err_duplicate_case : Error<"duplicate case value '%0'">;
7842 def err_duplicate_case_differing_expr : Error<
7843   "duplicate case value: '%0' and '%1' both equal '%2'">;
7844 def warn_case_empty_range : Warning<"empty case range specified">;
7845 def warn_missing_case_for_condition :
7846   Warning<"no case matching constant switch condition '%0'">;
7847
7848 def warn_def_missing_case : Warning<"%plural{"
7849   "1:enumeration value %1 not explicitly handled in switch|"
7850   "2:enumeration values %1 and %2 not explicitly handled in switch|"
7851   "3:enumeration values %1, %2, and %3 not explicitly handled in switch|"
7852   ":%0 enumeration values not explicitly handled in switch: %1, %2, %3...}0">,
7853   InGroup<SwitchEnum>, DefaultIgnore;
7854
7855 def warn_missing_case : Warning<"%plural{"
7856   "1:enumeration value %1 not handled in switch|"
7857   "2:enumeration values %1 and %2 not handled in switch|"
7858   "3:enumeration values %1, %2, and %3 not handled in switch|"
7859   ":%0 enumeration values not handled in switch: %1, %2, %3...}0">,
7860   InGroup<Switch>;
7861
7862 def warn_unannotated_fallthrough : Warning<
7863   "unannotated fall-through between switch labels">,
7864   InGroup<ImplicitFallthrough>, DefaultIgnore;
7865 def warn_unannotated_fallthrough_per_function : Warning<
7866   "unannotated fall-through between switch labels in partly-annotated "
7867   "function">, InGroup<ImplicitFallthroughPerFunction>, DefaultIgnore;
7868 def note_insert_fallthrough_fixit : Note<
7869   "insert '%0;' to silence this warning">;
7870 def note_insert_break_fixit : Note<
7871   "insert 'break;' to avoid fall-through">;
7872 def err_fallthrough_attr_wrong_target : Error<
7873   "%0 attribute is only allowed on empty statements">;
7874 def note_fallthrough_insert_semi_fixit : Note<"did you forget ';'?">;
7875 def err_fallthrough_attr_outside_switch : Error<
7876   "fallthrough annotation is outside switch statement">;
7877 def err_fallthrough_attr_invalid_placement : Error<
7878   "fallthrough annotation does not directly precede switch label">;
7879 def warn_fallthrough_attr_unreachable : Warning<
7880   "fallthrough annotation in unreachable code">,
7881   InGroup<ImplicitFallthrough>, DefaultIgnore;
7882
7883 def warn_unreachable_default : Warning<
7884   "default label in switch which covers all enumeration values">,
7885   InGroup<CoveredSwitchDefault>, DefaultIgnore;
7886 def warn_not_in_enum : Warning<"case value not in enumerated type %0">,
7887   InGroup<Switch>;
7888 def warn_not_in_enum_assignment : Warning<"integer constant not in range "
7889   "of enumerated type %0">, InGroup<DiagGroup<"assign-enum">>, DefaultIgnore;
7890 def err_typecheck_statement_requires_scalar : Error<
7891   "statement requires expression of scalar type (%0 invalid)">;
7892 def err_typecheck_statement_requires_integer : Error<
7893   "statement requires expression of integer type (%0 invalid)">;
7894 def err_multiple_default_labels_defined : Error<
7895   "multiple default labels in one switch">;
7896 def err_switch_multiple_conversions : Error<
7897   "multiple conversions from switch condition type %0 to an integral or "
7898   "enumeration type">;
7899 def note_switch_conversion : Note<
7900   "conversion to %select{integral|enumeration}0 type %1">;
7901 def err_switch_explicit_conversion : Error<
7902   "switch condition type %0 requires explicit conversion to %1">;
7903 def err_switch_incomplete_class_type : Error<
7904   "switch condition has incomplete class type %0">;
7905
7906 def warn_empty_if_body : Warning<
7907   "if statement has empty body">, InGroup<EmptyBody>;
7908 def warn_empty_for_body : Warning<
7909   "for loop has empty body">, InGroup<EmptyBody>;
7910 def warn_empty_range_based_for_body : Warning<
7911   "range-based for loop has empty body">, InGroup<EmptyBody>;
7912 def warn_empty_while_body : Warning<
7913   "while loop has empty body">, InGroup<EmptyBody>;
7914 def warn_empty_switch_body : Warning<
7915   "switch statement has empty body">, InGroup<EmptyBody>;
7916 def note_empty_body_on_separate_line : Note<
7917   "put the semicolon on a separate line to silence this warning">;
7918
7919 def err_va_start_used_in_non_variadic_function : Error<
7920   "'va_start' used in function with fixed args">;
7921 def err_va_start_used_in_wrong_abi_function : Error<
7922   "'va_start' used in %select{System V|Win64}0 ABI function">;
7923 def err_ms_va_start_used_in_sysv_function : Error<
7924   "'__builtin_ms_va_start' used in System V ABI function">;
7925 def warn_second_arg_of_va_start_not_last_named_param : Warning<
7926   "second argument to 'va_start' is not the last named parameter">,
7927   InGroup<Varargs>;
7928 def warn_va_start_type_is_undefined : Warning<
7929   "passing %select{an object that undergoes default argument promotion|"
7930   "an object of reference type|a parameter declared with the 'register' "
7931   "keyword}0 to 'va_start' has undefined behavior">, InGroup<Varargs>;
7932 def err_first_argument_to_va_arg_not_of_type_va_list : Error<
7933   "first argument to 'va_arg' is of type %0 and not 'va_list'">;
7934 def err_second_parameter_to_va_arg_incomplete: Error<
7935   "second argument to 'va_arg' is of incomplete type %0">;
7936 def err_second_parameter_to_va_arg_abstract: Error<
7937   "second argument to 'va_arg' is of abstract type %0">;
7938 def warn_second_parameter_to_va_arg_not_pod : Warning<
7939   "second argument to 'va_arg' is of non-POD type %0">,
7940   InGroup<NonPODVarargs>, DefaultError;
7941 def warn_second_parameter_to_va_arg_ownership_qualified : Warning<
7942   "second argument to 'va_arg' is of ARC ownership-qualified type %0">,
7943   InGroup<NonPODVarargs>, DefaultError;
7944 def warn_second_parameter_to_va_arg_never_compatible : Warning<
7945   "second argument to 'va_arg' is of promotable type %0; this va_arg has "
7946   "undefined behavior because arguments will be promoted to %1">, InGroup<Varargs>;
7947
7948 def warn_return_missing_expr : Warning<
7949   "non-void %select{function|method}1 %0 should return a value">, DefaultError,
7950   InGroup<ReturnType>;
7951 def ext_return_missing_expr : ExtWarn<
7952   "non-void %select{function|method}1 %0 should return a value">, DefaultError,
7953   InGroup<ReturnType>;
7954 def ext_return_has_expr : ExtWarn<
7955   "%select{void function|void method|constructor|destructor}1 %0 "
7956   "should not return a value">,
7957   DefaultError, InGroup<ReturnType>;
7958 def ext_return_has_void_expr : Extension<
7959   "void %select{function|method|block}1 %0 should not return void expression">;
7960 def err_return_init_list : Error<
7961   "%select{void function|void method|constructor|destructor}1 %0 "
7962   "must not return a value">;
7963 def err_ctor_dtor_returns_void : Error<
7964   "%select{constructor|destructor}1 %0 must not return void expression">;
7965 def warn_noreturn_function_has_return_expr : Warning<
7966   "function %0 declared 'noreturn' should not return">,
7967   InGroup<InvalidNoreturn>;
7968 def warn_falloff_noreturn_function : Warning<
7969   "function declared 'noreturn' should not return">,
7970   InGroup<InvalidNoreturn>;
7971 def err_noreturn_block_has_return_expr : Error<
7972   "block declared 'noreturn' should not return">;
7973 def err_noreturn_missing_on_first_decl : Error<
7974   "function declared '[[noreturn]]' after its first declaration">;
7975 def note_noreturn_missing_first_decl : Note<
7976   "declaration missing '[[noreturn]]' attribute is here">;
7977 def err_carries_dependency_missing_on_first_decl : Error<
7978   "%select{function|parameter}0 declared '[[carries_dependency]]' "
7979   "after its first declaration">;
7980 def note_carries_dependency_missing_first_decl : Note<
7981   "declaration missing '[[carries_dependency]]' attribute is here">;
7982 def err_carries_dependency_param_not_function_decl : Error<
7983   "'[[carries_dependency]]' attribute only allowed on parameter in a function "
7984   "declaration or lambda">;
7985 def err_block_on_nonlocal : Error<
7986   "__block attribute not allowed, only allowed on local variables">;
7987 def err_block_on_vm : Error<
7988   "__block attribute not allowed on declaration with a variably modified type">;
7989
7990 def err_shufflevector_non_vector : Error<
7991   "first two arguments to __builtin_shufflevector must be vectors">;
7992 def err_shufflevector_incompatible_vector : Error<
7993   "first two arguments to __builtin_shufflevector must have the same type">;
7994 def err_shufflevector_nonconstant_argument : Error<
7995   "index for __builtin_shufflevector must be a constant integer">;
7996 def err_shufflevector_argument_too_large : Error<
7997   "index for __builtin_shufflevector must be less than the total number "
7998   "of vector elements">;
7999
8000 def err_convertvector_non_vector : Error<
8001   "first argument to __builtin_convertvector must be a vector">;
8002 def err_convertvector_non_vector_type : Error<
8003   "second argument to __builtin_convertvector must be a vector type">;
8004 def err_convertvector_incompatible_vector : Error<
8005   "first two arguments to __builtin_convertvector must have the same number of elements">;
8006
8007 def err_first_argument_to_cwsc_not_call : Error<
8008   "first argument to __builtin_call_with_static_chain must be a non-member call expression">;
8009 def err_first_argument_to_cwsc_block_call : Error<
8010   "first argument to __builtin_call_with_static_chain must not be a block call">;
8011 def err_first_argument_to_cwsc_builtin_call : Error<
8012   "first argument to __builtin_call_with_static_chain must not be a builtin call">;
8013 def err_first_argument_to_cwsc_pdtor_call : Error<
8014   "first argument to __builtin_call_with_static_chain must not be a pseudo-destructor call">;
8015 def err_second_argument_to_cwsc_not_pointer : Error<
8016   "second argument to __builtin_call_with_static_chain must be of pointer type">;
8017
8018 def err_vector_incorrect_num_initializers : Error<
8019   "%select{too many|too few}0 elements in vector initialization (expected %1 elements, have %2)">;
8020 def err_altivec_empty_initializer : Error<"expected initializer">;
8021
8022 def err_invalid_neon_type_code : Error<
8023   "incompatible constant for this __builtin_neon function">; 
8024 def err_argument_invalid_range : Error<
8025   "argument should be a value from %0 to %1">;
8026 def err_argument_not_multiple : Error<
8027   "argument should be a multiple of %0">;
8028 def warn_neon_vector_initializer_non_portable : Warning<
8029   "vector initializers are not compatible with NEON intrinsics in big endian "
8030   "mode">, InGroup<DiagGroup<"nonportable-vector-initialization">>;
8031 def note_neon_vector_initializer_non_portable : Note<
8032   "consider using vld1_%0%1() to initialize a vector from memory, or "
8033   "vcreate_%0%1() to initialize from an integer constant">;
8034 def note_neon_vector_initializer_non_portable_q : Note<
8035   "consider using vld1q_%0%1() to initialize a vector from memory, or "
8036   "vcombine_%0%1(vcreate_%0%1(), vcreate_%0%1()) to initialize from integer "
8037   "constants">;
8038 def err_systemz_invalid_tabort_code : Error<
8039   "invalid transaction abort code">;
8040 def err_64_bit_builtin_32_bit_tgt : Error<
8041   "this builtin is only available on 64-bit targets">;
8042 def err_ppc_builtin_only_on_pwr7 : Error<
8043   "this builtin is only valid on POWER7 or later CPUs">;
8044 def err_x86_builtin_32_bit_tgt : Error<
8045   "this builtin is only available on x86-64 targets">;
8046 def err_x86_builtin_invalid_rounding : Error<
8047   "invalid rounding argument">;
8048 def err_x86_builtin_invalid_scale : Error<
8049   "scale argument must be 1, 2, 4, or 8">;
8050
8051 def err_builtin_longjmp_unsupported : Error<
8052   "__builtin_longjmp is not supported for the current target">;
8053 def err_builtin_setjmp_unsupported : Error<
8054   "__builtin_setjmp is not supported for the current target">;
8055
8056 def err_builtin_longjmp_invalid_val : Error<
8057   "argument to __builtin_longjmp must be a constant 1">;
8058 def err_builtin_requires_language : Error<"'%0' is only available in %1">;
8059
8060 def err_constant_integer_arg_type : Error<
8061   "argument to %0 must be a constant integer">;
8062
8063 def ext_mixed_decls_code : Extension<
8064   "ISO C90 forbids mixing declarations and code">,
8065   InGroup<DiagGroup<"declaration-after-statement">>;
8066   
8067 def err_non_local_variable_decl_in_for : Error<
8068   "declaration of non-local variable in 'for' loop">;
8069 def err_non_variable_decl_in_for : Error<
8070   "non-variable declaration in 'for' loop">;
8071 def err_toomany_element_decls : Error<
8072   "only one element declaration is allowed">;
8073 def err_selector_element_not_lvalue : Error<
8074   "selector element is not a valid lvalue">;
8075 def err_selector_element_type : Error<
8076   "selector element type %0 is not a valid object">;
8077 def err_selector_element_const_type : Error<
8078   "selector element of type %0 cannot be a constant l-value expression">;
8079 def err_collection_expr_type : Error<
8080   "the type %0 is not a pointer to a fast-enumerable object">;
8081 def warn_collection_expr_type : Warning<
8082   "collection expression type %0 may not respond to %1">;
8083
8084 def err_invalid_conversion_between_ext_vectors : Error<
8085   "invalid conversion between ext-vector type %0 and %1">;
8086
8087 def warn_duplicate_attribute_exact : Warning<
8088   "attribute %0 is already applied">, InGroup<IgnoredAttributes>;
8089
8090 def warn_duplicate_attribute : Warning<
8091   "attribute %0 is already applied with different parameters">,
8092   InGroup<IgnoredAttributes>;
8093
8094 def warn_sync_fetch_and_nand_semantics_change : Warning<
8095   "the semantics of this intrinsic changed with GCC "
8096   "version 4.4 - the newer semantics are provided here">,
8097   InGroup<DiagGroup<"sync-fetch-and-nand-semantics-changed">>;
8098
8099 // Type
8100 def ext_invalid_sign_spec : Extension<"'%0' cannot be signed or unsigned">;
8101 def warn_receiver_forward_class : Warning<
8102     "receiver %0 is a forward class and corresponding @interface may not exist">,
8103     InGroup<ForwardClassReceiver>;
8104 def note_method_sent_forward_class : Note<"method %0 is used for the forward class">;
8105 def ext_missing_declspec : ExtWarn<
8106   "declaration specifier missing, defaulting to 'int'">;
8107 def ext_missing_type_specifier : ExtWarn<
8108   "type specifier missing, defaults to 'int'">,
8109   InGroup<ImplicitInt>;
8110 def err_decimal_unsupported : Error<
8111   "GNU decimal type extension not supported">;
8112 def err_missing_type_specifier : Error<
8113   "C++ requires a type specifier for all declarations">;
8114 def err_objc_array_of_interfaces : Error<
8115   "array of interface %0 is invalid (probably should be an array of pointers)">;
8116 def ext_c99_array_usage : Extension<
8117   "%select{qualifier in |static |}0array size %select{||'[*] '}0is a C99 "
8118   "feature">, InGroup<C99>;
8119 def err_c99_array_usage_cxx : Error<
8120   "%select{qualifier in |static |}0array size %select{||'[*] '}0is a C99 "
8121   "feature, not permitted in C++">;
8122 def err_type_unsupported : Error<
8123   "%0 is not supported on this target">;
8124 def err_nsconsumed_attribute_mismatch : Error<
8125   "overriding method has mismatched ns_consumed attribute on its"
8126   " parameter">;
8127 def err_nsreturns_retained_attribute_mismatch : Error<
8128   "overriding method has mismatched ns_returns_%select{not_retained|retained}0"
8129   " attributes">;
8130   
8131 def note_getter_unavailable : Note<
8132   "or because setter is declared here, but no getter method %0 is found">;
8133 def err_invalid_protocol_qualifiers : Error<
8134   "invalid protocol qualifiers on non-ObjC type">;
8135 def warn_ivar_use_hidden : Warning<
8136   "local declaration of %0 hides instance variable">,
8137    InGroup<ShadowIvar>;
8138 def warn_direct_initialize_call : Warning<
8139   "explicit call to +initialize results in duplicate call to +initialize">,
8140    InGroup<ExplicitInitializeCall>;
8141 def warn_direct_super_initialize_call : Warning<
8142   "explicit call to [super initialize] should only be in implementation "
8143   "of +initialize">,
8144    InGroup<ExplicitInitializeCall>;
8145 def err_ivar_use_in_class_method : Error<
8146   "instance variable %0 accessed in class method">;
8147 def err_private_ivar_access : Error<"instance variable %0 is private">,
8148   AccessControl;
8149 def err_protected_ivar_access : Error<"instance variable %0 is protected">,
8150   AccessControl;
8151 def warn_maynot_respond : Warning<"%0 may not respond to %1">;
8152 def ext_typecheck_base_super : Warning<
8153   "method parameter type "
8154   "%diff{$ does not match super class method parameter type $|"
8155   "does not match super class method parameter type}0,1">,
8156    InGroup<SuperSubClassMismatch>, DefaultIgnore;
8157 def warn_missing_method_return_type : Warning<
8158   "method has no return type specified; defaults to 'id'">,
8159   InGroup<MissingMethodReturnType>, DefaultIgnore;
8160 def warn_direct_ivar_access : Warning<"instance variable %0 is being "
8161   "directly accessed">, InGroup<DiagGroup<"direct-ivar-access">>, DefaultIgnore;
8162
8163 // Spell-checking diagnostics
8164 def err_unknown_typename : Error<
8165   "unknown type name %0">;
8166 def err_unknown_type_or_class_name_suggest : Error<
8167   "unknown %select{type|class}1 name %0; did you mean %2?">;
8168 def err_unknown_typename_suggest : Error<
8169   "unknown type name %0; did you mean %1?">;
8170 def err_unknown_nested_typename_suggest : Error<
8171   "no type named %0 in %1; did you mean %select{|simply }2%3?">;
8172 def err_no_member_suggest : Error<"no member named %0 in %1; did you mean %select{|simply }2%3?">;
8173 def err_undeclared_use_suggest : Error<
8174   "use of undeclared %0; did you mean %1?">;
8175 def err_undeclared_var_use_suggest : Error<
8176   "use of undeclared identifier %0; did you mean %1?">;
8177 def err_no_template_suggest : Error<"no template named %0; did you mean %1?">;
8178 def err_no_member_template_suggest : Error<
8179   "no template named %0 in %1; did you mean %select{|simply }2%3?">;
8180 def err_mem_init_not_member_or_class_suggest : Error<
8181   "initializer %0 does not name a non-static data member or base "
8182   "class; did you mean the %select{base class|member}1 %2?">;
8183 def err_field_designator_unknown_suggest : Error<
8184   "field designator %0 does not refer to any field in type %1; did you mean "
8185   "%2?">;
8186 def err_typecheck_member_reference_ivar_suggest : Error<
8187   "%0 does not have a member named %1; did you mean %2?">;
8188 def err_property_not_found_suggest : Error<
8189   "property %0 not found on object of type %1; did you mean %2?">;
8190 def err_class_property_found : Error<
8191   "property %0 is a class property; did you mean to access it with class '%1'?">;
8192 def err_ivar_access_using_property_syntax_suggest : Error<
8193   "property %0 not found on object of type %1; did you mean to access instance variable %2?">;
8194 def warn_property_access_suggest : Warning<
8195 "property %0 not found on object of type %1; did you mean to access property %2?">,
8196 InGroup<PropertyAccessDotSyntax>;
8197 def err_property_found_suggest : Error<
8198   "property %0 found on object of type %1; did you mean to access "
8199   "it with the \".\" operator?">;
8200 def err_undef_interface_suggest : Error<
8201   "cannot find interface declaration for %0; did you mean %1?">;
8202 def warn_undef_interface_suggest : Warning<
8203   "cannot find interface declaration for %0; did you mean %1?">;
8204 def err_undef_superclass_suggest : Error<
8205   "cannot find interface declaration for %0, superclass of %1; did you mean "
8206   "%2?">;
8207 def err_undeclared_protocol_suggest : Error<
8208   "cannot find protocol declaration for %0; did you mean %1?">;
8209 def note_base_class_specified_here : Note<
8210   "base class %0 specified here">;
8211 def err_using_directive_suggest : Error<
8212   "no namespace named %0; did you mean %1?">;
8213 def err_using_directive_member_suggest : Error<
8214   "no namespace named %0 in %1; did you mean %select{|simply }2%3?">;
8215 def note_namespace_defined_here : Note<"namespace %0 defined here">;
8216 def err_sizeof_pack_no_pack_name_suggest : Error<
8217   "%0 does not refer to the name of a parameter pack; did you mean %1?">;
8218 def note_parameter_pack_here : Note<"parameter pack %0 declared here">;
8219
8220 def err_uncasted_use_of_unknown_any : Error<
8221   "%0 has unknown type; cast it to its declared type to use it">;
8222 def err_uncasted_call_of_unknown_any : Error<
8223   "%0 has unknown return type; cast the call to its declared return type">;
8224 def err_uncasted_send_to_unknown_any_method : Error<
8225   "no known method %select{%objcinstance1|%objcclass1}0; cast the "
8226   "message send to the method's return type">;
8227 def err_unsupported_unknown_any_decl : Error<
8228   "%0 has unknown type, which is not supported for this kind of declaration">;
8229 def err_unsupported_unknown_any_expr : Error<
8230   "unsupported expression with unknown type">;
8231 def err_unsupported_unknown_any_call : Error<
8232   "call to unsupported expression with unknown type">;
8233 def err_unknown_any_addrof : Error<
8234   "the address of a declaration with unknown type "
8235   "can only be cast to a pointer type">;
8236 def err_unknown_any_addrof_call : Error<
8237   "address-of operator cannot be applied to a call to a function with "
8238   "unknown return type">;
8239 def err_unknown_any_var_function_type : Error<
8240   "variable %0 with unknown type cannot be given a function type">;
8241 def err_unknown_any_function : Error<
8242   "function %0 with unknown type must be given a function type">;
8243
8244 def err_filter_expression_integral : Error<
8245   "filter expression type should be an integral value not %0">;
8246
8247 def err_non_asm_stmt_in_naked_function : Error<
8248   "non-ASM statement in naked function is not supported">;
8249 def err_asm_naked_this_ref : Error<
8250   "'this' pointer references not allowed in naked functions">;
8251 def err_asm_naked_parm_ref : Error<
8252   "parameter references not allowed in naked functions">;
8253
8254 // OpenCL warnings and errors.
8255 def err_invalid_astype_of_different_size : Error<
8256   "invalid reinterpretation: sizes of %0 and %1 must match">;
8257 def err_static_kernel : Error<
8258   "kernel functions cannot be declared static">;
8259 def err_opencl_ptrptr_kernel_param : Error<
8260   "kernel parameter cannot be declared as a pointer to a pointer">;
8261 def err_kernel_arg_address_space : Error<
8262   "pointer arguments to kernel functions must reside in '__global', "
8263   "'__constant' or '__local' address space">;
8264 def err_opencl_ext_vector_component_invalid_length : Error<
8265   "vector component access has invalid length %0.  Supported: 1,2,3,4,8,16.">;
8266 def err_opencl_function_variable : Error<
8267   "%select{non-kernel function|function scope}0 variable cannot be declared in %1 address space">;
8268 def err_static_function_scope : Error<
8269   "variables in function scope cannot be declared static">;
8270 def err_opencl_bitfields : Error<
8271   "bit-fields are not supported in OpenCL">;
8272 def err_opencl_vla : Error<
8273   "variable length arrays are not supported in OpenCL">;
8274 def err_bad_kernel_param_type : Error<
8275   "%0 cannot be used as the type of a kernel parameter">;
8276 def err_record_with_pointers_kernel_param : Error<
8277   "%select{struct|union}0 kernel parameters may not contain pointers">;
8278 def note_within_field_of_type : Note<
8279   "within field of type %0 declared here">;
8280 def note_illegal_field_declared_here : Note<
8281   "field of illegal %select{type|pointer type}0 %1 declared here">;
8282 def err_opencl_type_struct_or_union_field : Error<
8283   "the %0 type cannot be used to declare a structure or union field">;
8284 def err_event_t_addr_space_qual : Error<
8285   "the event_t type can only be used with __private address space qualifier">;
8286 def err_expected_kernel_void_return_type : Error<
8287   "kernel must have void return type">;
8288 def err_sampler_initializer_not_integer : Error<
8289   "sampler_t initialization requires 32-bit integer, not %0">;
8290 def warn_sampler_initializer_invalid_bits : Warning<
8291   "sampler initializer has invalid %0 bits">, InGroup<SpirCompat>, DefaultIgnore;
8292 def err_sampler_argument_required : Error<
8293   "sampler_t variable required - got %0">;
8294 def err_wrong_sampler_addressspace: Error<
8295   "sampler type cannot be used with the __local and __global address space qualifiers">;
8296 def err_opencl_cast_non_zero_to_event_t : Error<
8297   "cannot cast non-zero value '%0' to 'event_t'">;
8298 def err_opencl_global_invalid_addr_space : Error<
8299   "%select{program scope|static local|extern}0 variable must reside in %1 address space">;
8300 def err_missing_actual_pipe_type : Error<
8301   "missing actual type specifier for pipe">;
8302 def err_reference_pipe_type : Error <
8303   "pipes packet types cannot be of reference type">;
8304 def err_opencl_no_main : Error<"%select{function|kernel}0 cannot be called 'main'">;
8305 def err_opencl_kernel_attr :
8306   Error<"attribute %0 can only be applied to a kernel function">;
8307 def err_opencl_return_value_with_address_space : Error<
8308   "return value cannot be qualified with address space">;
8309 def err_opencl_constant_no_init : Error<
8310   "variable in constant address space must be initialized">;
8311 def err_opencl_atomic_init: Error<
8312   "atomic variable can be %select{assigned|initialized}0 to a variable only "
8313   "in global address space">;
8314 def err_opencl_implicit_vector_conversion : Error<
8315   "implicit conversions between vector types (%0 and %1) are not permitted">;
8316 def err_opencl_invalid_type_array : Error<
8317   "array of %0 type is invalid in OpenCL">;
8318 def err_opencl_ternary_with_block : Error<
8319   "block type cannot be used as expression in ternary expression in OpenCL">;
8320 def err_opencl_pointer_to_type : Error<
8321   "pointer to type %0 is invalid in OpenCL">;
8322 def err_opencl_type_can_only_be_used_as_function_parameter : Error <
8323   "type %0 can only be used as a function parameter in OpenCL">;
8324 def warn_opencl_attr_deprecated_ignored : Warning <
8325   "%0 attribute is deprecated and ignored in OpenCL version %1">,
8326   InGroup<IgnoredAttributes>;
8327 def err_opencl_variadic_function : Error<
8328   "invalid prototype, variadic arguments are not allowed in OpenCL">;
8329 def err_opencl_requires_extension : Error<
8330   "use of %select{type |declaration}0%1 requires %2 extension to be enabled">;
8331
8332 // OpenCL v2.0 s6.13.6 -- Builtin Pipe Functions
8333 def err_opencl_builtin_pipe_first_arg : Error<
8334   "first argument to %0 must be a pipe type">;
8335 def err_opencl_builtin_pipe_arg_num : Error<
8336   "invalid number of arguments to function: %0">;
8337 def err_opencl_builtin_pipe_invalid_arg : Error<
8338   "invalid argument type to function %0 (expecting %1 having %2)">;
8339 def err_opencl_builtin_pipe_invalid_access_modifier : Error<
8340   "invalid pipe access modifier (expecting %0)">;
8341
8342 // OpenCL access qualifier
8343 def err_opencl_invalid_access_qualifier : Error<
8344   "access qualifier can only be used for pipe and image type">;
8345 def err_opencl_invalid_read_write : Error<
8346   "access qualifier %0 can not be used for %1 %select{|prior to OpenCL version 2.0}2">;
8347 def err_opencl_multiple_access_qualifiers : Error<
8348   "multiple access qualifiers">;
8349 def note_opencl_typedef_access_qualifier : Note<
8350   "previously declared '%0' here">;
8351
8352 // OpenCL Section 6.8.g
8353 def err_opencl_unknown_type_specifier : Error<
8354   "OpenCL version %0 does not support the '%1' %select{type qualifier|storage class specifier}2">;
8355
8356 // OpenCL v2.0 s6.12.5 Blocks restrictions
8357 def err_opencl_block_storage_type : Error<
8358   "the __block storage type is not permitted">;
8359 def err_opencl_invalid_block_declaration : Error<
8360   "invalid block variable declaration - must be %select{const qualified|initialized}0">;
8361 def err_opencl_extern_block_declaration : Error<
8362   "invalid block variable declaration - using 'extern' storage class is disallowed">;
8363 def err_opencl_block_ref_block : Error<
8364   "cannot refer to a block inside block">;
8365
8366 // OpenCL v2.0 s6.13.9 - Address space qualifier functions. 
8367 def err_opencl_builtin_to_addr_arg_num : Error<
8368   "invalid number of arguments to function: %0">;
8369 def err_opencl_builtin_to_addr_invalid_arg : Error<
8370   "invalid argument %0 to function: %1, expecting a generic pointer argument">;
8371
8372 // OpenCL v2.0 s6.13.17 Enqueue kernel restrictions.
8373 def err_opencl_enqueue_kernel_incorrect_args : Error<
8374   "illegal call to enqueue_kernel, incorrect argument types">;
8375 def err_opencl_enqueue_kernel_expected_type : Error<
8376   "illegal call to enqueue_kernel, expected %0 argument type">;
8377 def err_opencl_enqueue_kernel_local_size_args : Error<
8378   "mismatch in number of block parameters and local size arguments passed">;
8379 def err_opencl_enqueue_kernel_invalid_local_size_type : Error<
8380   "illegal call to enqueue_kernel, parameter needs to be specified as integer type">;
8381 def err_opencl_enqueue_kernel_blocks_non_local_void_args : Error<
8382   "blocks used in enqueue_kernel call are expected to have parameters of type 'local void*'">;
8383 def err_opencl_enqueue_kernel_blocks_no_args : Error<
8384   "blocks with parameters are not accepted in this prototype of enqueue_kernel call">;
8385
8386 // OpenCL v2.2 s2.1.2.3 - Vector Component Access
8387 def ext_opencl_ext_vector_type_rgba_selector: ExtWarn<
8388   "vector component name '%0' is an OpenCL version 2.2 feature">,
8389   InGroup<OpenCLUnsupportedRGBA>;
8390 } // end of sema category
8391
8392 let CategoryName = "OpenMP Issue" in {
8393 // OpenMP support.
8394 def err_omp_expected_var_arg : Error<
8395   "%0 is not a global variable, static local variable or static data member">;
8396 def err_omp_expected_var_arg_suggest : Error<
8397   "%0 is not a global variable, static local variable or static data member; "
8398   "did you mean %1">;
8399 def err_omp_global_var_arg : Error<
8400   "arguments of '#pragma omp %0' must have %select{global storage|static storage duration}1">;
8401 def err_omp_ref_type_arg : Error<
8402   "arguments of '#pragma omp %0' cannot be of reference type %1">;
8403 def err_omp_region_not_file_context : Error<
8404   "directive must be at file or namespace scope">;
8405 def err_omp_var_scope : Error<
8406   "'#pragma omp %0' must appear in the scope of the %q1 variable declaration">;
8407 def err_omp_var_used : Error<
8408   "'#pragma omp %0' must precede all references to variable %q1">;
8409 def err_omp_var_thread_local : Error<
8410   "variable %0 cannot be threadprivate because it is %select{thread-local|a global named register variable}1">;
8411 def err_omp_private_incomplete_type : Error<
8412   "a private variable with incomplete type %0">;
8413 def err_omp_firstprivate_incomplete_type : Error<
8414   "a firstprivate variable with incomplete type %0">;
8415 def err_omp_lastprivate_incomplete_type : Error<
8416   "a lastprivate variable with incomplete type %0">;
8417 def err_omp_reduction_incomplete_type : Error<
8418   "a reduction list item with incomplete type %0">;
8419 def err_omp_unexpected_clause_value : Error<
8420   "expected %0 in OpenMP clause '%1'">;
8421 def err_omp_expected_var_name_member_expr : Error<
8422   "expected variable name%select{| or data member of current class}0">;
8423 def err_omp_expected_var_name_member_expr_or_array_item : Error<
8424   "expected variable name%select{|, data member of current class}0, array element or array section">;
8425 def err_omp_expected_named_var_member_or_array_expression: Error<
8426   "expected expression containing only member accesses and/or array sections based on named variables">;
8427 def err_omp_bit_fields_forbidden_in_clause : Error<
8428   "bit fields cannot be used to specify storage in a '%0' clause">;
8429 def err_array_section_does_not_specify_contiguous_storage : Error<
8430   "array section does not specify contiguous storage">;
8431 def err_omp_union_type_not_allowed : Error<
8432   "mapped storage cannot be derived from a union">;
8433 def err_omp_expected_access_to_data_field : Error<
8434   "expected access to data field">;
8435 def err_omp_multiple_array_items_in_map_clause : Error<
8436   "multiple array elements associated with the same variable are not allowed in map clauses of the same construct">;
8437 def err_omp_pointer_mapped_along_with_derived_section : Error<
8438   "pointer cannot be mapped along with a section derived from itself">;
8439 def err_omp_original_storage_is_shared_and_does_not_contain : Error<
8440   "original storage of expression in data environment is shared but data environment do not fully contain mapped expression storage">;
8441 def err_omp_same_pointer_derreferenced : Error<
8442   "same pointer derreferenced in multiple different ways in map clause expressions">;
8443 def note_omp_task_predetermined_firstprivate_here : Note<
8444   "predetermined as a firstprivate in a task construct here">;
8445 def err_omp_threadprivate_incomplete_type : Error<
8446   "threadprivate variable with incomplete type %0">;
8447 def err_omp_no_dsa_for_variable : Error<
8448   "variable %0 must have explicitly specified data sharing attributes">;
8449 def err_omp_wrong_dsa : Error<
8450   "%0 variable cannot be %1">;
8451 def err_omp_variably_modified_type_not_supported : Error<
8452   "arguments of OpenMP clause '%0' in '#pragma omp %2' directive cannot be of variably-modified type %1">;
8453 def note_omp_explicit_dsa : Note<
8454   "defined as %0">;
8455 def note_omp_predetermined_dsa : Note<
8456   "%select{static data member is predetermined as shared|"
8457   "variable with static storage duration is predetermined as shared|"
8458   "loop iteration variable is predetermined as private|"
8459   "loop iteration variable is predetermined as linear|"
8460   "loop iteration variable is predetermined as lastprivate|"
8461   "constant variable is predetermined as shared|"
8462   "global variable is predetermined as shared|"
8463   "non-shared variable in a task construct is predetermined as firstprivate|"
8464   "variable with automatic storage duration is predetermined as private}0"
8465   "%select{|; perhaps you forget to enclose 'omp %2' directive into a parallel or another task region?}1">;
8466 def note_omp_implicit_dsa : Note<
8467   "implicitly determined as %0">;
8468 def err_omp_loop_var_dsa : Error<
8469   "loop iteration variable in the associated loop of 'omp %1' directive may not be %0, predetermined as %2">;
8470 def err_omp_not_for : Error<
8471   "%select{statement after '#pragma omp %1' must be a for loop|"
8472   "expected %2 for loops after '#pragma omp %1'%select{|, but found only %4}3}0">;
8473 def note_omp_collapse_ordered_expr : Note<
8474   "as specified in %select{'collapse'|'ordered'|'collapse' and 'ordered'}0 clause%select{||s}0">;
8475 def err_omp_negative_expression_in_clause : Error<
8476   "argument to '%0' clause must be a %select{non-negative|strictly positive}1 integer value">;
8477 def err_omp_not_integral : Error<
8478   "expression must have integral or unscoped enumeration "
8479   "type, not %0">;
8480 def err_omp_threadprivate_in_target : Error<
8481   "threadprivate variables cannot be used in target constructs">;
8482 def err_omp_incomplete_type : Error<
8483   "expression has incomplete class type %0">;
8484 def err_omp_explicit_conversion : Error<
8485   "expression requires explicit conversion from %0 to %1">;
8486 def note_omp_conversion_here : Note<
8487   "conversion to %select{integral|enumeration}0 type %1 declared here">;
8488 def err_omp_ambiguous_conversion : Error<
8489   "ambiguous conversion from type %0 to an integral or unscoped "
8490   "enumeration type">;
8491 def err_omp_required_access : Error<
8492   "%0 variable must be %1">;
8493 def err_omp_const_variable : Error<
8494   "const-qualified variable cannot be %0">;
8495 def err_omp_const_reduction_list_item : Error<
8496   "const-qualified list item cannot be reduction">;
8497 def err_omp_linear_incomplete_type : Error<
8498   "a linear variable with incomplete type %0">;
8499 def err_omp_linear_expected_int_or_ptr : Error<
8500   "argument of a linear clause should be of integral or pointer "
8501   "type, not %0">;
8502 def warn_omp_linear_step_zero : Warning<
8503   "zero linear step (%0 %select{|and other variables in clause }1should probably be const)">,
8504   InGroup<OpenMPClauses>;
8505 def warn_omp_alignment_not_power_of_two : Warning<
8506   "aligned clause will be ignored because the requested alignment is not a power of 2">,
8507   InGroup<OpenMPClauses>;
8508 def err_omp_enclosed_declare_target : Error<
8509   "declare target region may not be enclosed within another declare target region">;
8510 def err_omp_invalid_target_decl : Error<
8511   "%0 used in declare target directive is not a variable or a function name">;
8512 def err_omp_declare_target_multiple : Error<
8513   "%0 appears multiple times in clauses on the same declare target directive">;
8514 def err_omp_declare_target_to_and_link : Error<
8515   "%0 must not appear in both clauses 'to' and 'link'">;
8516 def warn_omp_not_in_target_context : Warning<
8517   "declaration is not declared in any declare target region">,
8518   InGroup<OpenMPTarget>;
8519 def err_omp_aligned_expected_array_or_ptr : Error<
8520   "argument of aligned clause should be array"
8521   "%select{ or pointer|, pointer, reference to array or reference to pointer}1"
8522   ", not %0">;
8523 def err_omp_aligned_twice : Error<
8524   "%select{a variable|a parameter|'this'}0 cannot appear in more than one aligned clause">;
8525 def err_omp_local_var_in_threadprivate_init : Error<
8526   "variable with local storage in initial value of threadprivate variable">;
8527 def err_omp_loop_not_canonical_init : Error<
8528   "initialization clause of OpenMP for loop is not in canonical form "
8529   "('var = init' or 'T var = init')">;
8530 def ext_omp_loop_not_canonical_init : ExtWarn<
8531   "initialization clause of OpenMP for loop is not in canonical form "
8532   "('var = init' or 'T var = init')">, InGroup<OpenMPLoopForm>;
8533 def err_omp_loop_not_canonical_cond : Error<
8534   "condition of OpenMP for loop must be a relational comparison "
8535   "('<', '<=', '>', or '>=') of loop variable %0">;
8536 def err_omp_loop_not_canonical_incr : Error<
8537   "increment clause of OpenMP for loop must perform simple addition "
8538   "or subtraction on loop variable %0">;
8539 def err_omp_loop_variable_type : Error<
8540   "variable must be of integer or %select{pointer|random access iterator}0 type">;
8541 def err_omp_loop_incr_not_compatible : Error<
8542   "increment expression must cause %0 to %select{decrease|increase}1 "
8543   "on each iteration of OpenMP for loop">;
8544 def note_omp_loop_cond_requres_compatible_incr : Note<
8545   "loop step is expected to be %select{negative|positive}0 due to this condition">;
8546 def err_omp_loop_diff_cxx : Error<
8547   "could not calculate number of iterations calling 'operator-' with "
8548   "upper and lower loop bounds">;
8549 def err_omp_loop_cannot_use_stmt : Error<
8550   "'%0' statement cannot be used in OpenMP for loop">;
8551 def err_omp_simd_region_cannot_use_stmt : Error<
8552   "'%0' statement cannot be used in OpenMP simd region">;
8553 def warn_omp_loop_64_bit_var : Warning<
8554   "OpenMP loop iteration variable cannot have more than 64 bits size and will be narrowed">,
8555   InGroup<OpenMPLoopForm>;
8556 def err_omp_unknown_reduction_identifier : Error<
8557   "incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', "
8558   "'&&', '||', 'min' or 'max' or declare reduction for type %0">;
8559 def err_omp_not_resolved_reduction_identifier : Error<
8560   "unable to resolve declare reduction construct for type %0">;
8561 def err_omp_reduction_ref_type_arg : Error<
8562   "argument of OpenMP clause 'reduction' must reference the same object in all threads">;
8563 def err_omp_clause_not_arithmetic_type_arg : Error<
8564   "arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of %select{scalar|arithmetic}0 type">;
8565 def err_omp_clause_floating_type_arg : Error<
8566   "arguments of OpenMP clause 'reduction' with bitwise operators cannot be of floating type">;
8567 def err_omp_once_referenced : Error<
8568   "variable can appear only once in OpenMP '%0' clause">;
8569 def err_omp_once_referenced_in_target_update : Error<
8570   "variable can appear only once in OpenMP 'target update' construct">;
8571 def note_omp_referenced : Note<
8572   "previously referenced here">;
8573 def err_omp_reduction_in_task : Error<
8574   "reduction variables may not be accessed in an explicit task">;
8575 def err_omp_reduction_id_not_compatible : Error<
8576   "list item of type %0 is not valid for specified reduction operation: unable to provide default initialization value">;
8577 def err_omp_prohibited_region : Error<
8578   "region cannot be%select{| closely}0 nested inside '%1' region"
8579   "%select{|; perhaps you forget to enclose 'omp %3' directive into a parallel region?|"
8580   "; perhaps you forget to enclose 'omp %3' directive into a for or a parallel for region with 'ordered' clause?|"
8581   "; perhaps you forget to enclose 'omp %3' directive into a target region?|"
8582   "; perhaps you forget to enclose 'omp %3' directive into a teams region?}2">;
8583 def err_omp_prohibited_region_simd : Error<
8584   "OpenMP constructs may not be nested inside a simd region">;
8585 def err_omp_prohibited_region_atomic : Error<
8586   "OpenMP constructs may not be nested inside an atomic region">;
8587 def err_omp_prohibited_region_critical_same_name : Error<
8588   "cannot nest 'critical' regions having the same name %0">;
8589 def note_omp_previous_critical_region : Note<
8590   "previous 'critical' region starts here">;
8591 def err_omp_sections_not_compound_stmt : Error<
8592   "the statement for '#pragma omp sections' must be a compound statement">;
8593 def err_omp_parallel_sections_not_compound_stmt : Error<
8594   "the statement for '#pragma omp parallel sections' must be a compound statement">;
8595 def err_omp_orphaned_section_directive : Error<
8596   "%select{orphaned 'omp section' directives are prohibited, it|'omp section' directive}0"
8597   " must be closely nested to a sections region%select{|, not a %1 region}0">;
8598 def err_omp_sections_substmt_not_section : Error<
8599   "statement in 'omp sections' directive must be enclosed into a section region">;
8600 def err_omp_parallel_sections_substmt_not_section : Error<
8601   "statement in 'omp parallel sections' directive must be enclosed into a section region">;
8602 def err_omp_parallel_reduction_in_task_firstprivate : Error<
8603   "argument of a reduction clause of a %0 construct must not appear in a firstprivate clause on a task construct">;
8604 def err_omp_atomic_read_not_expression_statement : Error<
8605   "the statement for 'atomic read' must be an expression statement of form 'v = x;',"
8606   " where v and x are both lvalue expressions with scalar type">;
8607 def note_omp_atomic_read_write: Note<
8608   "%select{expected an expression statement|expected built-in assignment operator|expected expression of scalar type|expected lvalue expression}0">;
8609 def err_omp_atomic_write_not_expression_statement : Error<
8610   "the statement for 'atomic write' must be an expression statement of form 'x = expr;',"
8611   " where x is a lvalue expression with scalar type">;
8612 def err_omp_atomic_update_not_expression_statement : Error<
8613   "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',"
8614   " where x is an l-value expression with scalar type">;
8615 def err_omp_atomic_not_expression_statement : Error<
8616   "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',"
8617   " where x is an l-value expression with scalar type">;
8618 def note_omp_atomic_update: Note<
8619   "%select{expected an expression statement|expected built-in binary or unary operator|expected unary decrement/increment operation|"
8620   "expected expression of scalar type|expected assignment expression|expected built-in binary operator|"
8621   "expected one of '+', '*', '-', '/', '&', '^', '%|', '<<', or '>>' built-in operations|expected in right hand side of expression}0">;
8622 def err_omp_atomic_capture_not_expression_statement : Error<
8623   "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',"
8624   " where x and v are both l-value expressions with scalar type">;
8625 def err_omp_atomic_capture_not_compound_statement : Error<
8626   "the statement for 'atomic capture' must be a compound statement of form '{v = x; x binop= expr;}', '{x binop= expr; v = x;}',"
8627   " '{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;}',"
8628   " '{v = x; x++;}', '{v = x; ++x;}', '{++x; v = x;}', '{x++; v = x;}', '{v = x; x--;}', '{v = x; --x;}', '{--x; v = x;}', '{x--; v = x;}'"
8629   " where x is an l-value expression with scalar type">;
8630 def note_omp_atomic_capture: Note<
8631   "%select{expected assignment expression|expected compound statement|expected exactly two expression statements|expected in right hand side of the first expression}0">;
8632 def err_omp_atomic_several_clauses : Error<
8633   "directive '#pragma omp atomic' cannot contain more than one 'read', 'write', 'update' or 'capture' clause">;
8634 def note_omp_atomic_previous_clause : Note<
8635   "'%0' clause used here">;
8636 def err_omp_target_contains_not_only_teams : Error<
8637   "target construct with nested teams region contains statements outside of the teams construct">;
8638 def note_omp_nested_teams_construct_here : Note<
8639   "nested teams construct here">;
8640 def note_omp_nested_statement_here : Note<
8641   "%select{statement|directive}0 outside teams construct here">;
8642 def err_omp_single_copyprivate_with_nowait : Error<
8643   "the 'copyprivate' clause must not be used with the 'nowait' clause">;
8644 def note_omp_nowait_clause_here : Note<
8645   "'nowait' clause is here">;
8646 def err_omp_single_decl_in_declare_simd : Error<
8647   "single declaration is expected after 'declare simd' directive">;
8648 def err_omp_function_expected : Error<
8649   "'#pragma omp declare simd' can only be applied to functions">;
8650 def err_omp_wrong_cancel_region : Error<
8651   "one of 'for', 'parallel', 'sections' or 'taskgroup' is expected">;
8652 def err_omp_parent_cancel_region_nowait : Error<
8653   "parent region for 'omp %select{cancellation point/cancel}0' construct cannot be nowait">;
8654 def err_omp_parent_cancel_region_ordered : Error<
8655   "parent region for 'omp %select{cancellation point/cancel}0' construct cannot be ordered">;
8656 def err_omp_reduction_wrong_type : Error<"reduction type cannot be %select{qualified with 'const', 'volatile' or 'restrict'|a function|a reference|an array}0 type">;
8657 def err_omp_wrong_var_in_declare_reduction : Error<"only %select{'omp_priv' or 'omp_orig'|'omp_in' or 'omp_out'}0 variables are allowed in %select{initializer|combiner}0 expression">;
8658 def err_omp_declare_reduction_redefinition : Error<"redefinition of user-defined reduction for type %0">;
8659 def err_omp_array_section_use : Error<"OpenMP array section is not allowed here">;
8660 def err_omp_typecheck_section_value : Error<
8661   "subscripted value is not an array or pointer">;
8662 def err_omp_typecheck_section_not_integer : Error<
8663   "array section %select{lower bound|length}0 is not an integer">;
8664 def err_omp_section_function_type : Error<
8665   "section of pointer to function type %0">;
8666 def warn_omp_section_is_char : Warning<"array section %select{lower bound|length}0 is of type 'char'">,
8667   InGroup<CharSubscript>, DefaultIgnore;
8668 def err_omp_section_incomplete_type : Error<
8669   "section of pointer to incomplete type %0">;
8670 def err_omp_section_not_subset_of_array : Error<
8671   "array section must be a subset of the original array">;
8672 def err_omp_section_length_negative : Error<
8673   "section length is evaluated to a negative value %0">;
8674 def err_omp_section_length_undefined : Error<
8675   "section length is unspecified and cannot be inferred because subscripted value is %select{not an array|an array of unknown bound}0">;
8676 def err_omp_wrong_linear_modifier : Error<
8677   "expected %select{'val' modifier|one of 'ref', val' or 'uval' modifiers}0">;
8678 def err_omp_wrong_linear_modifier_non_reference : Error<
8679   "variable of non-reference type %0 can be used only with 'val' modifier, but used with '%1'">;
8680 def err_omp_wrong_simdlen_safelen_values : Error<
8681   "the value of 'simdlen' parameter must be less than or equal to the value of the 'safelen' parameter">;
8682 def err_omp_wrong_if_directive_name_modifier : Error<
8683   "directive name modifier '%0' is not allowed for '#pragma omp %1'">;
8684 def err_omp_no_more_if_clause : Error<
8685   "no more 'if' clause is allowed">;
8686 def err_omp_unnamed_if_clause : Error<
8687   "expected %select{|one of}0 %1 directive name modifier%select{|s}0">;
8688 def note_omp_previous_named_if_clause : Note<
8689   "previous clause with directive name modifier specified here">;
8690 def err_omp_ordered_directive_with_param : Error<
8691   "'ordered' directive %select{without any clauses|with 'threads' clause}0 cannot be closely nested inside ordered region with specified parameter">;
8692 def err_omp_ordered_directive_without_param : Error<
8693   "'ordered' directive with 'depend' clause cannot be closely nested inside ordered region without specified parameter">;
8694 def note_omp_ordered_param : Note<
8695   "'ordered' clause with specified parameter">;
8696 def err_omp_expected_base_var_name : Error<
8697   "expected variable name as a base of the array %select{subscript|section}0">;
8698 def err_omp_map_shared_storage : Error<
8699   "variable already marked as mapped in current construct">;
8700 def err_omp_not_mappable_type : Error<
8701   "type %0 is not mappable to target">;
8702 def err_omp_invalid_map_type_for_directive : Error<
8703   "%select{map type '%1' is not allowed|map type must be specified}0 for '#pragma omp %2'">;
8704 def err_omp_no_map_for_directive : Error<
8705   "expected at least one map clause for '#pragma omp %0'">;
8706 def note_omp_polymorphic_in_target : Note<
8707   "mappable type cannot be polymorphic">;
8708 def note_omp_static_member_in_target : Note<
8709   "mappable type cannot contain static members">;
8710 def err_omp_threadprivate_in_clause : Error<
8711   "threadprivate variables are not allowed in '%0' clause">;
8712 def err_omp_wrong_ordered_loop_count : Error<
8713   "the parameter of the 'ordered' clause must be greater than or equal to the parameter of the 'collapse' clause">;
8714 def note_collapse_loop_count : Note<
8715   "parameter of the 'collapse' clause">;
8716 def err_omp_grainsize_num_tasks_mutually_exclusive : Error<
8717   "'%0' and '%1' clause are mutually exclusive and may not appear on the same directive">;
8718 def note_omp_previous_grainsize_num_tasks : Note<
8719   "'%0' clause is specified here">;
8720 def err_omp_hint_clause_no_name : Error<
8721   "the name of the construct must be specified in presence of 'hint' clause">;
8722 def err_omp_critical_with_hint : Error<
8723   "constructs with the same name must have a 'hint' clause with the same value">;
8724 def note_omp_critical_hint_here : Note<
8725   "%select{|previous }0'hint' clause with value '%1'">;
8726 def note_omp_critical_no_hint : Note<
8727   "%select{|previous }0directive with no 'hint' clause specified">;
8728 def err_omp_firstprivate_distribute_private_teams : Error<
8729   "private variable in '#pragma omp teams' cannot be firstprivate in '#pragma omp distribute'">;
8730 def err_omp_firstprivate_and_lastprivate_in_distribute : Error<
8731   "lastprivate variable cannot be firstprivate in '#pragma omp distribute'">;
8732 def err_omp_firstprivate_distribute_in_teams_reduction : Error<
8733   "reduction variable in '#pragma omp teams' cannot be firstprivate in '#pragma omp distribute'">;
8734 def err_omp_depend_clause_thread_simd : Error<
8735   "'depend' clauses cannot be mixed with '%0' clause">;
8736 def err_omp_depend_sink_expected_loop_iteration : Error<
8737   "expected %0 loop iteration variable">;
8738 def err_omp_depend_sink_unexpected_expr : Error<
8739   "unexpected expression: number of expressions is larger than the number of associated loops">;
8740 def err_omp_depend_sink_expected_plus_minus : Error<
8741   "expected '+' or '-' operation">;
8742 def err_omp_depend_sink_source_not_allowed : Error<
8743   "'depend(%select{source|sink:vec}0)' clause%select{|s}0 cannot be mixed with 'depend(%select{sink:vec|source}0)' clause%select{s|}0">;
8744 def err_omp_linear_ordered : Error<
8745   "'linear' clause cannot be specified along with 'ordered' clause with a parameter">;
8746 def err_omp_unexpected_schedule_modifier : Error<
8747   "modifier '%0' cannot be used along with modifier '%1'">;
8748 def err_omp_schedule_nonmonotonic_static : Error<
8749   "'nonmonotonic' modifier can only be specified with 'dynamic' or 'guided' schedule kind">;
8750 def err_omp_schedule_nonmonotonic_ordered : Error<
8751   "'schedule' clause with 'nonmonotonic' modifier cannot be specified if an 'ordered' clause is specified">;
8752 def err_omp_ordered_simd : Error<
8753   "'ordered' clause with a parameter can not be specified in '#pragma omp %0' directive">;
8754 def err_omp_variable_in_given_clause_and_dsa : Error<
8755   "%0 variable cannot be in a %1 clause in '#pragma omp %2' directive">;
8756 def err_omp_param_or_this_in_clause : Error<
8757   "expected reference to one of the parameters of function %0%select{| or 'this'}1">;
8758 def err_omp_expected_uniform_param : Error<
8759   "expected a reference to a parameter specified in a 'uniform' clause">;
8760 def err_omp_expected_int_param : Error<
8761   "expected a reference to an integer-typed parameter">;
8762 def err_omp_at_least_one_motion_clause_required : Error<
8763   "expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'">;
8764 def err_omp_usedeviceptr_not_a_pointer : Error<
8765   "expected pointer or reference to pointer in 'use_device_ptr' clause">;
8766 def err_omp_argument_type_isdeviceptr : Error <
8767   "expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'">;
8768 def warn_omp_nesting_simd : Warning<
8769   "OpenMP only allows an ordered construct with the simd clause nested in a simd construct">,
8770   InGroup<SourceUsesOpenMP>;
8771 def err_omp_orphaned_device_directive : Error<
8772   "orphaned 'omp %0' directives are prohibited"
8773   "; perhaps you forget to enclose the directive into a %select{|||target |teams }1region?">;
8774 } // end of OpenMP category
8775
8776 let CategoryName = "Related Result Type Issue" in {
8777 // Objective-C related result type compatibility
8778 def warn_related_result_type_compatibility_class : Warning<
8779   "method is expected to return an instance of its class type "
8780   "%diff{$, but is declared to return $|"
8781   ", but is declared to return different type}0,1">;
8782 def warn_related_result_type_compatibility_protocol : Warning<
8783   "protocol method is expected to return an instance of the implementing "
8784   "class, but is declared to return %0">;
8785 def note_related_result_type_family : Note<
8786   "%select{overridden|current}0 method is part of the '%select{|alloc|copy|init|"
8787   "mutableCopy|new|autorelease|dealloc|finalize|release|retain|retainCount|"
8788   "self}1' method family%select{| and is expected to return an instance of its "
8789   "class type}0">;
8790 def note_related_result_type_overridden : Note<
8791   "overridden method returns an instance of its class type">;
8792 def note_related_result_type_inferred : Note<
8793   "%select{class|instance}0 method %1 is assumed to return an instance of "
8794   "its receiver type (%2)">;
8795 def note_related_result_type_explicit : Note<
8796   "%select{overridden|current}0 method is explicitly declared 'instancetype'"
8797   "%select{| and is expected to return an instance of its class type}0">;
8798 def err_invalid_type_for_program_scope_var : Error<
8799   "the %0 type cannot be used to declare a program scope variable">;
8800
8801 }
8802
8803 let CategoryName = "Modules Issue" in {
8804 def err_module_decl_in_module_map_module : Error<
8805   "'module' declaration found while building module from module map">;
8806 def err_module_interface_implementation_mismatch : Error<
8807   "missing 'export' specifier in module declaration while "
8808   "building module interface">;
8809 def err_current_module_name_mismatch : Error<
8810   "module name '%0' specified on command line does not match name of module">;
8811 def err_module_redefinition : Error<
8812   "redefinition of module '%0'">;
8813 def note_prev_module_definition : Note<"previously defined here">;
8814 def note_prev_module_definition_from_ast_file : Note<"module loaded from '%0'">;
8815 def err_module_private_specialization : Error<
8816   "%select{template|partial|member}0 specialization cannot be "
8817   "declared __module_private__">;
8818 def err_module_private_local : Error<
8819   "%select{local variable|parameter|typedef}0 %1 cannot be declared "
8820   "__module_private__">;
8821 def err_module_private_local_class : Error<
8822   "local %select{struct|interface|union|class|enum}0 cannot be declared "
8823   "__module_private__">;
8824 def err_module_unimported_use : Error<
8825   "%select{declaration|definition|default argument|"
8826   "explicit specialization|partial specialization}0 of %1 must be imported "
8827   "from module '%2' before it is required">;
8828 def err_module_unimported_use_header : Error<
8829   "missing '#include %3'; "
8830   "%select{declaration|definition|default argument|"
8831   "explicit specialization|partial specialization}0 of %1 must be imported "
8832   "from module '%2' before it is required">;
8833 def err_module_unimported_use_multiple : Error<
8834   "%select{declaration|definition|default argument|"
8835   "explicit specialization|partial specialization}0 of %1 must be imported "
8836   "from one of the following modules before it is required:%2">;
8837 def ext_module_import_in_extern_c : ExtWarn<
8838   "import of C++ module '%0' appears within extern \"C\" language linkage "
8839   "specification">, DefaultError,
8840   InGroup<DiagGroup<"module-import-in-extern-c">>;
8841 def err_module_import_not_at_top_level_fatal : Error<
8842   "import of module '%0' appears within %1">, DefaultFatal;
8843 def ext_module_import_not_at_top_level_noop : ExtWarn<
8844   "redundant #include of module '%0' appears within %1">, DefaultError,
8845   InGroup<DiagGroup<"modules-import-nested-redundant">>;
8846 def note_module_import_not_at_top_level : Note<"%0 begins here">;
8847 def err_module_self_import : Error<
8848   "import of module '%0' appears within same top-level module '%1'">;
8849 def err_module_import_in_implementation : Error<
8850   "@import of module '%0' in implementation of '%1'; use #import">;
8851
8852 // C++ Modules TS
8853 def err_export_within_export : Error<
8854   "export declaration appears within another export declaration">;
8855 def err_export_not_in_module_interface : Error<
8856   "export declaration can only be used within a module interface unit after "
8857   "the module declaration">;
8858
8859 def ext_equivalent_internal_linkage_decl_in_modules : ExtWarn<
8860   "ambiguous use of internal linkage declaration %0 defined in multiple modules">,
8861   InGroup<DiagGroup<"modules-ambiguous-internal-linkage">>;
8862 def note_equivalent_internal_linkage_decl : Note<
8863   "declared here%select{ in module '%1'|}0">;
8864 }
8865
8866 let CategoryName = "Coroutines Issue" in {
8867 def err_return_in_coroutine : Error<
8868   "return statement not allowed in coroutine; did you mean 'co_return'?">;
8869 def note_declared_coroutine_here : Note<
8870   "function is a coroutine due to use of '%0' here">;
8871 def err_coroutine_objc_method : Error<
8872   "Objective-C methods as coroutines are not yet supported">;
8873 def err_coroutine_unevaluated_context : Error<
8874   "'%0' cannot be used in an unevaluated context">;
8875 def err_coroutine_outside_function : Error<
8876   "'%0' cannot be used outside a function">;
8877 def err_coroutine_invalid_func_context : Error<
8878   "'%1' cannot be used in %select{a constructor|a destructor"
8879   "|a copy assignment operator|a move assignment operator|the 'main' function"
8880   "|a constexpr function|a function with a deduced return type"
8881   "|a varargs function}0">;
8882 def err_implied_coroutine_type_not_found : Error<
8883   "%0 type was not found; include <experimental/coroutine> before defining "
8884   "a coroutine">;
8885 def err_implicit_coroutine_std_nothrow_type_not_found : Error<
8886   "std::nothrow was not found; include <new> before defining a coroutine which "
8887   "uses get_return_object_on_allocation_failure()">;
8888 def err_malformed_std_nothrow : Error<
8889   "std::nothrow must be a valid variable declaration">;
8890 def err_malformed_std_coroutine_handle : Error<
8891   "std::experimental::coroutine_handle must be a class template">;
8892 def err_coroutine_handle_missing_member : Error<
8893   "std::experimental::coroutine_handle missing a member named '%0'">;
8894 def err_malformed_std_coroutine_traits : Error<
8895   "'std::experimental::coroutine_traits' must be a class template">;
8896 def err_implied_std_coroutine_traits_promise_type_not_found : Error<
8897   "this function cannot be a coroutine: %q0 has no member named 'promise_type'">;
8898 def err_implied_std_coroutine_traits_promise_type_not_class : Error<
8899   "this function cannot be a coroutine: %0 is not a class">;
8900 def err_coroutine_promise_type_incomplete : Error<
8901   "this function cannot be a coroutine: %0 is an incomplete type">;
8902 def err_coroutine_type_missing_specialization : Error<
8903   "this function cannot be a coroutine: missing definition of "
8904   "specialization %q0">;
8905 def err_coroutine_promise_return_ill_formed : Error<
8906   "%0 declares both 'return_value' and 'return_void'">;
8907 def note_coroutine_promise_implicit_await_transform_required_here : Note<
8908   "call to 'await_transform' implicitly required by 'co_await' here">;
8909 def note_coroutine_promise_suspend_implicitly_required : Note<
8910   "call to '%select{initial_suspend|final_suspend}0' implicitly "
8911   "required by the %select{initial suspend point|final suspend point}0">;
8912 def err_coroutine_promise_unhandled_exception_required : Error<
8913   "%0 is required to declare the member 'unhandled_exception()'">;
8914 def warn_coroutine_promise_unhandled_exception_required_with_exceptions : Warning<
8915   "%0 is required to declare the member 'unhandled_exception()' when exceptions are enabled">,
8916   InGroup<CoroutineMissingUnhandledException>;
8917 def err_coroutine_promise_get_return_object_on_allocation_failure : Error<
8918   "%0: 'get_return_object_on_allocation_failure()' must be a static member function">;
8919 def err_coroutine_promise_new_requires_nothrow : Error<
8920   "%0 is required to have a non-throwing noexcept specification when the promise "
8921    "type declares 'get_return_object_on_allocation_failure()'">;
8922 def note_coroutine_promise_call_implicitly_required : Note<
8923   "call to %0 implicitly required by coroutine function here">;
8924 }
8925
8926 let CategoryName = "Documentation Issue" in {
8927 def warn_not_a_doxygen_trailing_member_comment : Warning<
8928   "not a Doxygen trailing comment">, InGroup<Documentation>, DefaultIgnore;
8929 } // end of documentation issue category
8930
8931 let CategoryName = "Instrumentation Issue" in {
8932 def warn_profile_data_out_of_date : Warning<
8933   "profile data may be out of date: of %0 function%s0, %1 %plural{1:has|:have}1"
8934   " no data and %2 %plural{1:has|:have}2 mismatched data that will be ignored">,
8935   InGroup<ProfileInstrOutOfDate>;
8936 def warn_profile_data_unprofiled : Warning<
8937   "no profile data available for file \"%0\"">,
8938   InGroup<ProfileInstrUnprofiled>;
8939
8940 } // end of instrumentation issue category
8941
8942 let CategoryName = "Nullability Issue" in {
8943
8944 def warn_mismatched_nullability_attr : Warning<
8945   "nullability specifier %0 conflicts with existing specifier %1">,
8946   InGroup<Nullability>;
8947
8948 def warn_nullability_declspec : Warning<
8949   "nullability specifier %0 cannot be applied "
8950   "to non-pointer type %1; did you mean to apply the specifier to the "
8951   "%select{pointer|block pointer|member pointer|function pointer|"
8952   "member function pointer}2?">,
8953   InGroup<NullabilityDeclSpec>,
8954   DefaultError;
8955
8956 def note_nullability_here : Note<"%0 specified here">;
8957
8958 def err_nullability_nonpointer : Error<
8959   "nullability specifier %0 cannot be applied to non-pointer type %1">;
8960
8961 def warn_nullability_lost : Warning<
8962   "implicit conversion from nullable pointer %0 to non-nullable pointer "
8963   "type %1">,
8964   InGroup<NullableToNonNullConversion>, DefaultIgnore;
8965
8966 def err_nullability_cs_multilevel : Error<
8967   "nullability keyword %0 cannot be applied to multi-level pointer type %1">;
8968 def note_nullability_type_specifier : Note<
8969   "use nullability type specifier %0 to affect the innermost "
8970   "pointer type of %1">;
8971
8972 def warn_null_resettable_setter : Warning<
8973   "synthesized setter %0 for null_resettable property %1 does not handle nil">,
8974   InGroup<Nullability>;
8975
8976 def warn_nullability_missing : Warning<
8977   "%select{pointer|block pointer|member pointer}0 is missing a nullability "
8978   "type specifier (_Nonnull, _Nullable, or _Null_unspecified)">,
8979   InGroup<NullabilityCompleteness>;
8980 def warn_nullability_missing_array : Warning<
8981   "array parameter is missing a nullability type specifier (_Nonnull, "
8982   "_Nullable, or _Null_unspecified)">,
8983   InGroup<NullabilityCompletenessOnArrays>;
8984 def note_nullability_fix_it : Note<
8985   "insert '%select{_Nonnull|_Nullable|_Null_unspecified}0' if the "
8986   "%select{pointer|block pointer|member pointer|array parameter}1 "
8987   "%select{should never be null|may be null|should not declare nullability}0">;
8988
8989 def warn_nullability_inferred_on_nested_type : Warning<
8990   "inferring '_Nonnull' for pointer type within %select{array|reference}0 is "
8991   "deprecated">,
8992   InGroup<NullabilityInferredOnNestedType>;
8993
8994 def err_objc_type_arg_explicit_nullability : Error<
8995   "type argument %0 cannot explicitly specify nullability">;
8996
8997 def err_objc_type_param_bound_explicit_nullability : Error<
8998   "type parameter %0 bound %1 cannot explicitly specify nullability">;
8999
9000 }
9001
9002 let CategoryName = "Generics Issue" in {
9003
9004 def err_objc_type_param_bound_nonobject : Error<
9005   "type bound %0 for type parameter %1 is not an Objective-C pointer type">;
9006
9007 def err_objc_type_param_bound_missing_pointer : Error<
9008   "missing '*' in type bound %0 for type parameter %1">;
9009 def err_objc_type_param_bound_qualified : Error<
9010   "type bound %1 for type parameter %0 cannot be qualified with '%2'">;
9011
9012 def err_objc_type_param_redecl : Error<
9013   "redeclaration of type parameter %0">;
9014
9015 def err_objc_type_param_arity_mismatch : Error<
9016   "%select{forward class declaration|class definition|category|extension}0 has "
9017   "too %select{few|many}1 type parameters (expected %2, have %3)">;
9018
9019 def err_objc_type_param_bound_conflict : Error<
9020   "type bound %0 for type parameter %1 conflicts with "
9021   "%select{implicit|previous}2 bound %3%select{for type parameter %5|}4">;
9022
9023 def err_objc_type_param_variance_conflict : Error<
9024   "%select{in|co|contra}0variant type parameter %1 conflicts with previous "
9025   "%select{in|co|contra}2variant type parameter %3">;
9026
9027 def note_objc_type_param_here : Note<"type parameter %0 declared here">;
9028
9029 def err_objc_type_param_bound_missing : Error<
9030   "missing type bound %0 for type parameter %1 in %select{@interface|@class}2">;
9031
9032 def err_objc_parameterized_category_nonclass : Error<
9033   "%select{extension|category}0 of non-parameterized class %1 cannot have type "
9034   "parameters">;
9035
9036 def err_objc_parameterized_forward_class : Error<
9037   "forward declaration of non-parameterized class %0 cannot have type "
9038   "parameters">;
9039
9040 def err_objc_parameterized_forward_class_first : Error<
9041   "class %0 previously declared with type parameters">;
9042
9043 def err_objc_type_arg_missing_star : Error<
9044   "type argument %0 must be a pointer (requires a '*')">;
9045 def err_objc_type_arg_qualified : Error<
9046   "type argument %0 cannot be qualified with '%1'">;
9047
9048 def err_objc_type_arg_missing : Error<
9049   "no type or protocol named %0">;
9050
9051 def err_objc_type_args_and_protocols : Error<
9052   "angle brackets contain both a %select{type|protocol}0 (%1) and a "
9053   "%select{protocol|type}0 (%2)">;
9054
9055 def err_objc_type_args_non_class : Error<
9056   "type arguments cannot be applied to non-class type %0">;
9057
9058 def err_objc_type_args_non_parameterized_class : Error<
9059   "type arguments cannot be applied to non-parameterized class %0">;
9060
9061 def err_objc_type_args_specialized_class : Error<
9062   "type arguments cannot be applied to already-specialized class type %0">;
9063
9064 def err_objc_type_args_wrong_arity : Error<
9065   "too %select{many|few}0 type arguments for class %1 (have %2, expected %3)">;
9066 }
9067
9068 def err_objc_type_arg_not_id_compatible : Error<
9069   "type argument %0 is neither an Objective-C object nor a block type">;
9070
9071 def err_objc_type_arg_does_not_match_bound : Error<
9072   "type argument %0 does not satisfy the bound (%1) of type parameter %2">;
9073
9074 def warn_objc_redundant_qualified_class_type : Warning<
9075   "parameterized class %0 already conforms to the protocols listed; did you "
9076   "forget a '*'?">, InGroup<ObjCProtocolQualifiers>;
9077
9078 def warn_block_literal_attributes_on_omitted_return_type : Warning<
9079   "attribute %0 ignored, because it cannot be applied to omitted return type">,
9080   InGroup<IgnoredAttributes>;
9081
9082 def warn_block_literal_qualifiers_on_omitted_return_type : Warning<
9083   "'%0' qualifier on omitted return type %1 has no effect">,
9084   InGroup<IgnoredQualifiers>;
9085
9086 def ext_warn_gnu_final : ExtWarn<
9087   "__final is a GNU extension, consider using C++11 final">,
9088   InGroup<GccCompat>;
9089
9090 def warn_shadow_field :
9091   Warning<"non-static data member '%0' of '%1' shadows member inherited from type '%2'">,
9092   InGroup<ShadowField>, DefaultIgnore;
9093 def note_shadow_field : Note<"declared here">;
9094
9095 } // end of sema component.