]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - include/clang/Basic/DiagnosticSemaKinds.td
Vendor import of clang trunk r302418:
[FreeBSD/FreeBSD.git] / 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_atl_uuid_deprecated : Warning<
734   "specifying 'uuid' as an ATL attribute is deprecated; use __declspec instead">,
735   InGroup<DeprecatedDeclarations>;
736 def warn_pragma_unused_expected_var_arg : Warning<
737   "only variables can be arguments to '#pragma unused'">,
738   InGroup<IgnoredPragmas>;
739 def err_pragma_push_visibility_mismatch : Error<
740   "#pragma visibility push with no matching #pragma visibility pop">;
741 def note_surrounding_namespace_ends_here : Note<
742   "surrounding namespace with visibility attribute ends here">;
743 def err_pragma_pop_visibility_mismatch : Error<
744   "#pragma visibility pop with no matching #pragma visibility push">;
745 def note_surrounding_namespace_starts_here : Note<
746   "surrounding namespace with visibility attribute starts here">;
747 def err_pragma_loop_invalid_argument_type : Error<
748   "invalid argument of type %0; expected an integer type">;
749 def err_pragma_loop_invalid_argument_value : Error<
750   "%select{invalid value '%0'; must be positive|value '%0' is too large}1">;
751 def err_pragma_loop_compatibility : Error<
752   "%select{incompatible|duplicate}0 directives '%1' and '%2'">;
753 def err_pragma_loop_precedes_nonloop : Error<
754   "expected a for, while, or do-while loop to follow '%0'">;
755
756 def err_pragma_attribute_matcher_subrule_contradicts_rule : Error<
757   "redundant attribute subject matcher sub-rule '%0'; '%1' already matches "
758   "those declarations">;
759 def err_pragma_attribute_matcher_negated_subrule_contradicts_subrule : Error<
760   "negated attribute subject matcher sub-rule '%0' contradicts sub-rule '%1'">;
761 def err_pragma_attribute_invalid_matchers : Error<
762   "attribute %0 can't be applied to %1">;
763 def err_pragma_attribute_stack_mismatch : Error<
764   "'#pragma clang attribute pop' with no matching '#pragma clang attribute push'">;
765 def warn_pragma_attribute_unused : Warning<
766   "unused attribute %0 in '#pragma clang attribute push' region">,
767   InGroup<PragmaClangAttribute>;
768 def note_pragma_attribute_region_ends_here : Note<
769   "'#pragma clang attribute push' regions ends here">;
770 def err_pragma_attribute_no_pop_eof : Error<"unterminated "
771   "'#pragma clang attribute push' at end of file">;
772 def note_pragma_attribute_applied_decl_here : Note<
773   "when applied to this declaration">;
774
775 /// Objective-C parser diagnostics
776 def err_duplicate_class_def : Error<
777   "duplicate interface definition for class %0">;
778 def err_undef_superclass : Error<
779   "cannot find interface declaration for %0, superclass of %1">;
780 def err_forward_superclass : Error<
781   "attempting to use the forward class %0 as superclass of %1">;
782 def err_no_nsconstant_string_class : Error<
783   "cannot find interface declaration for %0">;
784 def err_recursive_superclass : Error<
785   "trying to recursively use %0 as superclass of %1">;
786 def err_conflicting_aliasing_type : Error<"conflicting types for alias %0">;
787 def warn_undef_interface : Warning<"cannot find interface declaration for %0">;
788 def warn_duplicate_protocol_def : Warning<
789   "duplicate protocol definition of %0 is ignored">,
790   InGroup<DiagGroup<"duplicate-protocol">>;
791 def err_protocol_has_circular_dependency : Error<
792   "protocol has circular dependency">;
793 def err_undeclared_protocol : Error<"cannot find protocol declaration for %0">;
794 def warn_undef_protocolref : Warning<"cannot find protocol definition for %0">;
795 def warn_atprotocol_protocol : Warning<
796   "@protocol is using a forward protocol declaration of %0">, InGroup<AtProtocol>;
797 def warn_readonly_property : Warning<
798   "attribute 'readonly' of property %0 restricts attribute "
799   "'readwrite' of property inherited from %1">,
800   InGroup<PropertyAttr>;
801
802 def warn_property_attribute : Warning<
803   "'%1' attribute on property %0 does not match the property inherited from %2">,
804   InGroup<PropertyAttr>;
805 def warn_property_types_are_incompatible : Warning<
806   "property type %0 is incompatible with type %1 inherited from %2">,
807   InGroup<DiagGroup<"incompatible-property-type">>;
808 def warn_protocol_property_mismatch : Warning<
809   "property of type %0 was selected for synthesis">,
810   InGroup<DiagGroup<"protocol-property-synthesis-ambiguity">>;
811 def err_undef_interface : Error<"cannot find interface declaration for %0">;
812 def err_category_forward_interface : Error<
813   "cannot define %select{category|class extension}0 for undefined class %1">;
814 def err_class_extension_after_impl : Error<
815   "cannot declare class extension for %0 after class implementation">;
816 def note_implementation_declared : Note<
817   "class implementation is declared here">;
818 def note_while_in_implementation : Note<
819   "detected while default synthesizing properties in class implementation">;
820 def note_class_declared : Note<
821   "class is declared here">;
822 def note_receiver_class_declared : Note<
823   "receiver is instance of class declared here">;
824 def note_receiver_expr_here : Note<
825   "receiver expression is here">;
826 def note_receiver_is_id : Note<
827   "receiver is treated with 'id' type for purpose of method lookup">;
828 def note_suppressed_class_declare : Note<
829   "class with specified objc_requires_property_definitions attribute is declared here">;
830 def err_objc_root_class_subclass : Error<
831   "objc_root_class attribute may only be specified on a root class declaration">;
832 def err_restricted_superclass_mismatch : Error<
833   "cannot subclass a class that was declared with the "
834   "'objc_subclassing_restricted' attribute">;
835 def warn_objc_root_class_missing : Warning<
836   "class %0 defined without specifying a base class">,
837   InGroup<ObjCRootClass>;
838 def err_objc_runtime_visible_category : Error<
839   "cannot implement a category for class %0 that is only visible via the "
840   "Objective-C runtime">;
841 def err_objc_runtime_visible_subclass : Error<
842   "cannot implement subclass %0 of a superclass %1 that is only visible via the "
843   "Objective-C runtime">;
844 def note_objc_needs_superclass : Note<
845   "add a super class to fix this problem">;
846 def warn_dup_category_def : Warning<
847   "duplicate definition of category %1 on interface %0">;
848 def err_conflicting_super_class : Error<"conflicting super class name %0">;
849 def err_dup_implementation_class : Error<"reimplementation of class %0">;
850 def err_dup_implementation_category : Error<
851   "reimplementation of category %1 for class %0">;
852 def err_conflicting_ivar_type : Error<
853   "instance variable %0 has conflicting type%diff{: $ vs $|}1,2">;
854 def err_duplicate_ivar_declaration : Error<
855   "instance variable is already declared">;
856 def warn_on_superclass_use : Warning<
857   "class implementation may not have super class">;
858 def err_conflicting_ivar_bitwidth : Error<
859   "instance variable %0 has conflicting bit-field width">;
860 def err_conflicting_ivar_name : Error<
861   "conflicting instance variable names: %0 vs %1">;
862 def err_inconsistent_ivar_count : Error<
863   "inconsistent number of instance variables specified">;
864 def warn_undef_method_impl : Warning<"method definition for %0 not found">,
865   InGroup<DiagGroup<"incomplete-implementation">>;
866
867 def warn_conflicting_overriding_ret_types : Warning<
868   "conflicting return type in "
869   "declaration of %0%diff{: $ vs $|}1,2">,
870   InGroup<OverridingMethodMismatch>, DefaultIgnore;
871
872 def warn_conflicting_ret_types : Warning<
873   "conflicting return type in "
874   "implementation of %0%diff{: $ vs $|}1,2">,
875   InGroup<MismatchedReturnTypes>;
876
877 def warn_conflicting_overriding_ret_type_modifiers : Warning<
878   "conflicting distributed object modifiers on return type "
879   "in declaration of %0">,
880   InGroup<OverridingMethodMismatch>, DefaultIgnore;
881
882 def warn_conflicting_ret_type_modifiers : Warning<
883   "conflicting distributed object modifiers on return type "
884   "in implementation of %0">,
885   InGroup<DistributedObjectModifiers>;
886
887 def warn_non_covariant_overriding_ret_types : Warning<
888   "conflicting return type in "
889   "declaration of %0: %1 vs %2">,
890   InGroup<OverridingMethodMismatch>, DefaultIgnore;
891
892 def warn_non_covariant_ret_types : Warning<
893   "conflicting return type in "
894   "implementation of %0: %1 vs %2">,
895   InGroup<MethodSignatures>, DefaultIgnore;
896
897 def warn_conflicting_overriding_param_types : Warning<
898   "conflicting parameter types in "
899   "declaration of %0%diff{: $ vs $|}1,2">,
900   InGroup<OverridingMethodMismatch>, DefaultIgnore;
901
902 def warn_conflicting_param_types : Warning<
903   "conflicting parameter types in "
904   "implementation of %0%diff{: $ vs $|}1,2">,
905   InGroup<MismatchedParameterTypes>;
906
907 def warn_conflicting_param_modifiers : Warning<
908   "conflicting distributed object modifiers on parameter type "
909   "in implementation of %0">,
910   InGroup<DistributedObjectModifiers>;
911
912 def warn_conflicting_overriding_param_modifiers : Warning<
913   "conflicting distributed object modifiers on parameter type "
914   "in declaration of %0">,
915   InGroup<OverridingMethodMismatch>, DefaultIgnore;
916
917 def warn_non_contravariant_overriding_param_types : Warning<
918   "conflicting parameter types in "
919   "declaration of %0: %1 vs %2">,
920   InGroup<OverridingMethodMismatch>, DefaultIgnore;
921
922 def warn_non_contravariant_param_types : Warning<
923   "conflicting parameter types in "
924   "implementation of %0: %1 vs %2">,
925   InGroup<MethodSignatures>, DefaultIgnore;
926
927 def warn_conflicting_overriding_variadic :Warning<
928   "conflicting variadic declaration of method and its "
929   "implementation">,
930   InGroup<OverridingMethodMismatch>, DefaultIgnore;
931
932 def warn_conflicting_variadic :Warning<
933   "conflicting variadic declaration of method and its "
934   "implementation">;
935
936 def warn_category_method_impl_match:Warning<
937   "category is implementing a method which will also be implemented"
938   " by its primary class">, InGroup<ObjCProtocolMethodImpl>;
939
940 def warn_implements_nscopying : Warning<
941 "default assign attribute on property %0 which implements "
942 "NSCopying protocol is not appropriate with -fobjc-gc[-only]">;
943
944 def warn_multiple_method_decl : Warning<"multiple methods named %0 found">,
945   InGroup<ObjCMultipleMethodNames>;
946 def warn_strict_multiple_method_decl : Warning<
947   "multiple methods named %0 found">, InGroup<StrictSelector>, DefaultIgnore;
948 def warn_accessor_property_type_mismatch : Warning<
949   "type of property %0 does not match type of accessor %1">;
950 def note_conv_function_declared_at : Note<"type conversion function declared here">;
951 def note_method_declared_at : Note<"method %0 declared here">;
952 def note_property_attribute : Note<"property %0 is declared "
953   "%select{deprecated|unavailable|partial}1 here">;
954 def err_setter_type_void : Error<"type of setter must be void">;
955 def err_duplicate_method_decl : Error<"duplicate declaration of method %0">;
956 def warn_duplicate_method_decl : 
957   Warning<"multiple declarations of method %0 found and ignored">, 
958   InGroup<MethodDuplicate>, DefaultIgnore;
959 def warn_objc_cdirective_format_string :
960   Warning<"using %0 directive in %select{NSString|CFString}1 "
961           "which is being passed as a formatting argument to the formatting "
962           "%select{method|CFfunction}2">,
963   InGroup<ObjCCStringFormat>, DefaultIgnore;
964 def err_objc_var_decl_inclass : 
965     Error<"cannot declare variable inside @interface or @protocol">;
966 def err_missing_method_context : Error<
967   "missing context for method declaration">;
968 def err_objc_property_attr_mutually_exclusive : Error<
969   "property attributes '%0' and '%1' are mutually exclusive">;
970 def err_objc_property_requires_object : Error<
971   "property with '%0' attribute must be of object type">;
972 def warn_objc_property_no_assignment_attribute : Warning<
973   "no 'assign', 'retain', or 'copy' attribute is specified - "
974   "'assign' is assumed">,
975   InGroup<ObjCPropertyNoAttribute>;
976 def warn_objc_isa_use : Warning<
977   "direct access to Objective-C's isa is deprecated in favor of "
978   "object_getClass()">, InGroup<DeprecatedObjCIsaUsage>;
979 def warn_objc_isa_assign : Warning<
980   "assignment to Objective-C's isa is deprecated in favor of "
981   "object_setClass()">, InGroup<DeprecatedObjCIsaUsage>;
982 def warn_objc_pointer_masking : Warning<
983   "bitmasking for introspection of Objective-C object pointers is strongly "
984   "discouraged">,
985   InGroup<ObjCPointerIntrospect>;
986 def warn_objc_pointer_masking_performSelector : Warning<warn_objc_pointer_masking.Text>,
987   InGroup<ObjCPointerIntrospectPerformSelector>;
988 def warn_objc_property_default_assign_on_object : Warning<
989   "default property attribute 'assign' not appropriate for non-GC object">,
990   InGroup<ObjCPropertyNoAttribute>;
991 def warn_property_attr_mismatch : Warning<
992   "property attribute in class extension does not match the primary class">,
993   InGroup<PropertyAttr>;
994 def warn_property_implicitly_mismatched : Warning <
995   "primary property declaration is implicitly strong while redeclaration "
996   "in class extension is weak">,
997   InGroup<DiagGroup<"objc-property-implicit-mismatch">>;
998 def warn_objc_property_copy_missing_on_block : Warning<
999     "'copy' attribute must be specified for the block property "
1000     "when -fobjc-gc-only is specified">;
1001 def warn_objc_property_retain_of_block : Warning<
1002     "retain'ed block property does not copy the block "
1003     "- use copy attribute instead">, InGroup<ObjCRetainBlockProperty>;
1004 def warn_objc_readonly_property_has_setter : Warning<
1005     "setter cannot be specified for a readonly property">,
1006     InGroup<ObjCReadonlyPropertyHasSetter>;
1007 def warn_atomic_property_rule : Warning<
1008   "writable atomic property %0 cannot pair a synthesized %select{getter|setter}1 "
1009   "with a user defined %select{getter|setter}2">,
1010   InGroup<DiagGroup<"atomic-property-with-user-defined-accessor">>;
1011 def note_atomic_property_fixup_suggest : Note<"setter and getter must both be "
1012   "synthesized, or both be user defined,or the property must be nonatomic">;
1013 def err_atomic_property_nontrivial_assign_op : Error<
1014   "atomic property of reference type %0 cannot have non-trivial assignment"
1015   " operator">;
1016 def warn_cocoa_naming_owned_rule : Warning<
1017   "property follows Cocoa naming"
1018   " convention for returning 'owned' objects">,
1019   InGroup<DiagGroup<"objc-property-matches-cocoa-ownership-rule">>;
1020 def err_cocoa_naming_owned_rule : Error<
1021   "property follows Cocoa naming"
1022   " convention for returning 'owned' objects">;
1023 def note_cocoa_naming_declare_family : Note<
1024   "explicitly declare getter %objcinstance0 with '%1' to return an 'unowned' "
1025   "object">;
1026 def warn_auto_synthesizing_protocol_property :Warning<
1027   "auto property synthesis will not synthesize property %0"
1028   " declared in protocol %1">,
1029   InGroup<DiagGroup<"objc-protocol-property-synthesis">>;
1030 def warn_no_autosynthesis_shared_ivar_property : Warning <
1031   "auto property synthesis will not synthesize property "
1032   "%0 because it cannot share an ivar with another synthesized property">,
1033   InGroup<ObjCNoPropertyAutoSynthesis>;
1034 def warn_no_autosynthesis_property : Warning<
1035   "auto property synthesis will not synthesize property "
1036   "%0 because it is 'readwrite' but it will be synthesized 'readonly' "
1037   "via another property">,
1038   InGroup<ObjCNoPropertyAutoSynthesis>;
1039 def warn_autosynthesis_property_in_superclass : Warning<
1040   "auto property synthesis will not synthesize property "
1041   "%0; it will be implemented by its superclass, use @dynamic to "
1042   "acknowledge intention">,
1043   InGroup<ObjCNoPropertyAutoSynthesis>;
1044 def warn_autosynthesis_property_ivar_match :Warning<
1045   "autosynthesized property %0 will use %select{|synthesized}1 instance variable "
1046   "%2, not existing instance variable %3">,
1047   InGroup<DiagGroup<"objc-autosynthesis-property-ivar-name-match">>;
1048 def warn_missing_explicit_synthesis : Warning <
1049   "auto property synthesis is synthesizing property not explicitly synthesized">,
1050   InGroup<DiagGroup<"objc-missing-property-synthesis">>, DefaultIgnore;
1051 def warn_property_getter_owning_mismatch : Warning<
1052   "property declared as returning non-retained objects"
1053   "; getter returning retained objects">;
1054 def warn_property_redecl_getter_mismatch : Warning<
1055   "getter name mismatch between property redeclaration (%1) and its original "
1056   "declaration (%0)">, InGroup<PropertyAttr>;
1057 def err_property_setter_ambiguous_use : Error<
1058   "synthesized properties %0 and %1 both claim setter %2 -"
1059   " use of this setter will cause unexpected behavior">;
1060 def warn_default_atomic_custom_getter_setter : Warning<
1061   "atomic by default property %0 has a user defined %select{getter|setter}1 "
1062   "(property should be marked 'atomic' if this is intended)">,
1063   InGroup<CustomAtomic>, DefaultIgnore;
1064 def err_use_continuation_class : Error<
1065   "illegal redeclaration of property in class extension %0"
1066   " (attribute must be 'readwrite', while its primary must be 'readonly')">;
1067 def err_type_mismatch_continuation_class : Error<
1068   "type of property %0 in class extension does not match "
1069   "property type in primary class">;
1070 def err_use_continuation_class_redeclaration_readwrite : Error<
1071   "illegal redeclaration of 'readwrite' property in class extension %0"
1072   " (perhaps you intended this to be a 'readwrite' redeclaration of a "
1073   "'readonly' public property?)">;
1074 def err_continuation_class : Error<"class extension has no primary class">;
1075 def err_property_type : Error<"property cannot have array or function type %0">;
1076 def err_missing_property_context : Error<
1077   "missing context for property implementation declaration">;
1078 def err_bad_property_decl : Error<
1079   "property implementation must have its declaration in interface %0 or one of "
1080   "its extensions">;
1081 def err_category_property : Error<
1082   "property declared in category %0 cannot be implemented in "
1083   "class implementation">;
1084 def note_property_declare : Note<
1085   "property declared here">;
1086 def note_protocol_property_declare : Note<
1087   "it could also be property of type %0 declared here">;
1088 def note_property_synthesize : Note<
1089   "property synthesized here">;
1090 def err_synthesize_category_decl : Error<
1091   "@synthesize not allowed in a category's implementation">;
1092 def err_synthesize_on_class_property : Error<
1093   "@synthesize not allowed on a class property %0">;
1094 def err_missing_property_interface : Error<
1095   "property implementation in a category with no category declaration">;
1096 def err_bad_category_property_decl : Error<
1097   "property implementation must have its declaration in the category %0">;
1098 def err_bad_property_context : Error<
1099   "property implementation must be in a class or category implementation">;
1100 def err_missing_property_ivar_decl : Error<
1101   "synthesized property %0 must either be named the same as a compatible"
1102   " instance variable or must explicitly name an instance variable">;
1103 def err_arc_perform_selector_retains : Error<
1104   "performSelector names a selector which retains the object">;
1105 def warn_arc_perform_selector_leaks : Warning<
1106   "performSelector may cause a leak because its selector is unknown">,
1107   InGroup<DiagGroup<"arc-performSelector-leaks">>;
1108 def warn_dealloc_in_category : Warning<
1109 "-dealloc is being overridden in a category">,
1110 InGroup<DeallocInCategory>;
1111 def err_gc_weak_property_strong_type : Error<
1112   "weak attribute declared on a __strong type property in GC mode">;
1113 def warn_arc_repeated_use_of_weak : Warning <
1114   "weak %select{variable|property|implicit property|instance variable}0 %1 is "
1115   "accessed multiple times in this %select{function|method|block|lambda}2 "
1116   "but may be unpredictably set to nil; assign to a strong variable to keep "
1117   "the object alive">,
1118   InGroup<ARCRepeatedUseOfWeak>, DefaultIgnore;
1119 def warn_implicitly_retains_self : Warning <
1120   "block implicitly retains 'self'; explicitly mention 'self' to indicate "
1121   "this is intended behavior">,
1122   InGroup<DiagGroup<"implicit-retain-self">>, DefaultIgnore;
1123 def warn_arc_possible_repeated_use_of_weak : Warning <
1124   "weak %select{variable|property|implicit property|instance variable}0 %1 may "
1125   "be accessed multiple times in this %select{function|method|block|lambda}2 "
1126   "and may be unpredictably set to nil; assign to a strong variable to keep "
1127   "the object alive">,
1128   InGroup<ARCRepeatedUseOfWeakMaybe>, DefaultIgnore;
1129 def note_arc_weak_also_accessed_here : Note<
1130   "also accessed here">;
1131 def err_incomplete_synthesized_property : Error<
1132   "cannot synthesize property %0 with incomplete type %1">;
1133
1134 def err_property_ivar_type : Error<
1135   "type of property %0 (%1) does not match type of instance variable %2 (%3)">;
1136 def err_property_accessor_type : Error<
1137   "type of property %0 (%1) does not match type of accessor %2 (%3)">;
1138 def err_ivar_in_superclass_use : Error<
1139   "property %0 attempting to use instance variable %1 declared in super class %2">;
1140 def err_weak_property : Error<
1141   "existing instance variable %1 for __weak property %0 must be __weak">;
1142 def err_strong_property : Error<
1143   "existing instance variable %1 for strong property %0 may not be __weak">;
1144 def err_dynamic_property_ivar_decl : Error<
1145   "dynamic property cannot have instance variable specification">;
1146 def err_duplicate_ivar_use : Error<
1147   "synthesized properties %0 and %1 both claim instance variable %2">;
1148 def err_property_implemented : Error<"property %0 is already implemented">;
1149 def warn_objc_missing_super_call : Warning<
1150   "method possibly missing a [super %0] call">,
1151   InGroup<ObjCMissingSuperCalls>;
1152 def err_dealloc_bad_result_type : Error<
1153   "dealloc return type must be correctly specified as 'void' under ARC, "
1154   "instead of %0">;
1155 def warn_undeclared_selector : Warning<
1156   "undeclared selector %0">, InGroup<UndeclaredSelector>, DefaultIgnore;
1157 def warn_undeclared_selector_with_typo : Warning<
1158   "undeclared selector %0; did you mean %1?">,
1159   InGroup<UndeclaredSelector>, DefaultIgnore;
1160 def warn_implicit_atomic_property : Warning<
1161   "property is assumed atomic by default">, InGroup<ImplicitAtomic>, DefaultIgnore;
1162 def note_auto_readonly_iboutlet_fixup_suggest : Note<
1163   "property should be changed to be readwrite">;
1164 def warn_auto_readonly_iboutlet_property : Warning<
1165   "readonly IBOutlet property %0 when auto-synthesized may "
1166   "not work correctly with 'nib' loader">,
1167   InGroup<DiagGroup<"readonly-iboutlet-property">>;
1168 def warn_auto_implicit_atomic_property : Warning<
1169   "property is assumed atomic when auto-synthesizing the property">,
1170   InGroup<ImplicitAtomic>, DefaultIgnore;
1171 def warn_unimplemented_selector:  Warning<
1172   "no method with selector %0 is implemented in this translation unit">, 
1173   InGroup<Selector>, DefaultIgnore;
1174 def warn_unimplemented_protocol_method : Warning<
1175   "method %0 in protocol %1 not implemented">, InGroup<Protocol>;
1176 def warn_multiple_selectors: Warning<
1177   "several methods with selector %0 of mismatched types are found "
1178   "for the @selector expression">,
1179   InGroup<SelectorTypeMismatch>, DefaultIgnore;
1180
1181 def err_objc_kindof_nonobject : Error<
1182   "'__kindof' specifier cannot be applied to non-object type %0">;
1183 def err_objc_kindof_wrong_position : Error<
1184   "'__kindof' type specifier must precede the declarator">;
1185
1186 def err_objc_method_unsupported_param_ret_type : Error<
1187   "%0 %select{parameter|return}1 type is unsupported; "
1188   "support for vector types for this target is introduced in %2">;
1189
1190 // C++ declarations
1191 def err_static_assert_expression_is_not_constant : Error<
1192   "static_assert expression is not an integral constant expression">;
1193 def err_static_assert_failed : Error<"static_assert failed%select{ %1|}0">;
1194 def ext_static_assert_no_message : ExtWarn<
1195   "static_assert with no message is a C++1z extension">, InGroup<CXX1z>;
1196 def warn_cxx14_compat_static_assert_no_message : Warning<
1197   "static_assert with no message is incompatible with C++ standards before C++1z">,
1198   DefaultIgnore, InGroup<CXXPre1zCompat>;
1199
1200 def ext_inline_variable : ExtWarn<
1201   "inline variables are a C++1z extension">, InGroup<CXX1z>;
1202 def warn_cxx14_compat_inline_variable : Warning<
1203   "inline variables are incompatible with C++ standards before C++1z">,
1204   DefaultIgnore, InGroup<CXXPre1zCompat>;
1205
1206 def warn_inline_namespace_reopened_noninline : Warning<
1207   "inline namespace reopened as a non-inline namespace">;
1208 def err_inline_namespace_mismatch : Error<
1209   "non-inline namespace cannot be reopened as inline">;
1210
1211 def err_unexpected_friend : Error<
1212   "friends can only be classes or functions">;
1213 def ext_enum_friend : ExtWarn<
1214   "befriending enumeration type %0 is a C++11 extension">, InGroup<CXX11>;
1215 def warn_cxx98_compat_enum_friend : Warning<
1216   "befriending enumeration type %0 is incompatible with C++98">,
1217   InGroup<CXX98Compat>, DefaultIgnore;
1218 def ext_nonclass_type_friend : ExtWarn<
1219   "non-class friend type %0 is a C++11 extension">, InGroup<CXX11>;
1220 def warn_cxx98_compat_nonclass_type_friend : Warning<
1221   "non-class friend type %0 is incompatible with C++98">,
1222   InGroup<CXX98Compat>, DefaultIgnore;
1223 def err_friend_is_member : Error<
1224   "friends cannot be members of the declaring class">;
1225 def warn_cxx98_compat_friend_is_member : Warning<
1226   "friend declaration naming a member of the declaring class is incompatible "
1227   "with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
1228 def ext_unelaborated_friend_type : ExtWarn<
1229   "unelaborated friend declaration is a C++11 extension; specify "
1230   "'%select{struct|interface|union|class|enum}0' to befriend %1">,
1231   InGroup<CXX11>;
1232 def warn_cxx98_compat_unelaborated_friend_type : Warning<
1233   "befriending %1 without '%select{struct|interface|union|class|enum}0' "
1234   "keyword is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
1235 def err_qualified_friend_not_found : Error<
1236   "no function named %0 with type %1 was found in the specified scope">;
1237 def err_introducing_special_friend : Error<
1238   "%plural{[0,2]:must use a qualified name when declaring|3:cannot declare}0"
1239   " a %select{constructor|destructor|conversion operator|deduction guide}0 "
1240   "as a friend">;
1241 def err_tagless_friend_type_template : Error<
1242   "friend type templates must use an elaborated type">;
1243 def err_no_matching_local_friend : Error<
1244   "no matching function found in local scope">;
1245 def err_no_matching_local_friend_suggest : Error<
1246   "no matching function %0 found in local scope; did you mean %3?">;
1247 def err_partial_specialization_friend : Error<
1248   "partial specialization cannot be declared as a friend">;
1249 def err_qualified_friend_def : Error<
1250   "friend function definition cannot be qualified with '%0'">;
1251 def err_friend_def_in_local_class : Error<
1252   "friend function cannot be defined in a local class">;
1253 def err_friend_not_first_in_declaration : Error<
1254   "'friend' must appear first in a non-function declaration">;
1255 def err_using_decl_friend : Error<
1256   "cannot befriend target of using declaration">;
1257 def warn_template_qualified_friend_unsupported : Warning<
1258   "dependent nested name specifier '%0' for friend class declaration is "
1259   "not supported; turning off access control for %1">,
1260   InGroup<UnsupportedFriend>;
1261 def warn_template_qualified_friend_ignored : Warning<
1262   "dependent nested name specifier '%0' for friend template declaration is "
1263   "not supported; ignoring this friend declaration">,
1264   InGroup<UnsupportedFriend>;
1265 def ext_friend_tag_redecl_outside_namespace : ExtWarn<
1266   "unqualified friend declaration referring to type outside of the nearest "
1267   "enclosing namespace is a Microsoft extension; add a nested name specifier">,
1268   InGroup<MicrosoftUnqualifiedFriend>;
1269 def err_pure_friend : Error<"friend declaration cannot have a pure-specifier">;
1270
1271 def err_invalid_member_in_interface : Error<
1272   "%select{data member |non-public member function |static member function |"
1273           "user-declared constructor|user-declared destructor|operator |"
1274           "nested class }0%1 is not permitted within an interface type">;
1275 def err_invalid_base_in_interface : Error<
1276   "interface type cannot inherit from "
1277   "%select{'struct|non-public 'interface|'class}0 %1'">;
1278
1279 def err_abstract_type_in_decl : Error<
1280   "%select{return|parameter|variable|field|instance variable|"
1281   "synthesized instance variable}0 type %1 is an abstract class">;
1282 def err_allocation_of_abstract_type : Error<
1283   "allocating an object of abstract class type %0">;
1284 def err_throw_abstract_type : Error<
1285   "cannot throw an object of abstract type %0">;
1286 def err_array_of_abstract_type : Error<"array of abstract class type %0">;
1287 def err_capture_of_abstract_type : Error<
1288   "by-copy capture of value of abstract type %0">;
1289 def err_capture_of_incomplete_type : Error<
1290   "by-copy capture of variable %0 with incomplete type %1">;
1291 def err_capture_default_non_local : Error<
1292   "non-local lambda expression cannot have a capture-default">;
1293
1294 def err_multiple_final_overriders : Error<
1295   "virtual function %q0 has more than one final overrider in %1">; 
1296 def note_final_overrider : Note<"final overrider of %q0 in %1">;
1297
1298 def err_type_defined_in_type_specifier : Error<
1299   "%0 cannot be defined in a type specifier">;
1300 def err_type_defined_in_result_type : Error<
1301   "%0 cannot be defined in the result type of a function">;
1302 def err_type_defined_in_param_type : Error<
1303   "%0 cannot be defined in a parameter type">;
1304 def err_type_defined_in_alias_template : Error<
1305   "%0 cannot be defined in a type alias template">;
1306 def err_type_defined_in_condition : Error<
1307   "%0 cannot be defined in a condition">;
1308
1309 def note_pure_virtual_function : Note<
1310   "unimplemented pure virtual method %0 in %1">;
1311
1312 def note_pure_qualified_call_kext : Note<
1313   "qualified call to %0::%1 is treated as a virtual call to %1 due to -fapple-kext">;
1314
1315 def err_deleted_decl_not_first : Error<
1316   "deleted definition must be first declaration">;
1317
1318 def err_deleted_override : Error<
1319   "deleted function %0 cannot override a non-deleted function">;
1320
1321 def err_non_deleted_override : Error<
1322   "non-deleted function %0 cannot override a deleted function">;
1323
1324 def warn_weak_vtable : Warning<
1325   "%0 has no out-of-line virtual method definitions; its vtable will be "
1326   "emitted in every translation unit">,
1327   InGroup<DiagGroup<"weak-vtables">>, DefaultIgnore;
1328 def warn_weak_template_vtable : Warning<
1329   "explicit template instantiation %0 will emit a vtable in every "
1330   "translation unit">,
1331   InGroup<DiagGroup<"weak-template-vtables">>, DefaultIgnore;
1332
1333 def ext_using_undefined_std : ExtWarn<
1334   "using directive refers to implicitly-defined namespace 'std'">;
1335   
1336 // C++ exception specifications
1337 def err_exception_spec_in_typedef : Error<
1338   "exception specifications are not allowed in %select{typedefs|type aliases}0">;
1339 def err_distant_exception_spec : Error<
1340   "exception specifications are not allowed beyond a single level "
1341   "of indirection">;
1342 def err_incomplete_in_exception_spec : Error<
1343   "%select{|pointer to |reference to }0incomplete type %1 is not allowed "
1344   "in exception specification">;
1345 def ext_incomplete_in_exception_spec : ExtWarn<err_incomplete_in_exception_spec.Text>,
1346   InGroup<MicrosoftExceptionSpec>;
1347 def err_rref_in_exception_spec : Error<
1348   "rvalue reference type %0 is not allowed in exception specification">;
1349 def err_mismatched_exception_spec : Error<
1350   "exception specification in declaration does not match previous declaration">;
1351 def ext_mismatched_exception_spec : ExtWarn<err_mismatched_exception_spec.Text>,
1352   InGroup<MicrosoftExceptionSpec>;
1353 def err_override_exception_spec : Error<
1354   "exception specification of overriding function is more lax than "
1355   "base version">;
1356 def ext_override_exception_spec : ExtWarn<err_override_exception_spec.Text>,
1357   InGroup<MicrosoftExceptionSpec>;
1358 def err_incompatible_exception_specs : Error<
1359   "target exception specification is not superset of source">;
1360 def warn_incompatible_exception_specs : Warning<
1361   err_incompatible_exception_specs.Text>, InGroup<IncompatibleExceptionSpec>;
1362 def err_deep_exception_specs_differ : Error<
1363   "exception specifications of %select{return|argument}0 types differ">;
1364 def warn_deep_exception_specs_differ : Warning<
1365   err_deep_exception_specs_differ.Text>, InGroup<IncompatibleExceptionSpec>;
1366 def err_missing_exception_specification : Error<
1367   "%0 is missing exception specification '%1'">;
1368 def ext_missing_exception_specification : ExtWarn<
1369   err_missing_exception_specification.Text>,
1370   InGroup<DiagGroup<"missing-exception-spec">>;
1371 def ext_ms_missing_exception_specification : ExtWarn<
1372   err_missing_exception_specification.Text>,
1373   InGroup<MicrosoftExceptionSpec>;
1374 def err_noexcept_needs_constant_expression : Error<
1375   "argument to noexcept specifier must be a constant expression">;
1376 def err_exception_spec_not_parsed : Error<
1377   "exception specification is not available until end of class definition">;
1378
1379 // C++ access checking
1380 def err_class_redeclared_with_different_access : Error<
1381   "%0 redeclared with '%1' access">;
1382 def err_access : Error<
1383   "%1 is a %select{private|protected}0 member of %3">, AccessControl;
1384 def ext_ms_using_declaration_inaccessible : ExtWarn<
1385   "using declaration referring to inaccessible member '%0' (which refers "
1386   "to accessible member '%1') is a Microsoft compatibility extension">,
1387     AccessControl, InGroup<MicrosoftUsingDecl>;
1388 def err_access_ctor : Error<
1389   "calling a %select{private|protected}0 constructor of class %2">, 
1390   AccessControl;
1391 def ext_rvalue_to_reference_access_ctor : Extension<
1392   "C++98 requires an accessible copy constructor for class %2 when binding "
1393   "a reference to a temporary; was %select{private|protected}0">,
1394   AccessControl, InGroup<BindToTemporaryCopy>;
1395 def err_access_base_ctor : Error<
1396   // The ERRORs represent other special members that aren't constructors, in
1397   // hopes that someone will bother noticing and reporting if they appear
1398   "%select{base class|inherited virtual base class}0 %1 has %select{private|"
1399   "protected}3 %select{default |copy |move |*ERROR* |*ERROR* "
1400   "|*ERROR*|}2constructor">, AccessControl;
1401 def err_access_field_ctor : Error<
1402   // The ERRORs represent other special members that aren't constructors, in
1403   // hopes that someone will bother noticing and reporting if they appear
1404   "field of type %0 has %select{private|protected}2 "
1405   "%select{default |copy |move |*ERROR* |*ERROR* |*ERROR* |}1constructor">,
1406   AccessControl;
1407 def err_access_friend_function : Error<
1408   "friend function %1 is a %select{private|protected}0 member of %3">,
1409   AccessControl;
1410
1411 def err_access_dtor : Error<
1412   "calling a %select{private|protected}1 destructor of class %0">, 
1413   AccessControl;
1414 def err_access_dtor_base :
1415     Error<"base class %0 has %select{private|protected}1 destructor">,
1416     AccessControl;
1417 def err_access_dtor_vbase :
1418     Error<"inherited virtual base class %1 has "
1419     "%select{private|protected}2 destructor">,
1420     AccessControl;
1421 def err_access_dtor_temp :
1422     Error<"temporary of type %0 has %select{private|protected}1 destructor">,
1423     AccessControl;
1424 def err_access_dtor_exception :
1425     Error<"exception object of type %0 has %select{private|protected}1 "
1426           "destructor">, AccessControl;
1427 def err_access_dtor_field :
1428     Error<"field of type %1 has %select{private|protected}2 destructor">,
1429     AccessControl;
1430 def err_access_dtor_var :
1431     Error<"variable of type %1 has %select{private|protected}2 destructor">,
1432     AccessControl;
1433 def err_access_dtor_ivar :
1434     Error<"instance variable of type %0 has %select{private|protected}1 "
1435           "destructor">,
1436     AccessControl;
1437 def note_previous_access_declaration : Note<
1438   "previously declared '%1' here">;
1439 def note_access_natural : Note<
1440   "%select{|implicitly }1declared %select{private|protected}0 here">;
1441 def note_access_constrained_by_path : Note<
1442   "constrained by %select{|implicitly }1%select{private|protected}0"
1443   " inheritance here">;
1444 def note_access_protected_restricted_noobject : Note<
1445   "must name member using the type of the current context %0">;
1446 def note_access_protected_restricted_ctordtor : Note<
1447   "protected %select{constructor|destructor}0 can only be used to "
1448   "%select{construct|destroy}0 a base class subobject">;
1449 def note_access_protected_restricted_object : Note<
1450   "can only access this member on an object of type %0">;
1451 def warn_cxx98_compat_sfinae_access_control : Warning<
1452   "substitution failure due to access control is incompatible with C++98">,
1453   InGroup<CXX98Compat>, DefaultIgnore, NoSFINAE;
1454   
1455 // C++ name lookup
1456 def err_incomplete_nested_name_spec : Error<
1457   "incomplete type %0 named in nested name specifier">;
1458 def err_dependent_nested_name_spec : Error<
1459   "nested name specifier for a declaration cannot depend on a template "
1460   "parameter">;
1461 def err_nested_name_member_ref_lookup_ambiguous : Error<
1462   "lookup of %0 in member access expression is ambiguous">;
1463 def ext_nested_name_member_ref_lookup_ambiguous : ExtWarn<
1464   "lookup of %0 in member access expression is ambiguous; using member of %1">,
1465   InGroup<AmbigMemberTemplate>;
1466 def note_ambig_member_ref_object_type : Note<
1467   "lookup in the object type %0 refers here">;
1468 def note_ambig_member_ref_scope : Note<
1469   "lookup from the current scope refers here">;
1470 def err_qualified_member_nonclass : Error<
1471   "qualified member access refers to a member in %0">;
1472 def err_incomplete_member_access : Error<
1473   "member access into incomplete type %0">;
1474 def err_incomplete_type : Error<
1475   "incomplete type %0 where a complete type is required">;
1476 def warn_cxx98_compat_enum_nested_name_spec : Warning<
1477   "enumeration type in nested name specifier is incompatible with C++98">,
1478   InGroup<CXX98Compat>, DefaultIgnore;
1479 def err_nested_name_spec_is_not_class : Error<
1480   "%0 cannot appear before '::' because it is not a class"
1481   "%select{ or namespace|, namespace, or enumeration}1; did you mean ':'?">;
1482 def ext_nested_name_spec_is_enum : ExtWarn<
1483   "use of enumeration in a nested name specifier is a C++11 extension">,
1484   InGroup<CXX11>;
1485 def err_out_of_line_qualified_id_type_names_constructor : Error<
1486   "qualified reference to %0 is a constructor name rather than a "
1487   "%select{template name|type}1 in this context">;
1488 def ext_out_of_line_qualified_id_type_names_constructor : ExtWarn<
1489   "ISO C++ specifies that "
1490   "qualified reference to %0 is a constructor name rather than a "
1491   "%select{template name|type}1 in this context, despite preceding "
1492   "%select{'typename'|'template'}2 keyword">, SFINAEFailure,
1493   InGroup<DiagGroup<"injected-class-name">>;
1494
1495 // C++ class members
1496 def err_storageclass_invalid_for_member : Error<
1497   "storage class specified for a member declaration">;
1498 def err_mutable_function : Error<"'mutable' cannot be applied to functions">;
1499 def err_mutable_reference : Error<"'mutable' cannot be applied to references">;
1500 def ext_mutable_reference : ExtWarn<
1501   "'mutable' on a reference type is a Microsoft extension">,
1502   InGroup<MicrosoftMutableReference>;
1503 def err_mutable_const : Error<"'mutable' and 'const' cannot be mixed">;
1504 def err_mutable_nonmember : Error<
1505   "'mutable' can only be applied to member variables">;
1506 def err_virtual_in_union : Error<
1507   "unions cannot have virtual functions">;
1508 def err_virtual_non_function : Error<
1509   "'virtual' can only appear on non-static member functions">;
1510 def err_virtual_out_of_class : Error<
1511   "'virtual' can only be specified inside the class definition">;
1512 def err_virtual_member_function_template : Error<
1513   "'virtual' cannot be specified on member function templates">;
1514 def err_static_overrides_virtual : Error<
1515   "'static' member function %0 overrides a virtual function in a base class">;
1516 def err_explicit_non_function : Error<
1517   "'explicit' can only appear on non-static member functions">;
1518 def err_explicit_out_of_class : Error<
1519   "'explicit' can only be specified inside the class definition">;
1520 def err_explicit_non_ctor_or_conv_function : Error<
1521   "'explicit' can only be applied to a constructor or conversion function">;
1522 def err_static_not_bitfield : Error<"static member %0 cannot be a bit-field">;
1523 def err_static_out_of_line : Error<
1524   "'static' can only be specified inside the class definition">;
1525 def err_storage_class_for_static_member : Error<
1526   "static data member definition cannot specify a storage class">;
1527 def err_typedef_not_bitfield : Error<"typedef member %0 cannot be a bit-field">;
1528 def err_not_integral_type_bitfield : Error<
1529   "bit-field %0 has non-integral type %1">;
1530 def err_not_integral_type_anon_bitfield : Error<
1531   "anonymous bit-field has non-integral type %0">;
1532 def err_member_function_initialization : Error<
1533   "initializer on function does not look like a pure-specifier">;
1534 def err_non_virtual_pure : Error<
1535   "%0 is not virtual and cannot be declared pure">;
1536 def ext_pure_function_definition : ExtWarn<
1537   "function definition with pure-specifier is a Microsoft extension">,
1538   InGroup<MicrosoftPureDefinition>;
1539 def err_implicit_object_parameter_init : Error<
1540   "cannot initialize object parameter of type %0 with an expression "
1541   "of type %1">;
1542 def err_qualified_member_of_unrelated : Error<
1543   "%q0 is not a member of class %1">;
1544
1545 def warn_call_to_pure_virtual_member_function_from_ctor_dtor : Warning<
1546   "call to pure virtual member function %0 has undefined behavior; "
1547   "overrides of %0 in subclasses are not available in the "
1548   "%select{constructor|destructor}1 of %2">;
1549
1550 def note_member_declared_at : Note<"member is declared here">;
1551 def note_ivar_decl : Note<"instance variable is declared here">;
1552 def note_bitfield_decl : Note<"bit-field is declared here">;
1553 def note_implicit_param_decl : Note<"%0 is an implicit parameter">;
1554 def note_member_synthesized_at : Note<
1555   "implicit %select{default constructor|copy constructor|move constructor|copy "
1556   "assignment operator|move assignment operator|destructor}0 for %1 first "
1557   "required here">;
1558 def note_inhctor_synthesized_at : Note<
1559   "inherited constructor for %0 first required here">;
1560 def err_missing_default_ctor : Error<
1561   "%select{constructor for %1 must explicitly initialize the|"
1562   "implicit default constructor for %1 must explicitly initialize the|"
1563   "cannot use constructor inherited from base class %4;}0 "
1564   "%select{base class|member}2 %3 %select{which|which|of %1}0 "
1565   "does not have a default constructor">;
1566 def note_due_to_dllexported_class : Note<
1567   "due to '%0' being dllexported%select{|; try compiling in C++11 mode}1">;
1568
1569 def err_illegal_union_or_anon_struct_member : Error<
1570   "%select{anonymous struct|union}0 member %1 has a non-trivial "
1571   "%select{constructor|copy constructor|move constructor|copy assignment "
1572   "operator|move assignment operator|destructor}2">;
1573 def warn_cxx98_compat_nontrivial_union_or_anon_struct_member : Warning<
1574   "%select{anonymous struct|union}0 member %1 with a non-trivial "
1575   "%select{constructor|copy constructor|move constructor|copy assignment "
1576   "operator|move assignment operator|destructor}2 is incompatible with C++98">,
1577   InGroup<CXX98Compat>, DefaultIgnore;
1578
1579 def note_nontrivial_virtual_dtor : Note<
1580   "destructor for %0 is not trivial because it is virtual">;
1581 def note_nontrivial_has_virtual : Note<
1582   "because type %0 has a virtual %select{member function|base class}1">;
1583 def note_nontrivial_no_def_ctor : Note<
1584   "because %select{base class of |field of |}0type %1 has no "
1585   "default constructor">;
1586 def note_user_declared_ctor : Note<
1587   "implicit default constructor suppressed by user-declared constructor">;
1588 def note_nontrivial_no_copy : Note<
1589   "because no %select{<<ERROR>>|constructor|constructor|assignment operator|"
1590   "assignment operator|<<ERROR>>}2 can be used to "
1591   "%select{<<ERROR>>|copy|move|copy|move|<<ERROR>>}2 "
1592   "%select{base class|field|an object}0 of type %3">;
1593 def note_nontrivial_user_provided : Note<
1594   "because %select{base class of |field of |}0type %1 has a user-provided "
1595   "%select{default constructor|copy constructor|move constructor|"
1596   "copy assignment operator|move assignment operator|destructor}2">;
1597 def note_nontrivial_in_class_init : Note<
1598   "because field %0 has an initializer">;
1599 def note_nontrivial_param_type : Note<
1600   "because its parameter is %diff{of type $, not $|of the wrong type}2,3">;
1601 def note_nontrivial_default_arg : Note<"because it has a default argument">;
1602 def note_nontrivial_variadic : Note<"because it is a variadic function">;
1603 def note_nontrivial_subobject : Note<
1604   "because the function selected to %select{construct|copy|move|copy|move|"
1605   "destroy}2 %select{base class|field}0 of type %1 is not trivial">;
1606 def note_nontrivial_objc_ownership : Note<
1607   "because type %0 has a member with %select{no|no|__strong|__weak|"
1608   "__autoreleasing}1 ownership">;
1609
1610 def err_static_data_member_not_allowed_in_anon_struct : Error<
1611   "static data member %0 not allowed in anonymous struct">;
1612 def ext_static_data_member_in_union : ExtWarn<
1613   "static data member %0 in union is a C++11 extension">, InGroup<CXX11>;
1614 def warn_cxx98_compat_static_data_member_in_union : Warning<
1615   "static data member %0 in union is incompatible with C++98">,
1616   InGroup<CXX98Compat>, DefaultIgnore;
1617 def ext_union_member_of_reference_type : ExtWarn<
1618   "union member %0 has reference type %1, which is a Microsoft extension">,
1619   InGroup<MicrosoftUnionMemberReference>;
1620 def err_union_member_of_reference_type : Error<
1621   "union member %0 has reference type %1">;
1622 def ext_anonymous_struct_union_qualified : Extension<
1623   "anonymous %select{struct|union}0 cannot be '%1'">;
1624 def err_different_return_type_for_overriding_virtual_function : Error<
1625   "virtual function %0 has a different return type "
1626   "%diff{($) than the function it overrides (which has return type $)|"
1627   "than the function it overrides}1,2">;
1628 def note_overridden_virtual_function : Note<
1629   "overridden virtual function is here">;
1630 def err_conflicting_overriding_cc_attributes : Error<
1631   "virtual function %0 has different calling convention attributes "
1632   "%diff{($) than the function it overrides (which has calling convention $)|"
1633   "than the function it overrides}1,2">;
1634
1635 def err_covariant_return_inaccessible_base : Error<
1636   "invalid covariant return for virtual function: %1 is a "
1637   "%select{private|protected}2 base class of %0">, AccessControl;
1638 def err_covariant_return_ambiguous_derived_to_base_conv : Error<
1639   "return type of virtual function %3 is not covariant with the return type of "
1640   "the function it overrides (ambiguous conversion from derived class "
1641   "%0 to base class %1:%2)">;
1642 def err_covariant_return_not_derived : Error<
1643   "return type of virtual function %0 is not covariant with the return type of "
1644   "the function it overrides (%1 is not derived from %2)">;
1645 def err_covariant_return_incomplete : Error<
1646   "return type of virtual function %0 is not covariant with the return type of "
1647   "the function it overrides (%1 is incomplete)">;
1648 def err_covariant_return_type_different_qualifications : Error<
1649   "return type of virtual function %0 is not covariant with the return type of "
1650   "the function it overrides (%1 has different qualifiers than %2)">;
1651 def err_covariant_return_type_class_type_more_qualified : Error<
1652   "return type of virtual function %0 is not covariant with the return type of "
1653   "the function it overrides (class type %1 is more qualified than class "
1654   "type %2">;
1655
1656 // C++ implicit special member functions
1657 def note_in_declaration_of_implicit_special_member : Note<
1658   "while declaring the implicit "
1659   "%select{default constructor|copy constructor|move constructor|"
1660   "copy assignment operator|move assignment operator|destructor}1"
1661   " for %0">;
1662
1663 // C++ constructors
1664 def err_constructor_cannot_be : Error<"constructor cannot be declared '%0'">;
1665 def err_invalid_qualified_constructor : Error<
1666   "'%0' qualifier is not allowed on a constructor">;
1667 def err_ref_qualifier_constructor : Error<
1668   "ref-qualifier '%select{&&|&}0' is not allowed on a constructor">;
1669
1670 def err_constructor_return_type : Error<
1671   "constructor cannot have a return type">;
1672 def err_constructor_redeclared : Error<"constructor cannot be redeclared">;
1673 def err_constructor_byvalue_arg : Error<
1674   "copy constructor must pass its first argument by reference">;
1675 def warn_no_constructor_for_refconst : Warning<
1676   "%select{struct|interface|union|class|enum}0 %1 does not declare any "
1677   "constructor to initialize its non-modifiable members">;
1678 def note_refconst_member_not_initialized : Note<
1679   "%select{const|reference}0 member %1 will never be initialized">;
1680 def ext_ms_explicit_constructor_call : ExtWarn<
1681   "explicit constructor calls are a Microsoft extension">,
1682   InGroup<MicrosoftExplicitConstructorCall>;
1683
1684 // C++ destructors
1685 def err_destructor_not_member : Error<
1686   "destructor must be a non-static member function">;
1687 def err_destructor_cannot_be : Error<"destructor cannot be declared '%0'">;
1688 def err_invalid_qualified_destructor : Error<
1689   "'%0' qualifier is not allowed on a destructor">;
1690 def err_ref_qualifier_destructor : Error<
1691   "ref-qualifier '%select{&&|&}0' is not allowed on a destructor">;
1692 def err_destructor_return_type : Error<"destructor cannot have a return type">;
1693 def err_destructor_redeclared : Error<"destructor cannot be redeclared">;
1694 def err_destructor_with_params : Error<"destructor cannot have any parameters">;
1695 def err_destructor_variadic : Error<"destructor cannot be variadic">;
1696 def err_destructor_typedef_name : Error<
1697   "destructor cannot be declared using a %select{typedef|type alias}1 %0 of the class name">;
1698 def err_destructor_name : Error<
1699   "expected the class name after '~' to name the enclosing class">;
1700 def err_destructor_class_name : Error<
1701   "expected the class name after '~' to name a destructor">;
1702 def err_ident_in_dtor_not_a_type : Error<
1703   "identifier %0 in object destruction expression does not name a type">;
1704 def err_destructor_expr_type_mismatch : Error<
1705   "destructor type %0 in object destruction expression does not match the "
1706   "type %1 of the object being destroyed">;
1707 def note_destructor_type_here : Note<
1708   "type %0 is declared here">;
1709
1710 def err_destructor_template : Error<
1711   "destructor cannot be declared as a template">;
1712
1713 // C++ initialization
1714 def err_init_conversion_failed : Error<
1715   "cannot initialize %select{a variable|a parameter|return object|an "
1716   "exception object|a member subobject|an array element|a new value|a value|a "
1717   "base class|a constructor delegation|a vector element|a block element|a "
1718   "block element|a complex element|a lambda capture|a compound literal "
1719   "initializer|a related result|a parameter of CF audited function}0 "
1720   "%diff{of type $ with an %select{rvalue|lvalue}2 of type $|"
1721   "with an %select{rvalue|lvalue}2 of incompatible type}1,3"
1722   "%select{|: different classes%diff{ ($ vs $)|}5,6"
1723   "|: different number of parameters (%5 vs %6)"
1724   "|: type mismatch at %ordinal5 parameter%diff{ ($ vs $)|}6,7"
1725   "|: different return type%diff{ ($ vs $)|}5,6"
1726   "|: different qualifiers ("
1727   "%select{none|const|restrict|const and restrict|volatile|const and volatile|"
1728   "volatile and restrict|const, volatile, and restrict}5 vs "
1729   "%select{none|const|restrict|const and restrict|volatile|const and volatile|"
1730   "volatile and restrict|const, volatile, and restrict}6)"
1731   "|: different exception specifications}4">;
1732
1733 def err_lvalue_to_rvalue_ref : Error<"rvalue reference %diff{to type $ cannot "
1734   "bind to lvalue of type $|cannot bind to incompatible lvalue}0,1">;
1735 def err_lvalue_reference_bind_to_initlist : Error<
1736   "%select{non-const|volatile}0 lvalue reference to type %1 cannot bind to an "
1737   "initializer list temporary">;
1738 def err_lvalue_reference_bind_to_temporary : Error<
1739   "%select{non-const|volatile}0 lvalue reference %diff{to type $ cannot bind "
1740   "to a temporary of type $|cannot bind to incompatible temporary}1,2">;
1741 def err_lvalue_reference_bind_to_unrelated : Error<
1742   "%select{non-const|volatile}0 lvalue reference "
1743   "%diff{to type $ cannot bind to a value of unrelated type $|"
1744   "cannot bind to a value of unrelated type}1,2">;
1745 def err_reference_bind_drops_quals : Error<
1746   "binding value %diff{of type $ to reference to type $|to reference}0,1 "
1747   "drops %select{<<ERROR>>|'const'|'restrict'|'const' and 'restrict'|"
1748   "'volatile'|'const' and 'volatile'|'restrict' and 'volatile'|"
1749   "'const', 'restrict', and 'volatile'}2 qualifier%plural{1:|2:|4:|:s}2">;
1750 def err_reference_bind_failed : Error<
1751   "reference %diff{to type $ could not bind to an %select{rvalue|lvalue}1 of "
1752   "type $|could not bind to %select{rvalue|lvalue}1 of incompatible type}0,2">;
1753 def err_reference_bind_init_list : Error<
1754   "reference to type %0 cannot bind to an initializer list">;
1755 def warn_temporary_array_to_pointer_decay : Warning<
1756   "pointer is initialized by a temporary array, which will be destroyed at the "
1757   "end of the full-expression">,
1758   InGroup<DiagGroup<"address-of-array-temporary">>;
1759 def err_init_list_bad_dest_type : Error<
1760   "%select{|non-aggregate }0type %1 cannot be initialized with an initializer "
1761   "list">;
1762 def err_member_function_call_bad_cvr : Error<"member function %0 not viable: "
1763     "'this' argument has type %1, but function is not marked "
1764     "%select{const|restrict|const or restrict|volatile|const or volatile|"
1765     "volatile or restrict|const, volatile, or restrict}2">;
1766
1767 def err_reference_bind_to_bitfield : Error<
1768   "%select{non-const|volatile}0 reference cannot bind to "
1769   "bit-field%select{| %1}2">;
1770 def err_reference_bind_to_vector_element : Error<
1771   "%select{non-const|volatile}0 reference cannot bind to vector element">;
1772 def err_reference_var_requires_init : Error<
1773   "declaration of reference variable %0 requires an initializer">;
1774 def err_reference_without_init : Error<
1775   "reference to type %0 requires an initializer">;
1776 def note_value_initialization_here : Note<
1777   "in value-initialization of type %0 here">;
1778 def err_reference_has_multiple_inits : Error<
1779   "reference cannot be initialized with multiple values">;
1780 def err_init_non_aggr_init_list : Error<
1781   "initialization of non-aggregate type %0 with an initializer list">;
1782 def err_init_reference_member_uninitialized : Error<
1783   "reference member of type %0 uninitialized">;
1784 def note_uninit_reference_member : Note<
1785   "uninitialized reference member is here">;
1786 def warn_field_is_uninit : Warning<"field %0 is uninitialized when used here">,
1787   InGroup<Uninitialized>;
1788 def warn_base_class_is_uninit : Warning<
1789   "base class %0 is uninitialized when used here to access %q1">,
1790   InGroup<Uninitialized>;
1791 def warn_reference_field_is_uninit : Warning<
1792   "reference %0 is not yet bound to a value when used here">,
1793   InGroup<Uninitialized>;
1794 def note_uninit_in_this_constructor : Note<
1795   "during field initialization in %select{this|the implicit default}0 "
1796   "constructor">;
1797 def warn_static_self_reference_in_init : Warning<
1798   "static variable %0 is suspiciously used within its own initialization">,
1799   InGroup<UninitializedStaticSelfInit>;
1800 def warn_uninit_self_reference_in_init : Warning<
1801   "variable %0 is uninitialized when used within its own initialization">,
1802   InGroup<Uninitialized>;
1803 def warn_uninit_self_reference_in_reference_init : Warning<
1804   "reference %0 is not yet bound to a value when used within its own"
1805   " initialization">,
1806   InGroup<Uninitialized>;
1807 def warn_uninit_var : Warning<
1808   "variable %0 is uninitialized when %select{used here|captured by block}1">,
1809   InGroup<Uninitialized>, DefaultIgnore;
1810 def warn_sometimes_uninit_var : Warning<
1811   "variable %0 is %select{used|captured}1 uninitialized whenever "
1812   "%select{'%3' condition is %select{true|false}4|"
1813   "'%3' loop %select{is entered|exits because its condition is false}4|"
1814   "'%3' loop %select{condition is true|exits because its condition is false}4|"
1815   "switch %3 is taken|"
1816   "its declaration is reached|"
1817   "%3 is called}2">,
1818   InGroup<UninitializedSometimes>, DefaultIgnore;
1819 def warn_maybe_uninit_var : Warning<
1820   "variable %0 may be uninitialized when "
1821   "%select{used here|captured by block}1">,
1822   InGroup<UninitializedMaybe>, DefaultIgnore;
1823 def note_var_declared_here : Note<"variable %0 is declared here">;
1824 def note_uninit_var_use : Note<
1825   "%select{uninitialized use occurs|variable is captured by block}0 here">;
1826 def warn_uninit_byref_blockvar_captured_by_block : Warning<
1827   "block pointer variable %0 is uninitialized when captured by block">,
1828   InGroup<Uninitialized>, DefaultIgnore;
1829 def note_block_var_fixit_add_initialization : Note<
1830   "did you mean to use __block %0?">;
1831 def note_in_omitted_aggregate_initializer : Note<
1832   "in implicit initialization of %select{"
1833   "array element %1 with omitted initializer|"
1834   "field %1 with omitted initializer|"
1835   "trailing array elements in runtime-sized array new}0">;
1836 def note_in_reference_temporary_list_initializer : Note<
1837   "in initialization of temporary of type %0 created to "
1838   "list-initialize this reference">;
1839 def note_var_fixit_add_initialization : Note<
1840   "initialize the variable %0 to silence this warning">;
1841 def note_uninit_fixit_remove_cond : Note<
1842   "remove the %select{'%1' if its condition|condition if it}0 "
1843   "is always %select{false|true}2">;
1844 def err_init_incomplete_type : Error<"initialization of incomplete type %0">;
1845 def err_list_init_in_parens : Error<
1846   "cannot initialize %select{non-class|reference}0 type %1 with a "
1847   "parenthesized initializer list">;
1848
1849 def warn_unsequenced_mod_mod : Warning<
1850   "multiple unsequenced modifications to %0">, InGroup<Unsequenced>;
1851 def warn_unsequenced_mod_use : Warning<
1852   "unsequenced modification and access to %0">, InGroup<Unsequenced>;
1853
1854 def err_temp_copy_no_viable : Error<
1855   "no viable constructor %select{copying variable|copying parameter|"
1856   "returning object|throwing object|copying member subobject|copying array "
1857   "element|allocating object|copying temporary|initializing base subobject|"
1858   "initializing vector element|capturing value}0 of type %1">;
1859 def ext_rvalue_to_reference_temp_copy_no_viable : Extension<
1860   "no viable constructor %select{copying variable|copying parameter|"
1861   "returning object|throwing object|copying member subobject|copying array "
1862   "element|allocating object|copying temporary|initializing base subobject|"
1863   "initializing vector element|capturing value}0 of type %1; C++98 requires a copy "
1864   "constructor when binding a reference to a temporary">,
1865   InGroup<BindToTemporaryCopy>;
1866 def err_temp_copy_ambiguous : Error<
1867   "ambiguous constructor call when %select{copying variable|copying "
1868   "parameter|returning object|throwing object|copying member subobject|copying "
1869   "array element|allocating object|copying temporary|initializing base subobject|"
1870   "initializing vector element|capturing value}0 of type %1">;
1871 def err_temp_copy_deleted : Error<
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|"
1875   "capturing value}0 of type %1 invokes deleted constructor">;
1876 def err_temp_copy_incomplete : Error<
1877   "copying a temporary object of incomplete type %0">;
1878 def warn_cxx98_compat_temp_copy : Warning<
1879   "%select{copying variable|copying parameter|returning object|throwing "
1880   "object|copying member subobject|copying array element|allocating object|"
1881   "copying temporary|initializing base subobject|initializing vector element}1 "
1882   "of type %2 when binding a reference to a temporary would %select{invoke "
1883   "an inaccessible constructor|find no viable constructor|find ambiguous "
1884   "constructors|invoke a deleted constructor}0 in C++98">,
1885   InGroup<CXX98CompatBindToTemporaryCopy>, DefaultIgnore;
1886 def err_selected_explicit_constructor : Error<
1887   "chosen constructor is explicit in copy-initialization">;
1888 def note_explicit_ctor_deduction_guide_here : Note<
1889   "explicit %select{constructor|deduction guide}0 declared here">;
1890
1891 // C++11 decltype
1892 def err_decltype_in_declarator : Error<
1893     "'decltype' cannot be used to name a declaration">;
1894     
1895 // C++11 auto
1896 def warn_cxx98_compat_auto_type_specifier : Warning<
1897   "'auto' type specifier is incompatible with C++98">,
1898   InGroup<CXX98Compat>, DefaultIgnore;
1899 def err_auto_variable_cannot_appear_in_own_initializer : Error<
1900   "variable %0 declared with deduced type %1 "
1901   "cannot appear in its own initializer">;
1902 def err_binding_cannot_appear_in_own_initializer : Error<
1903   "binding %0 cannot appear in the initializer of its own "
1904   "decomposition declaration">;
1905 def err_illegal_decl_array_of_auto : Error<
1906   "'%0' declared as array of %1">;
1907 def err_new_array_of_auto : Error<
1908   "cannot allocate array of 'auto'">;
1909 def err_auto_not_allowed : Error<
1910   "%select{'auto'|'decltype(auto)'|'__auto_type'|"
1911   "use of "
1912   "%select{class template|function template|variable template|alias template|"
1913   "template template parameter|template}2 %3 requires template arguments; "
1914   "argument deduction}0 not allowed "
1915   "%select{in function prototype"
1916   "|in non-static struct member|in struct member"
1917   "|in non-static union member|in union member"
1918   "|in non-static class member|in interface member"
1919   "|in exception declaration|in template parameter until C++1z|in block literal"
1920   "|in template argument|in typedef|in type alias|in function return type"
1921   "|in conversion function type|here|in lambda parameter"
1922   "|in type allocated by 'new'|in K&R-style function parameter"
1923   "|in template parameter|in friend declaration}1">;
1924 def err_dependent_deduced_tst : Error<
1925   "typename specifier refers to "
1926   "%select{class template|function template|variable template|alias template|"
1927   "template template parameter|template}0 member in %1; "
1928   "argument deduction not allowed here">;
1929 def err_auto_not_allowed_var_inst : Error<
1930   "'auto' variable template instantiation is not allowed">;
1931 def err_auto_var_requires_init : Error<
1932   "declaration of variable %0 with deduced type %1 requires an initializer">;
1933 def err_auto_new_requires_ctor_arg : Error<
1934   "new expression for type %0 requires a constructor argument">;
1935 def err_auto_new_list_init : Error<
1936   "new expression for type %0 cannot use list-initialization">;
1937 def err_auto_var_init_no_expression : Error<
1938   "initializer for variable %0 with type %1 is empty">;
1939 def err_auto_var_init_multiple_expressions : Error<
1940   "initializer for variable %0 with type %1 contains multiple expressions">;
1941 def err_auto_var_init_paren_braces : Error<
1942   "cannot deduce type for variable %1 with type %2 from "
1943   "%select{parenthesized|nested}0 initializer list">;
1944 def err_auto_new_ctor_multiple_expressions : Error<
1945   "new expression for type %0 contains multiple constructor arguments">;
1946 def err_auto_missing_trailing_return : Error<
1947   "'auto' return without trailing return type; deduced return types are a "
1948   "C++14 extension">;
1949 def err_deduced_return_type : Error<
1950   "deduced return types are a C++14 extension">;
1951 def err_trailing_return_without_auto : Error<
1952   "function with trailing return type must specify return type 'auto', not %0">;
1953 def err_trailing_return_in_parens : Error<
1954   "trailing return type may not be nested within parentheses">;
1955 def err_auto_var_deduction_failure : Error<
1956   "variable %0 with type %1 has incompatible initializer of type %2">;
1957 def err_auto_var_deduction_failure_from_init_list : Error<
1958   "cannot deduce actual type for variable %0 with type %1 from initializer list">;
1959 def err_auto_new_deduction_failure : Error<
1960   "new expression for type %0 has incompatible constructor argument of type %1">;
1961 def err_auto_different_deductions : Error<
1962   "%select{'auto'|'decltype(auto)'|'__auto_type'|template arguments}0 "
1963   "deduced as %1 in declaration of %2 and "
1964   "deduced as %3 in declaration of %4">;
1965 def err_auto_non_deduced_not_alone : Error<
1966   "%select{function with deduced return type|"
1967   "declaration with trailing return type}0 "
1968   "must be the only declaration in its group">;
1969 def err_implied_std_initializer_list_not_found : Error<
1970   "cannot deduce type of initializer list because std::initializer_list was "
1971   "not found; include <initializer_list>">;
1972 def err_malformed_std_initializer_list : Error<
1973   "std::initializer_list must be a class template with a single type parameter">;
1974 def warn_dangling_std_initializer_list : Warning<
1975   "array backing the initializer list will be destroyed at the end of "
1976   "%select{the full-expression|the constructor}0">,
1977   InGroup<DiagGroup<"dangling-initializer-list">>;
1978 def err_auto_init_list_from_c : Error<
1979   "cannot use __auto_type with initializer list in C">;
1980 def err_auto_bitfield : Error<
1981   "cannot pass bit-field as __auto_type initializer in C">;
1982
1983 // C++1y decltype(auto) type
1984 def err_decltype_auto_invalid : Error<
1985   "'decltype(auto)' not allowed here">;
1986 def err_decltype_auto_cannot_be_combined : Error<
1987   "'decltype(auto)' cannot be combined with other type specifiers">;
1988 def err_decltype_auto_function_declarator_not_declaration : Error<
1989   "'decltype(auto)' can only be used as a return type "
1990   "in a function declaration">;
1991 def err_decltype_auto_compound_type : Error<
1992   "cannot form %select{pointer to|reference to|array of}0 'decltype(auto)'">;
1993 def err_decltype_auto_initializer_list : Error<
1994   "cannot deduce 'decltype(auto)' from initializer list">;
1995
1996 // C++1z deduced class template specialization types
1997 def err_deduced_class_template_compound_type : Error<
1998   "cannot %select{form pointer to|form reference to|form array of|"
1999   "form function returning|use parentheses when declaring variable with}0 "
2000   "deduced class template specialization type">;
2001 def err_deduced_non_class_template_specialization_type : Error<
2002   "%select{<error>|function template|variable template|alias template|"
2003   "template template parameter|template}0 %1 requires template arguments; "
2004   "argument deduction only allowed for class templates">;
2005 def err_deduced_class_template_ctor_ambiguous : Error<
2006   "ambiguous deduction for template arguments of %0">;
2007 def err_deduced_class_template_ctor_no_viable : Error<
2008   "no viable constructor or deduction guide for deduction of "
2009   "template arguments of %0">;
2010 def err_deduced_class_template_incomplete : Error<
2011   "template %0 has no definition and no %select{|viable }1deduction guides "
2012   "for deduction of template arguments">;
2013 def err_deduced_class_template_deleted : Error<
2014   "class template argument deduction for %0 selected a deleted constructor">;
2015 def err_deduced_class_template_explicit : Error<
2016   "class template argument deduction for %0 selected an explicit "
2017   "%select{constructor|deduction guide}1 for copy-list-initialization">;
2018 def err_deduction_guide_no_trailing_return_type : Error<
2019   "deduction guide declaration without trailing return type">;
2020 def err_deduction_guide_bad_trailing_return_type : Error<
2021   "deduced type %1 of deduction guide is not %select{|written as }2"
2022   "a specialization of template %0">;
2023 def err_deduction_guide_with_complex_decl : Error<
2024   "cannot specify any part of a return type in the "
2025   "declaration of a deduction guide">;
2026 def err_deduction_guide_invalid_specifier : Error<
2027   "deduction guide cannot be declared '%0'">;
2028 def err_deduction_guide_name_not_class_template : Error<
2029   "cannot specify deduction guide for "
2030   "%select{<error>|function template|variable template|alias template|"
2031   "template template parameter|dependent template name}0 %1">;
2032 def err_deduction_guide_wrong_scope : Error<
2033   "deduction guide must be declared in the same scope as template %q0">;
2034 def err_deduction_guide_defines_function : Error<
2035   "deduction guide cannot have a function definition">;
2036 def err_deduction_guide_explicit_mismatch : Error<
2037   "deduction guide is %select{not |}0declared 'explicit' but "
2038   "previous declaration was%select{ not|}0">;
2039 def err_deduction_guide_specialized : Error<"deduction guide cannot be "
2040   "%select{explicitly instantiated|explicitly specialized}0">;
2041 def err_deduction_guide_template_not_deducible : Error<
2042     "deduction guide template contains "
2043     "%select{a template parameter|template parameters}0 that cannot be "
2044     "deduced">;
2045
2046 // C++1y deduced return types
2047 def err_auto_fn_deduction_failure : Error<
2048   "cannot deduce return type %0 from returned value of type %1">;
2049 def err_auto_fn_different_deductions : Error<
2050   "'%select{auto|decltype(auto)}0' in return type deduced as %1 here but "
2051   "deduced as %2 in earlier return statement">;
2052 def err_auto_fn_used_before_defined : Error<
2053   "function %0 with deduced return type cannot be used before it is defined">;
2054 def err_auto_fn_no_return_but_not_auto : Error<
2055   "cannot deduce return type %0 for function with no return statements">;
2056 def err_auto_fn_return_void_but_not_auto : Error<
2057   "cannot deduce return type %0 from omitted return expression">;
2058 def err_auto_fn_return_init_list : Error<
2059   "cannot deduce return type from initializer list">;
2060 def err_auto_fn_virtual : Error<
2061   "function with deduced return type cannot be virtual">;
2062
2063 // C++11 override control
2064 def override_keyword_only_allowed_on_virtual_member_functions : Error<
2065   "only virtual member functions can be marked '%0'">;
2066 def override_keyword_hides_virtual_member_function : Error<
2067   "non-virtual member function marked '%0' hides virtual member "
2068   "%select{function|functions}1">;
2069 def err_function_marked_override_not_overriding : Error<
2070   "%0 marked 'override' but does not override any member functions">;
2071 def warn_destructor_marked_not_override_overriding : Warning <
2072   "%0 overrides a destructor but is not marked 'override'">,
2073   InGroup<CXX11WarnOverrideDestructor>, DefaultIgnore;
2074 def warn_function_marked_not_override_overriding : Warning <
2075   "%0 overrides a member function but is not marked 'override'">,
2076   InGroup<CXX11WarnOverrideMethod>;
2077 def err_class_marked_final_used_as_base : Error<
2078   "base %0 is marked '%select{final|sealed}1'">;
2079 def warn_abstract_final_class : Warning<
2080   "abstract class is marked '%select{final|sealed}0'">, InGroup<AbstractFinalClass>;
2081
2082 // C++11 attributes
2083 def err_repeat_attribute : Error<"%0 attribute cannot be repeated">;
2084
2085 // C++11 final
2086 def err_final_function_overridden : Error<
2087   "declaration of %0 overrides a '%select{final|sealed}1' function">;
2088
2089 // C++11 scoped enumerations
2090 def err_enum_invalid_underlying : Error<
2091   "non-integral type %0 is an invalid underlying type">;
2092 def err_enumerator_too_large : Error<
2093   "enumerator value is not representable in the underlying type %0">;
2094 def ext_enumerator_too_large : Extension<
2095   "enumerator value is not representable in the underlying type %0">,
2096   InGroup<MicrosoftEnumValue>;
2097 def err_enumerator_wrapped : Error<
2098   "enumerator value %0 is not representable in the underlying type %1">;
2099 def err_enum_redeclare_type_mismatch : Error<
2100   "enumeration redeclared with different underlying type %0 (was %1)">;
2101 def err_enum_redeclare_fixed_mismatch : Error<
2102   "enumeration previously declared with %select{non|}0fixed underlying type">;
2103 def err_enum_redeclare_scoped_mismatch : Error<
2104   "enumeration previously declared as %select{un|}0scoped">;
2105 def err_enum_class_reference : Error<
2106   "reference to %select{|scoped }0enumeration must use 'enum' "
2107   "not 'enum class'">;
2108 def err_only_enums_have_underlying_types : Error<
2109   "only enumeration types have underlying types">;
2110 def err_underlying_type_of_incomplete_enum : Error<
2111   "cannot determine underlying type of incomplete enumeration type %0">;
2112
2113 // C++11 delegating constructors
2114 def err_delegating_ctor : Error<
2115   "delegating constructors are permitted only in C++11">;
2116 def warn_cxx98_compat_delegating_ctor : Warning<
2117   "delegating constructors are incompatible with C++98">,
2118   InGroup<CXX98Compat>, DefaultIgnore;
2119 def err_delegating_initializer_alone : Error<
2120   "an initializer for a delegating constructor must appear alone">;
2121 def warn_delegating_ctor_cycle : Warning<
2122   "constructor for %0 creates a delegation cycle">, DefaultError,
2123   InGroup<DelegatingCtorCycles>;
2124 def note_it_delegates_to : Note<"it delegates to">;
2125 def note_which_delegates_to : Note<"which delegates to">;
2126
2127 // C++11 range-based for loop
2128 def err_for_range_decl_must_be_var : Error<
2129   "for range declaration must declare a variable">;
2130 def err_for_range_storage_class : Error<
2131   "loop variable %0 may not be declared %select{'extern'|'static'|"
2132   "'__private_extern__'|'auto'|'register'|'constexpr'}1">;
2133 def err_type_defined_in_for_range : Error<
2134   "types may not be defined in a for range declaration">;
2135 def err_for_range_deduction_failure : Error<
2136   "cannot use type %0 as a range">;
2137 def err_for_range_incomplete_type : Error<
2138   "cannot use incomplete type %0 as a range">;
2139 def err_for_range_iter_deduction_failure : Error<
2140   "cannot use type %0 as an iterator">;
2141 def err_for_range_member_begin_end_mismatch : Error<
2142   "range type %0 has '%select{begin|end}1' member but no '%select{end|begin}1' member">;
2143 def ext_for_range_begin_end_types_differ : ExtWarn<
2144   "'begin' and 'end' returning different types (%0 and %1) is a C++1z extension">,
2145   InGroup<CXX1z>;
2146 def warn_for_range_begin_end_types_differ : Warning<
2147   "'begin' and 'end' returning different types (%0 and %1) is incompatible "
2148   "with C++ standards before C++1z">, InGroup<CXXPre1zCompat>, DefaultIgnore;
2149 def note_in_for_range: Note<
2150   "when looking up '%select{begin|end}0' function for range expression "
2151   "of type %1">;
2152 def err_for_range_invalid: Error<
2153   "invalid range expression of type %0; no viable '%select{begin|end}1' "
2154   "function available">;
2155 def err_range_on_array_parameter : Error<
2156   "cannot build range expression with array function parameter %0 since "
2157   "parameter with array type %1 is treated as pointer type %2">;
2158 def err_for_range_dereference : Error<
2159   "invalid range expression of type %0; did you mean to dereference it "
2160   "with '*'?">;
2161 def note_for_range_invalid_iterator : Note <
2162   "in implicit call to 'operator%select{!=|*|++}0' for iterator of type %1">;
2163 def note_for_range_begin_end : Note<
2164   "selected '%select{begin|end}0' %select{function|template }1%2 with iterator type %3">;
2165 def warn_for_range_const_reference_copy : Warning<
2166   "loop variable %0 "
2167   "%diff{has type $ but is initialized with type $"
2168   "| is initialized with a value of a different type}1,2 resulting in a copy">,
2169   InGroup<RangeLoopAnalysis>, DefaultIgnore;
2170 def note_use_type_or_non_reference : Note<
2171   "use non-reference type %0 to keep the copy or type %1 to prevent copying">;
2172 def warn_for_range_variable_always_copy : Warning<
2173   "loop variable %0 is always a copy because the range of type %1 does not "
2174   "return a reference">,
2175   InGroup<RangeLoopAnalysis>, DefaultIgnore;
2176 def note_use_non_reference_type : Note<"use non-reference type %0">;
2177 def warn_for_range_copy : Warning<
2178   "loop variable %0 of type %1 creates a copy from type %2">,
2179   InGroup<RangeLoopAnalysis>, DefaultIgnore;
2180 def note_use_reference_type : Note<"use reference type %0 to prevent copying">;
2181
2182 // C++11 constexpr
2183 def warn_cxx98_compat_constexpr : Warning<
2184   "'constexpr' specifier is incompatible with C++98">,
2185   InGroup<CXX98Compat>, DefaultIgnore;
2186 // FIXME: Maybe this should also go in -Wc++14-compat?
2187 def warn_cxx14_compat_constexpr_not_const : Warning<
2188   "'constexpr' non-static member function will not be implicitly 'const' "
2189   "in C++14; add 'const' to avoid a change in behavior">,
2190   InGroup<DiagGroup<"constexpr-not-const">>;
2191 def err_invalid_constexpr : Error<
2192   "%select{function parameter|typedef|non-static data member}0 "
2193   "cannot be constexpr">;
2194 def err_invalid_constexpr_member : Error<"non-static data member cannot be "
2195   "constexpr%select{; did you intend to make it %select{const|static}0?|}1">;
2196 def err_constexpr_tag : Error<
2197   "%select{class|struct|interface|union|enum}0 cannot be marked constexpr">;
2198 def err_constexpr_dtor : Error<"destructor cannot be marked constexpr">;
2199 def err_constexpr_no_declarators : Error<
2200   "constexpr can only be used in variable and function declarations">;
2201 def err_invalid_constexpr_var_decl : Error<
2202   "constexpr variable declaration must be a definition">;
2203 def err_constexpr_static_mem_var_requires_init : Error<
2204   "declaration of constexpr static data member %0 requires an initializer">;
2205 def err_constexpr_var_non_literal : Error<
2206   "constexpr variable cannot have non-literal type %0">;
2207 def err_constexpr_var_requires_const_init : Error<
2208   "constexpr variable %0 must be initialized by a constant expression">;
2209 def err_constexpr_redecl_mismatch : Error<
2210   "%select{non-constexpr declaration of %0 follows constexpr declaration"
2211   "|constexpr declaration of %0 follows non-constexpr declaration}1">;
2212 def err_constexpr_virtual : Error<"virtual function cannot be constexpr">;
2213 def err_constexpr_virtual_base : Error<
2214   "constexpr %select{member function|constructor}0 not allowed in "
2215   "%select{struct|interface|class}1 with virtual base "
2216   "%plural{1:class|:classes}2">;
2217 def note_non_literal_incomplete : Note<
2218   "incomplete type %0 is not a literal type">;
2219 def note_non_literal_virtual_base : Note<"%select{struct|interface|class}0 "
2220   "with virtual base %plural{1:class|:classes}1 is not a literal type">;
2221 def note_constexpr_virtual_base_here : Note<"virtual base class declared here">;
2222 def err_constexpr_non_literal_return : Error<
2223   "constexpr function's return type %0 is not a literal type">;
2224 def err_constexpr_non_literal_param : Error<
2225   "constexpr %select{function|constructor}1's %ordinal0 parameter type %2 is "
2226   "not a literal type">;
2227 def err_constexpr_body_invalid_stmt : Error<
2228   "statement not allowed in constexpr %select{function|constructor}0">;
2229 def ext_constexpr_body_invalid_stmt : ExtWarn<
2230   "use of this statement in a constexpr %select{function|constructor}0 "
2231   "is a C++14 extension">, InGroup<CXX14>;
2232 def warn_cxx11_compat_constexpr_body_invalid_stmt : Warning<
2233   "use of this statement in a constexpr %select{function|constructor}0 "
2234   "is incompatible with C++ standards before C++14">,
2235   InGroup<CXXPre14Compat>, DefaultIgnore;
2236 def ext_constexpr_type_definition : ExtWarn<
2237   "type definition in a constexpr %select{function|constructor}0 "
2238   "is a C++14 extension">, InGroup<CXX14>;
2239 def warn_cxx11_compat_constexpr_type_definition : Warning<
2240   "type definition in a constexpr %select{function|constructor}0 "
2241   "is incompatible with C++ standards before C++14">,
2242   InGroup<CXXPre14Compat>, DefaultIgnore;
2243 def err_constexpr_vla : Error<
2244   "variably-modified type %0 cannot be used in a constexpr "
2245   "%select{function|constructor}1">;
2246 def ext_constexpr_local_var : ExtWarn<
2247   "variable declaration in a constexpr %select{function|constructor}0 "
2248   "is a C++14 extension">, InGroup<CXX14>;
2249 def warn_cxx11_compat_constexpr_local_var : Warning<
2250   "variable declaration in a constexpr %select{function|constructor}0 "
2251   "is incompatible with C++ standards before C++14">,
2252   InGroup<CXXPre14Compat>, DefaultIgnore;
2253 def err_constexpr_local_var_static : Error<
2254   "%select{static|thread_local}1 variable not permitted in a constexpr "
2255   "%select{function|constructor}0">;
2256 def err_constexpr_local_var_non_literal_type : Error<
2257   "variable of non-literal type %1 cannot be defined in a constexpr "
2258   "%select{function|constructor}0">;
2259 def err_constexpr_local_var_no_init : Error<
2260   "variables defined in a constexpr %select{function|constructor}0 must be "
2261   "initialized">;
2262 def ext_constexpr_function_never_constant_expr : ExtWarn<
2263   "constexpr %select{function|constructor}0 never produces a "
2264   "constant expression">, InGroup<DiagGroup<"invalid-constexpr">>, DefaultError;
2265 def err_attr_cond_never_constant_expr : Error<
2266   "%0 attribute expression never produces a constant expression">;
2267 def err_diagnose_if_invalid_diagnostic_type : Error<
2268   "invalid diagnostic type for 'diagnose_if'; use \"error\" or \"warning\" "
2269   "instead">;
2270 def err_constexpr_body_no_return : Error<
2271   "no return statement in constexpr function">;
2272 def err_constexpr_return_missing_expr : Error<
2273   "non-void constexpr function %0 should return a value">;
2274 def warn_cxx11_compat_constexpr_body_no_return : Warning<
2275   "constexpr function with no return statements is incompatible with C++ "
2276   "standards before C++14">, InGroup<CXXPre14Compat>, DefaultIgnore;
2277 def ext_constexpr_body_multiple_return : ExtWarn<
2278   "multiple return statements in constexpr function is a C++14 extension">,
2279   InGroup<CXX14>;
2280 def warn_cxx11_compat_constexpr_body_multiple_return : Warning<
2281   "multiple return statements in constexpr function "
2282   "is incompatible with C++ standards before C++14">,
2283   InGroup<CXXPre14Compat>, DefaultIgnore;
2284 def note_constexpr_body_previous_return : Note<
2285   "previous return statement is here">;
2286 def err_constexpr_function_try_block : Error<
2287   "function try block not allowed in constexpr %select{function|constructor}0">;
2288 def err_constexpr_union_ctor_no_init : Error<
2289   "constexpr union constructor does not initialize any member">;
2290 def err_constexpr_ctor_missing_init : Error<
2291   "constexpr constructor must initialize all members">;
2292 def note_constexpr_ctor_missing_init : Note<
2293   "member not initialized by constructor">;
2294 def note_non_literal_no_constexpr_ctors : Note<
2295   "%0 is not literal because it is not an aggregate and has no constexpr "
2296   "constructors other than copy or move constructors">;
2297 def note_non_literal_base_class : Note<
2298   "%0 is not literal because it has base class %1 of non-literal type">;
2299 def note_non_literal_field : Note<
2300   "%0 is not literal because it has data member %1 of "
2301   "%select{non-literal|volatile}3 type %2">;
2302 def note_non_literal_user_provided_dtor : Note<
2303   "%0 is not literal because it has a user-provided destructor">;
2304 def note_non_literal_nontrivial_dtor : Note<
2305   "%0 is not literal because it has a non-trivial destructor">;
2306 def warn_private_extern : Warning<
2307   "use of __private_extern__ on a declaration may not produce external symbol "
2308   "private to the linkage unit and is deprecated">, InGroup<PrivateExtern>;
2309 def note_private_extern : Note<
2310   "use __attribute__((visibility(\"hidden\"))) attribute instead">;
2311
2312 // C++ Concepts TS
2313 def err_concept_wrong_decl_kind : Error<
2314   "'concept' can only appear on the definition of a function template or variable template">;
2315 def err_concept_decls_may_only_appear_in_namespace_scope : Error<
2316   "concept declarations may only appear in namespace scope">;
2317 def err_function_concept_not_defined : Error<
2318   "function concept declaration must be a definition">;
2319 def err_var_concept_not_initialized : Error<
2320   "variable concept declaration must be initialized">;
2321 def err_function_concept_exception_spec : Error<
2322   "function concept cannot have exception specification">;
2323 def err_concept_decl_invalid_specifiers : Error<
2324   "%select{variable|function}0 concept cannot be declared "
2325   "'%select{thread_local|inline|friend|constexpr}1'">;
2326 def err_function_concept_with_params : Error<
2327   "function concept cannot have any parameters">;
2328 def err_function_concept_bool_ret : Error<
2329   "declared return type of function concept must be 'bool'">;
2330 def err_variable_concept_bool_decl : Error<
2331   "declared type of variable concept must be 'bool'">;
2332 def err_concept_specified_specialization : Error<
2333   "'concept' cannot be applied on an "
2334   "%select{explicit instantiation|explicit specialization|partial specialization}0">;
2335 def err_concept_specialized : Error<
2336   "%select{function|variable}0 concept cannot be "
2337   "%select{explicitly instantiated|explicitly specialized|partially specialized}1">;
2338
2339 def err_template_different_associated_constraints : Error<
2340   "associated constraints differ in template redeclaration">;
2341
2342 // C++11 char16_t/char32_t
2343 def warn_cxx98_compat_unicode_type : Warning<
2344   "'%0' type specifier is incompatible with C++98">,
2345   InGroup<CXX98Compat>, DefaultIgnore;
2346
2347 // __make_integer_seq
2348 def err_integer_sequence_negative_length : Error<
2349   "integer sequences must have non-negative sequence length">;
2350 def err_integer_sequence_integral_element_type : Error<
2351   "integer sequences must have integral element type">;
2352
2353 // __type_pack_element
2354 def err_type_pack_element_out_of_bounds : Error<
2355   "a parameter pack may not be accessed at an out of bounds index">;
2356
2357 // Objective-C++
2358 def err_objc_decls_may_only_appear_in_global_scope : Error<
2359   "Objective-C declarations may only appear in global scope">;
2360 def warn_auto_var_is_id : Warning<
2361   "'auto' deduced as 'id' in declaration of %0">,
2362   InGroup<DiagGroup<"auto-var-id">>;
2363
2364 // Attributes
2365 def err_nsobject_attribute : Error<
2366   "'NSObject' attribute is for pointer types only">;
2367 def err_attributes_are_not_compatible : Error<
2368   "%0 and %1 attributes are not compatible">;
2369 def err_attribute_wrong_number_arguments : Error<
2370   "%0 attribute %plural{0:takes no arguments|1:takes one argument|"
2371   ":requires exactly %1 arguments}1">;
2372 def err_attribute_too_many_arguments : Error<
2373   "%0 attribute takes no more than %1 argument%s1">;
2374 def err_attribute_too_few_arguments : Error<
2375   "%0 attribute takes at least %1 argument%s1">;
2376 def err_attribute_invalid_vector_type : Error<"invalid vector element type %0">;
2377 def err_attribute_bad_neon_vector_size : Error<
2378   "Neon vector size must be 64 or 128 bits">;
2379 def err_attribute_requires_positive_integer : Error<
2380   "%0 attribute requires a positive integral compile time constant expression">;
2381 def err_attribute_requires_opencl_version : Error<
2382   "%0 attribute requires OpenCL version %1%select{| or above}2">;
2383 def warn_unsupported_target_attribute
2384     : Warning<"Ignoring unsupported '%0' in the target attribute string">,
2385     InGroup<IgnoredAttributes>;
2386 def err_attribute_unsupported
2387     : Error<"%0 attribute is not supported for this target">;
2388 // The err_*_attribute_argument_not_int are separate because they're used by
2389 // VerifyIntegerConstantExpression.
2390 def err_aligned_attribute_argument_not_int : Error<
2391   "'aligned' attribute requires integer constant">;
2392 def err_align_value_attribute_argument_not_int : Error<
2393   "'align_value' attribute requires integer constant">;
2394 def err_alignas_attribute_wrong_decl_type : Error<
2395   "%0 attribute cannot be applied to a %select{function parameter|"
2396   "variable with 'register' storage class|'catch' variable|bit-field}1">;
2397 def err_alignas_missing_on_definition : Error<
2398   "%0 must be specified on definition if it is specified on any declaration">;
2399 def note_alignas_on_declaration : Note<"declared with %0 attribute here">;
2400 def err_alignas_mismatch : Error<
2401   "redeclaration has different alignment requirement (%1 vs %0)">;
2402 def err_alignas_underaligned : Error<
2403   "requested alignment is less than minimum alignment of %1 for type %0">;
2404 def err_attribute_argument_n_type : Error<
2405   "%0 attribute requires parameter %1 to be %select{int or bool|an integer "
2406   "constant|a string|an identifier}2">;
2407 def err_attribute_argument_type : Error<
2408   "%0 attribute requires %select{int or bool|an integer "
2409   "constant|a string|an identifier}1">;
2410 def err_attribute_argument_outof_range : Error<
2411   "%0 attribute requires integer constant between %1 and %2 inclusive">;
2412 def err_init_priority_object_attr : Error<
2413   "can only use 'init_priority' attribute on file-scope definitions "
2414   "of objects of class type">;
2415 def err_attribute_argument_vec_type_hint : Error<
2416   "invalid attribute argument %0 - expecting a vector or vectorizable scalar type">;
2417 def err_attribute_argument_out_of_bounds : Error<
2418   "%0 attribute parameter %1 is out of bounds">;
2419 def err_attribute_only_once_per_parameter : Error<
2420   "%0 attribute can only be applied once per parameter">;
2421 def err_attribute_uuid_malformed_guid : Error<
2422   "uuid attribute contains a malformed GUID">;
2423 def err_mismatched_uuid : Error<"uuid does not match previous declaration">;
2424 def note_previous_uuid : Note<"previous uuid specified here">;
2425 def warn_attribute_pointers_only : Warning<
2426   "%0 attribute only applies to%select{| constant}1 pointer arguments">,
2427   InGroup<IgnoredAttributes>;
2428 def err_attribute_pointers_only : Error<warn_attribute_pointers_only.Text>;
2429 def err_attribute_integers_only : Error<
2430   "%0 attribute argument may only refer to a function parameter of integer "
2431   "type">;
2432 def warn_attribute_return_pointers_only : Warning<
2433   "%0 attribute only applies to return values that are pointers">,
2434   InGroup<IgnoredAttributes>;
2435 def warn_attribute_return_pointers_refs_only : Warning<
2436   "%0 attribute only applies to return values that are pointers or references">,
2437   InGroup<IgnoredAttributes>;
2438 def warn_attribute_pointer_or_reference_only : Warning<
2439   "%0 attribute only applies to a pointer or reference (%1 is invalid)">,
2440   InGroup<IgnoredAttributes>;
2441 def err_attribute_no_member_pointers : Error<
2442   "%0 attribute cannot be used with pointers to members">;
2443 def err_attribute_invalid_implicit_this_argument : Error<
2444   "%0 attribute is invalid for the implicit this argument">;
2445 def err_ownership_type : Error<
2446   "%0 attribute only applies to %select{pointer|integer}1 arguments">;
2447 def err_ownership_returns_index_mismatch : Error<
2448   "'ownership_returns' attribute index does not match; here it is %0">;
2449 def note_ownership_returns_index_mismatch : Note<
2450   "declared with index %0 here">;
2451 def err_format_strftime_third_parameter : Error<
2452   "strftime format attribute requires 3rd parameter to be 0">;
2453 def err_format_attribute_requires_variadic : Error<
2454   "format attribute requires variadic function">;
2455 def err_format_attribute_not : Error<"format argument not %0">;
2456 def err_format_attribute_result_not : Error<"function does not return %0">;
2457 def err_format_attribute_implicit_this_format_string : Error<
2458   "format attribute cannot specify the implicit this argument as the format "
2459   "string">;
2460 def err_init_method_bad_return_type : Error<
2461   "init methods must return an object pointer type, not %0">;
2462 def err_attribute_invalid_size : Error<
2463   "vector size not an integral multiple of component size">;
2464 def err_attribute_zero_size : Error<"zero vector size">;
2465 def err_attribute_size_too_large : Error<"vector size too large">;
2466 def err_typecheck_vector_not_convertable : Error<
2467   "cannot convert between vector values of different size (%0 and %1)">;
2468 def err_typecheck_vector_not_convertable_non_scalar : Error<
2469   "cannot convert between vector and non-scalar values (%0 and %1)">;
2470 def err_typecheck_vector_lengths_not_equal : Error<
2471   "vector operands do not have the same number of elements (%0 and %1)">;
2472 def warn_typecheck_vector_element_sizes_not_equal : Warning<
2473   "vector operands do not have the same elements sizes (%0 and %1)">,
2474   InGroup<DiagGroup<"vec-elem-size">>, DefaultError;
2475 def err_ext_vector_component_exceeds_length : Error<
2476   "vector component access exceeds type %0">;
2477 def err_ext_vector_component_name_illegal : Error<
2478   "illegal vector component name '%0'">;
2479 def err_attribute_address_space_negative : Error<
2480   "address space is negative">;
2481 def err_attribute_address_space_too_high : Error<
2482   "address space is larger than the maximum supported (%0)">;
2483 def err_attribute_address_multiple_qualifiers : Error<
2484   "multiple address spaces specified for type">;
2485 def err_attribute_address_function_type : Error<
2486   "function type may not be qualified with an address space">;
2487 def err_as_qualified_auto_decl : Error<
2488   "automatic variable qualified with an address space">;
2489 def err_arg_with_address_space : Error<
2490   "parameter may not be qualified with an address space">;
2491 def err_field_with_address_space : Error<
2492   "field may not be qualified with an address space">;
2493 def err_attr_objc_ownership_redundant : Error<
2494   "the type %0 is already explicitly ownership-qualified">;
2495 def err_invalid_nsnumber_type : Error<
2496   "%0 is not a valid literal type for NSNumber">;
2497 def err_objc_illegal_boxed_expression_type : Error<
2498   "illegal type %0 used in a boxed expression">;
2499 def err_objc_non_trivially_copyable_boxed_expression_type : Error<
2500   "non-trivially copyable type %0 cannot be used in a boxed expression">;
2501 def err_objc_incomplete_boxed_expression_type : Error<
2502   "incomplete type %0 used in a boxed expression">;
2503 def err_undeclared_objc_literal_class : Error<
2504   "definition of class %0 must be available to use Objective-C "
2505   "%select{array literals|dictionary literals|numeric literals|boxed expressions|"
2506   "string literals}1">;
2507 def err_undeclared_boxing_method : Error<
2508   "declaration of %0 is missing in %1 class">;
2509 def err_objc_literal_method_sig : Error<
2510   "literal construction method %0 has incompatible signature">;
2511 def note_objc_literal_method_param : Note<
2512   "%select{first|second|third}0 parameter has unexpected type %1 "
2513   "(should be %2)">;
2514 def note_objc_literal_method_return : Note<
2515   "method returns unexpected type %0 (should be an object type)">;
2516 def err_invalid_collection_element : Error<
2517   "collection element of type %0 is not an Objective-C object">;
2518 def err_box_literal_collection : Error<
2519   "%select{string|character|boolean|numeric}0 literal must be prefixed by '@' "
2520   "in a collection">;
2521 def warn_objc_literal_comparison : Warning<
2522   "direct comparison of %select{an array literal|a dictionary literal|"
2523   "a numeric literal|a boxed expression|}0 has undefined behavior">,
2524   InGroup<ObjCLiteralComparison>;
2525 def err_missing_atsign_prefix : Error<
2526   "string literal must be prefixed by '@' ">;
2527 def warn_objc_string_literal_comparison : Warning<
2528   "direct comparison of a string literal has undefined behavior">, 
2529   InGroup<ObjCStringComparison>;
2530 def warn_concatenated_nsarray_literal : Warning<
2531   "concatenated NSString literal for an NSArray expression - "
2532   "possibly missing a comma">,
2533   InGroup<ObjCStringConcatenation>;
2534 def note_objc_literal_comparison_isequal : Note<
2535   "use 'isEqual:' instead">;
2536 def warn_objc_collection_literal_element : Warning<
2537   "object of type %0 is not compatible with "
2538   "%select{array element type|dictionary key type|dictionary value type}1 %2">,
2539   InGroup<ObjCLiteralConversion>;
2540 def err_swift_param_attr_not_swiftcall : Error<
2541   "'%0' parameter can only be used with swiftcall calling convention">;
2542 def err_swift_indirect_result_not_first : Error<
2543   "'swift_indirect_result' parameters must be first parameters of function">;
2544 def err_swift_error_result_not_after_swift_context : Error<
2545   "'swift_error_result' parameter must follow 'swift_context' parameter">;
2546 def err_swift_abi_parameter_wrong_type : Error<
2547   "'%0' parameter must have pointer%select{| to unqualified pointer}1 type; "
2548   "type here is %2">;
2549
2550 def err_attribute_argument_invalid : Error<
2551   "%0 attribute argument is invalid: %select{max must be 0 since min is 0|"
2552   "min must not be greater than max}1">;
2553 def err_attribute_argument_is_zero : Error<
2554   "%0 attribute must be greater than 0">;
2555 def warn_attribute_argument_n_negative : Warning<
2556   "%0 attribute parameter %1 is negative and will be ignored">,
2557   InGroup<CudaCompat>;
2558 def err_property_function_in_objc_container : Error<
2559   "use of Objective-C property in function nested in Objective-C "
2560   "container not supported, move function outside its container">;
2561
2562 let CategoryName = "Cocoa API Issue" in {
2563 def warn_objc_redundant_literal_use : Warning<
2564   "using %0 with a literal is redundant">, InGroup<ObjCRedundantLiteralUse>;
2565 }
2566
2567 def err_attr_tlsmodel_arg : Error<"tls_model must be \"global-dynamic\", "
2568   "\"local-dynamic\", \"initial-exec\" or \"local-exec\"">;
2569
2570 def err_tls_var_aligned_over_maximum : Error<
2571   "alignment (%0) of thread-local variable %1 is greater than the maximum supported "
2572   "alignment (%2) for a thread-local variable on this target">;
2573
2574 def err_only_annotate_after_access_spec : Error<
2575   "access specifier can only have annotation attributes">;
2576
2577 def err_attribute_section_invalid_for_target : Error<
2578   "argument to 'section' attribute is not valid for this target: %0">;
2579 def warn_mismatched_section : Warning<
2580   "section does not match previous declaration">, InGroup<Section>;
2581
2582 def err_anonymous_property: Error<
2583   "anonymous property is not supported">;
2584 def err_property_is_variably_modified : Error<
2585   "property %0 has a variably modified type">;
2586 def err_no_accessor_for_property : Error<
2587   "no %select{getter|setter}0 defined for property %1">;
2588 def err_cannot_find_suitable_accessor : Error<
2589   "cannot find suitable %select{getter|setter}0 for property %1">;
2590
2591 def warn_alloca_align_alignof : Warning<
2592   "second argument to __builtin_alloca_with_align is supposed to be in bits">,
2593   InGroup<DiagGroup<"alloca-with-align-alignof">>;
2594
2595 def err_alignment_too_small : Error<
2596   "requested alignment must be %0 or greater">;
2597 def err_alignment_too_big : Error<
2598   "requested alignment must be %0 or smaller">;
2599 def err_alignment_not_power_of_two : Error<
2600   "requested alignment is not a power of 2">;
2601 def err_alignment_dependent_typedef_name : Error<
2602   "requested alignment is dependent but declaration is not dependent">;
2603
2604 def err_attribute_aligned_too_great : Error<
2605   "requested alignment must be %0 bytes or smaller">;
2606 def warn_redeclaration_without_attribute_prev_attribute_ignored : Warning<
2607   "%q0 redeclared without %1 attribute: previous %1 ignored">,
2608   InGroup<MicrosoftInconsistentDllImport>;
2609 def warn_redeclaration_without_import_attribute : Warning<
2610   "%q0 redeclared without 'dllimport' attribute: 'dllexport' attribute added">,
2611   InGroup<MicrosoftInconsistentDllImport>;
2612 def warn_dllimport_dropped_from_inline_function : Warning<
2613   "%q0 redeclared inline; %1 attribute ignored">,
2614   InGroup<IgnoredAttributes>;
2615 def warn_attribute_ignored : Warning<"%0 attribute ignored">,
2616   InGroup<IgnoredAttributes>;
2617 def warn_attribute_ignored_on_inline :
2618   Warning<"%0 attribute ignored on inline function">,
2619   InGroup<IgnoredAttributes>;
2620 def warn_attribute_after_definition_ignored : Warning<
2621   "attribute %0 after definition is ignored">,
2622    InGroup<IgnoredAttributes>;
2623 def warn_unknown_attribute_ignored : Warning<
2624   "unknown attribute %0 ignored">, InGroup<UnknownAttributes>;
2625 def warn_cxx11_gnu_attribute_on_type : Warning<
2626   "attribute %0 ignored, because it cannot be applied to a type">,
2627   InGroup<IgnoredAttributes>;
2628 def warn_unhandled_ms_attribute_ignored : Warning<
2629   "__declspec attribute %0 is not supported">, 
2630   InGroup<IgnoredAttributes>;
2631 def err_decl_attribute_invalid_on_stmt : Error<
2632   "%0 attribute cannot be applied to a statement">;
2633 def err_stmt_attribute_invalid_on_decl : Error<
2634   "%0 attribute cannot be applied to a declaration">;
2635 def warn_declspec_attribute_ignored : Warning<
2636   "attribute %0 is ignored, place it after "
2637   "\"%select{class|struct|interface|union|enum}1\" to apply attribute to "
2638   "type declaration">, InGroup<IgnoredAttributes>;
2639 def warn_attribute_precede_definition : Warning<
2640   "attribute declaration must precede definition">,
2641   InGroup<IgnoredAttributes>;
2642 def warn_attribute_void_function_method : Warning<
2643   "attribute %0 cannot be applied to "
2644   "%select{functions|Objective-C method}1 without return value">,
2645   InGroup<IgnoredAttributes>;
2646 def warn_attribute_weak_on_field : Warning<
2647   "__weak attribute cannot be specified on a field declaration">,
2648   InGroup<IgnoredAttributes>;
2649 def warn_gc_attribute_weak_on_local : Warning<
2650   "Objective-C GC does not allow weak variables on the stack">,
2651   InGroup<IgnoredAttributes>;
2652 def warn_nsobject_attribute : Warning<
2653   "'NSObject' attribute may be put on a typedef only; attribute is ignored">,
2654   InGroup<NSobjectAttribute>;
2655 def warn_independentclass_attribute : Warning<
2656   "'objc_independent_class' attribute may be put on a typedef only; "
2657   "attribute is ignored">,
2658   InGroup<IndependentClassAttribute>;
2659 def warn_ptr_independentclass_attribute : Warning<
2660   "'objc_independent_class' attribute may be put on Objective-C object "
2661   "pointer type only; attribute is ignored">,
2662   InGroup<IndependentClassAttribute>;
2663 def warn_attribute_weak_on_local : Warning<
2664   "__weak attribute cannot be specified on an automatic variable when ARC "
2665   "is not enabled">,
2666   InGroup<IgnoredAttributes>;
2667 def warn_weak_identifier_undeclared : Warning<
2668   "weak identifier %0 never declared">;
2669 def err_attribute_weak_static : Error<
2670   "weak declaration cannot have internal linkage">;
2671 def err_attribute_selectany_non_extern_data : Error<
2672   "'selectany' can only be applied to data items with external linkage">;
2673 def err_declspec_thread_on_thread_variable : Error<
2674   "'__declspec(thread)' applied to variable that already has a "
2675   "thread-local storage specifier">;
2676 def err_attribute_dll_not_extern : Error<
2677   "%q0 must have external linkage when declared %q1">;
2678 def err_attribute_dll_thread_local : Error<
2679   "%q0 cannot be thread local when declared %q1">;
2680 def err_attribute_dll_lambda : Error<
2681   "lambda cannot be declared %0">;
2682 def warn_attribute_invalid_on_definition : Warning<
2683   "'%0' attribute cannot be specified on a definition">,
2684   InGroup<IgnoredAttributes>;
2685 def err_attribute_dll_redeclaration : Error<
2686   "redeclaration of %q0 cannot add %q1 attribute">;
2687 def warn_attribute_dll_redeclaration : Warning<
2688   "redeclaration of %q0 should not add %q1 attribute">,
2689   InGroup<DiagGroup<"dll-attribute-on-redeclaration">>;
2690 def err_attribute_dllimport_function_definition : Error<
2691   "dllimport cannot be applied to non-inline function definition">;
2692 def err_attribute_dll_deleted : Error<
2693   "attribute %q0 cannot be applied to a deleted function">;
2694 def err_attribute_dllimport_data_definition : Error<
2695   "definition of dllimport data">;
2696 def err_attribute_dllimport_static_field_definition : Error<
2697   "definition of dllimport static field not allowed">;
2698 def warn_attribute_dllimport_static_field_definition : Warning<
2699   "definition of dllimport static field">,
2700   InGroup<DiagGroup<"dllimport-static-field-def">>;
2701 def warn_attribute_dllexport_explicit_instantiation_decl : Warning<
2702   "explicit instantiation declaration should not be 'dllexport'">,
2703   InGroup<DiagGroup<"dllexport-explicit-instantiation-decl">>;
2704 def warn_invalid_initializer_from_system_header : Warning<
2705   "invalid constructor form class in system header, should not be explicit">,
2706   InGroup<DiagGroup<"invalid-initializer-from-system-header">>;
2707 def note_used_in_initialization_here : Note<"used in initialization here">;
2708 def err_attribute_dll_member_of_dll_class : Error<
2709   "attribute %q0 cannot be applied to member of %q1 class">;
2710 def warn_attribute_dll_instantiated_base_class : Warning<
2711   "propagating dll attribute to %select{already instantiated|explicitly specialized}0 "
2712   "base class template without dll attribute is not supported">,
2713   InGroup<DiagGroup<"unsupported-dll-base-class-template">>, DefaultIgnore;
2714 def err_attribute_dll_ambiguous_default_ctor : Error<
2715   "'__declspec(dllexport)' cannot be applied to more than one default constructor in %0">;
2716 def err_attribute_weakref_not_static : Error<
2717   "weakref declaration must have internal linkage">;
2718 def err_attribute_weakref_not_global_context : Error<
2719   "weakref declaration of %0 must be in a global context">;
2720 def err_attribute_weakref_without_alias : Error<
2721   "weakref declaration of %0 must also have an alias attribute">;
2722 def err_alias_not_supported_on_darwin : Error <
2723   "only weak aliases are supported on darwin">;
2724 def err_alias_to_undefined : Error<
2725   "%select{alias|ifunc}0 must point to a defined %select{variable or |}1function">;
2726 def warn_alias_to_weak_alias : Warning<
2727   "%select{alias|ifunc}2 will always resolve to %0 even if weak definition of %1 is overridden">,
2728   InGroup<IgnoredAttributes>;
2729 def warn_alias_with_section : Warning<
2730   "%select{alias|ifunc}1 will not be in section '%0' but in the same section as the %select{aliasee|resolver}2">,
2731   InGroup<IgnoredAttributes>;
2732 def err_duplicate_mangled_name : Error<
2733   "definition with same mangled name as another definition">;
2734 def err_cyclic_alias : Error<
2735   "%select{alias|ifunc}0 definition is part of a cycle">;
2736 def err_ifunc_resolver_return : Error<
2737   "ifunc resolver function must return a pointer">;
2738 def err_ifunc_resolver_params : Error<
2739   "ifunc resolver function must have no parameters">;
2740 def warn_attribute_wrong_decl_type : Warning<
2741   "%0 attribute only applies to %select{"
2742   "functions"
2743   "|unions"
2744   "|variables and functions"
2745   "|functions and global variables"
2746   "|functions, variables, and Objective-C interfaces"
2747   "|functions and methods"
2748   "|parameters"
2749   "|functions, methods and blocks"
2750   "|functions, methods, and classes"
2751   "|functions, methods, and parameters"
2752   "|functions, methods, and global variables"
2753   "|classes"
2754   "|enums"
2755   "|variables"
2756   "|methods"
2757   "|fields and global variables"
2758   "|structs"
2759   "|parameters and typedefs"
2760   "|variables and typedefs"
2761   "|thread-local variables"
2762   "|variables and fields"
2763   "|variables, data members and tag types"
2764   "|types and namespaces"
2765   "|Objective-C interfaces"
2766   "|methods and properties"
2767   "|struct or union"
2768   "|struct, union or class"
2769   "|types"
2770   "|Objective-C instance methods"
2771   "|init methods of interface or class extension declarations"
2772   "|variables, functions and classes"
2773   "|functions, variables, classes, and Objective-C interfaces"
2774   "|Objective-C protocols"
2775   "|variables with static or thread storage duration"
2776   "|functions, methods, properties, and global variables"
2777   "|structs, unions, and typedefs"
2778   "|structs and typedefs"
2779   "|interface or protocol declarations"
2780   "|kernel functions"
2781   "|non-K&R-style functions"
2782   "|variables, enums, fields and typedefs"
2783   "|functions, methods, enums, and classes"
2784   "|structs, classes, variables, functions, and inline namespaces"
2785   "|variables, functions, methods, types, enumerations, enumerators, labels, and non-static data members"
2786   "|classes and enumerations"
2787   "|named declarations}1">,
2788   InGroup<IgnoredAttributes>;
2789 def err_attribute_wrong_decl_type : Error<warn_attribute_wrong_decl_type.Text>;
2790 def warn_type_attribute_wrong_type : Warning<
2791   "'%0' only applies to %select{function|pointer|"
2792   "Objective-C object or block pointer}1 types; type here is %2">,
2793   InGroup<IgnoredAttributes>;
2794 def warn_incomplete_encoded_type : Warning<
2795   "encoding of %0 type is incomplete because %1 component has unknown encoding">,
2796   InGroup<DiagGroup<"encode-type">>;
2797 def warn_gnu_inline_attribute_requires_inline : Warning<
2798   "'gnu_inline' attribute requires function to be marked 'inline',"
2799   " attribute ignored">,
2800   InGroup<IgnoredAttributes>;
2801 def err_attribute_vecreturn_only_vector_member : Error<
2802   "the vecreturn attribute can only be used on a class or structure with one member, which must be a vector">;
2803 def err_attribute_vecreturn_only_pod_record : Error<
2804   "the vecreturn attribute can only be used on a POD (plain old data) class or structure (i.e. no virtual functions)">;
2805 def err_cconv_change : Error<
2806   "function declared '%0' here was previously declared "
2807   "%select{'%2'|without calling convention}1">;
2808 def warn_cconv_ignored : Warning<
2809   "calling convention %0 ignored for this target">, InGroup<IgnoredAttributes>;
2810 def err_cconv_knr : Error<
2811   "function with no prototype cannot use the %0 calling convention">;
2812 def warn_cconv_knr : Warning<
2813   err_cconv_knr.Text>,
2814   InGroup<DiagGroup<"missing-prototype-for-cc">>;
2815 def err_cconv_varargs : Error<
2816   "variadic function cannot use %0 calling convention">;
2817 def warn_cconv_varargs : Warning<
2818   "%0 calling convention ignored on variadic function">,
2819   InGroup<IgnoredAttributes>;
2820 def warn_cconv_structors : Warning<
2821   "%0 calling convention ignored on constructor/destructor">,
2822   InGroup<IgnoredAttributes>;
2823 def err_regparm_mismatch : Error<"function declared with regparm(%0) "
2824   "attribute was previously declared "
2825   "%plural{0:without the regparm|:with the regparm(%1)}1 attribute">;
2826 def err_function_attribute_mismatch : Error<
2827   "function declared with %0 attribute "
2828   "was previously declared without the %0 attribute">;
2829 def err_objc_precise_lifetime_bad_type : Error<
2830   "objc_precise_lifetime only applies to retainable types; type here is %0">;
2831 def warn_objc_precise_lifetime_meaningless : Error<
2832   "objc_precise_lifetime is not meaningful for "
2833   "%select{__unsafe_unretained|__autoreleasing}0 objects">;
2834 def err_invalid_pcs : Error<"invalid PCS type">;
2835 def warn_attribute_not_on_decl : Warning<
2836   "%0 attribute ignored when parsing type">, InGroup<IgnoredAttributes>;
2837 def err_base_specifier_attribute : Error<
2838   "%0 attribute cannot be applied to a base specifier">;
2839 def err_invalid_attribute_on_virtual_function : Error<
2840   "%0 attribute cannot be applied to virtual functions">;
2841
2842 // Availability attribute
2843 def warn_availability_unknown_platform : Warning<
2844   "unknown platform %0 in availability macro">, InGroup<Availability>;
2845 def warn_availability_version_ordering : Warning<
2846   "feature cannot be %select{introduced|deprecated|obsoleted}0 in %1 version "
2847   "%2 before it was %select{introduced|deprecated|obsoleted}3 in version %4; "
2848   "attribute ignored">, InGroup<Availability>;
2849 def warn_mismatched_availability: Warning<
2850   "availability does not match previous declaration">, InGroup<Availability>;
2851 def warn_mismatched_availability_override : Warning<
2852   "%select{|overriding }4method %select{introduced after|"
2853   "deprecated before|obsoleted before}0 "
2854   "%select{the protocol method it implements|overridden method}4 "
2855   "on %1 (%2 vs. %3)">, InGroup<Availability>;
2856 def warn_mismatched_availability_override_unavail : Warning<
2857   "%select{|overriding }1method cannot be unavailable on %0 when "
2858   "%select{the protocol method it implements|its overridden method}1 is "
2859   "available">,
2860   InGroup<Availability>;
2861 def note_overridden_method : Note<
2862   "overridden method is here">;
2863 def note_protocol_method : Note<
2864   "protocol method is here">;
2865
2866 def warn_unguarded_availability :
2867   Warning<"%0 is only available on %1 %2 or newer">,
2868   InGroup<UnguardedAvailability>, DefaultIgnore;
2869 def warn_partial_availability : Warning<"%0 is only available conditionally">,
2870     InGroup<UnguardedAvailability>, DefaultIgnore;
2871 def note_partial_availability_silence : Note<
2872   "explicitly redeclare %0 to silence this warning">;
2873 def note_unguarded_available_silence : Note<
2874   "enclose %0 in %select{an @available|a __builtin_available}1 check to silence"
2875   " this warning">;
2876 def warn_partial_message : Warning<"%0 is partial: %1">,
2877     InGroup<UnguardedAvailability>, DefaultIgnore;
2878 def warn_partial_fwdclass_message : Warning<
2879     "%0 may be partial because the receiver type is unknown">,
2880     InGroup<UnguardedAvailability>, DefaultIgnore;
2881
2882 // Thread Safety Attributes
2883 def warn_invalid_capability_name : Warning<
2884   "invalid capability name '%0'; capability name must be 'mutex' or 'role'">,
2885   InGroup<ThreadSafetyAttributes>, DefaultIgnore;
2886 def warn_thread_attribute_ignored : Warning<
2887   "ignoring %0 attribute because its argument is invalid">,
2888   InGroup<ThreadSafetyAttributes>, DefaultIgnore;
2889 def warn_thread_attribute_argument_not_lockable : Warning<
2890   "%0 attribute requires arguments whose type is annotated "
2891   "with 'capability' attribute; type here is %1">,
2892   InGroup<ThreadSafetyAttributes>, DefaultIgnore;
2893 def warn_thread_attribute_decl_not_lockable : Warning<
2894   "%0 attribute can only be applied in a context annotated "
2895   "with 'capability(\"mutex\")' attribute">,
2896   InGroup<ThreadSafetyAttributes>, DefaultIgnore;
2897 def warn_thread_attribute_decl_not_pointer : Warning<
2898   "%0 only applies to pointer types; type here is %1">,
2899   InGroup<ThreadSafetyAttributes>, DefaultIgnore;
2900 def err_attribute_argument_out_of_range : Error<
2901   "%0 attribute parameter %1 is out of bounds: "
2902   "%plural{0:no parameters to index into|"
2903   "1:can only be 1, since there is one parameter|"
2904   ":must be between 1 and %2}2">;
2905
2906 // Thread Safety Analysis   
2907 def warn_unlock_but_no_lock : Warning<"releasing %0 '%1' that was not held">,
2908   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2909 def warn_unlock_kind_mismatch : Warning<
2910   "releasing %0 '%1' using %select{shared|exclusive}2 access, expected "
2911   "%select{shared|exclusive}3 access">,
2912   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2913 def warn_double_lock : Warning<"acquiring %0 '%1' that is already held">,
2914   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2915 def warn_no_unlock : Warning<
2916   "%0 '%1' is still held at the end of function">,
2917   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2918 def warn_expecting_locked : Warning<
2919   "expecting %0 '%1' to be held at the end of function">,
2920   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;  
2921 // FIXME: improve the error message about locks not in scope
2922 def warn_lock_some_predecessors : Warning<
2923   "%0 '%1' is not held on every path through here">,
2924   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2925 def warn_expecting_lock_held_on_loop : Warning<
2926   "expecting %0 '%1' to be held at start of each loop">,
2927   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2928 def note_locked_here : Note<"%0 acquired here">;
2929 def warn_lock_exclusive_and_shared : Warning<
2930   "%0 '%1' is acquired exclusively and shared in the same scope">,
2931   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2932 def note_lock_exclusive_and_shared : Note<
2933   "the other acquisition of %0 '%1' is here">;
2934 def warn_variable_requires_any_lock : Warning<
2935   "%select{reading|writing}1 variable '%0' requires holding "
2936   "%select{any mutex|any mutex exclusively}1">,
2937   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2938 def warn_var_deref_requires_any_lock : Warning<
2939   "%select{reading|writing}1 the value pointed to by '%0' requires holding "
2940   "%select{any mutex|any mutex exclusively}1">,
2941   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2942 def warn_fun_excludes_mutex : Warning<
2943   "cannot call function '%1' while %0 '%2' is held">,
2944   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2945 def warn_cannot_resolve_lock : Warning<
2946   "cannot resolve lock expression">,
2947   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2948 def warn_acquired_before : Warning<
2949   "%0 '%1' must be acquired before '%2'">,
2950   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2951 def warn_acquired_before_after_cycle : Warning<
2952   "Cycle in acquired_before/after dependencies, starting with '%0'">,
2953   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2954
2955
2956 // Thread safety warnings negative capabilities
2957 def warn_acquire_requires_negative_cap : Warning<
2958   "acquiring %0 '%1' requires negative capability '%2'">,
2959   InGroup<ThreadSafetyNegative>, DefaultIgnore;
2960
2961 // Thread safety warnings on pass by reference
2962 def warn_guarded_pass_by_reference : Warning<
2963   "passing variable '%1' by reference requires holding %0 "
2964   "%select{'%2'|'%2' exclusively}3">,
2965   InGroup<ThreadSafetyReference>, DefaultIgnore;
2966 def warn_pt_guarded_pass_by_reference : Warning<
2967   "passing the value that '%1' points to by reference requires holding %0 "
2968   "%select{'%2'|'%2' exclusively}3">,
2969   InGroup<ThreadSafetyReference>, DefaultIgnore;
2970
2971 // Imprecise thread safety warnings
2972 def warn_variable_requires_lock : Warning<
2973   "%select{reading|writing}3 variable '%1' requires holding %0 "
2974   "%select{'%2'|'%2' exclusively}3">,
2975   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2976 def warn_var_deref_requires_lock : Warning<
2977   "%select{reading|writing}3 the value pointed to by '%1' requires "
2978   "holding %0 %select{'%2'|'%2' exclusively}3">,
2979   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2980 def warn_fun_requires_lock : Warning<
2981   "calling function '%1' requires holding %0 %select{'%2'|'%2' exclusively}3">,
2982   InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
2983
2984 // Precise thread safety warnings
2985 def warn_variable_requires_lock_precise :
2986   Warning<warn_variable_requires_lock.Text>,
2987   InGroup<ThreadSafetyPrecise>, DefaultIgnore;
2988 def warn_var_deref_requires_lock_precise :
2989   Warning<warn_var_deref_requires_lock.Text>,
2990   InGroup<ThreadSafetyPrecise>, DefaultIgnore;
2991 def warn_fun_requires_lock_precise :
2992   Warning<warn_fun_requires_lock.Text>,
2993   InGroup<ThreadSafetyPrecise>, DefaultIgnore;
2994 def note_found_mutex_near_match : Note<"found near match '%0'">;
2995
2996 // Verbose thread safety warnings
2997 def warn_thread_safety_verbose : Warning<"Thread safety verbose warning.">, 
2998   InGroup<ThreadSafetyVerbose>, DefaultIgnore;
2999 def note_thread_warning_in_fun : Note<"Thread warning in function '%0'">;
3000 def note_guarded_by_declared_here : Note<"Guarded_by declared here.">;
3001
3002 // Dummy warning that will trigger "beta" warnings from the analysis if enabled. 
3003 def warn_thread_safety_beta : Warning<"Thread safety beta warning.">, 
3004   InGroup<ThreadSafetyBeta>, DefaultIgnore;
3005
3006 // Consumed warnings
3007 def warn_use_in_invalid_state : Warning<
3008   "invalid invocation of method '%0' on object '%1' while it is in the '%2' "
3009   "state">, InGroup<Consumed>, DefaultIgnore;
3010 def warn_use_of_temp_in_invalid_state : Warning<
3011   "invalid invocation of method '%0' on a temporary object while it is in the "
3012   "'%1' state">, InGroup<Consumed>, DefaultIgnore;
3013 def warn_attr_on_unconsumable_class : Warning<
3014   "consumed analysis attribute is attached to member of class '%0' which isn't "
3015   "marked as consumable">, InGroup<Consumed>, DefaultIgnore;
3016 def warn_return_typestate_for_unconsumable_type : Warning<
3017   "return state set for an unconsumable type '%0'">, InGroup<Consumed>,
3018   DefaultIgnore;
3019 def warn_return_typestate_mismatch : Warning<
3020   "return value not in expected state; expected '%0', observed '%1'">,
3021   InGroup<Consumed>, DefaultIgnore;
3022 def warn_loop_state_mismatch : Warning<
3023   "state of variable '%0' must match at the entry and exit of loop">,
3024   InGroup<Consumed>, DefaultIgnore;
3025 def warn_param_return_typestate_mismatch : Warning<
3026   "parameter '%0' not in expected state when the function returns: expected "
3027   "'%1', observed '%2'">, InGroup<Consumed>, DefaultIgnore;
3028 def warn_param_typestate_mismatch : Warning<
3029   "argument not in expected state; expected '%0', observed '%1'">,
3030   InGroup<Consumed>, DefaultIgnore;
3031
3032 // no_sanitize attribute
3033 def warn_unknown_sanitizer_ignored : Warning<
3034   "unknown sanitizer '%0' ignored">, InGroup<UnknownSanitizers>;
3035
3036 def warn_impcast_vector_scalar : Warning<
3037   "implicit conversion turns vector to scalar: %0 to %1">,
3038   InGroup<Conversion>, DefaultIgnore;
3039 def warn_impcast_complex_scalar : Warning<
3040   "implicit conversion discards imaginary component: %0 to %1">,
3041   InGroup<Conversion>, DefaultIgnore;
3042 def warn_impcast_float_precision : Warning<
3043   "implicit conversion loses floating-point precision: %0 to %1">,
3044   InGroup<Conversion>, DefaultIgnore;
3045 def warn_impcast_double_promotion : Warning<
3046   "implicit conversion increases floating-point precision: %0 to %1">,
3047   InGroup<DoublePromotion>, DefaultIgnore;
3048 def warn_impcast_integer_sign : Warning<
3049   "implicit conversion changes signedness: %0 to %1">,
3050   InGroup<SignConversion>, DefaultIgnore;
3051 def warn_impcast_integer_sign_conditional : Warning<
3052   "operand of ? changes signedness: %0 to %1">,
3053   InGroup<SignConversion>, DefaultIgnore;
3054 def warn_impcast_integer_precision : Warning<
3055   "implicit conversion loses integer precision: %0 to %1">,
3056   InGroup<Conversion>, DefaultIgnore;
3057 def warn_impcast_integer_64_32 : Warning<
3058   "implicit conversion loses integer precision: %0 to %1">,
3059   InGroup<Shorten64To32>, DefaultIgnore;
3060 def warn_impcast_integer_precision_constant : Warning<
3061   "implicit conversion from %2 to %3 changes value from %0 to %1">,
3062   InGroup<ConstantConversion>;
3063 def warn_impcast_bitfield_precision_constant : Warning<
3064   "implicit truncation from %2 to bit-field changes value from %0 to %1">,
3065   InGroup<BitFieldConstantConversion>;
3066
3067 def warn_impcast_literal_float_to_integer : Warning<
3068   "implicit conversion from %0 to %1 changes value from %2 to %3">,
3069   InGroup<LiteralConversion>;
3070 def warn_impcast_float_integer : Warning<
3071   "implicit conversion turns floating-point number into integer: %0 to %1">,
3072   InGroup<FloatConversion>, DefaultIgnore;
3073
3074 def warn_impcast_float_to_integer : Warning<
3075   "implicit conversion of out of range value from %0 to %1 changes value "
3076   "from %2 to %3">,
3077   InGroup<FloatOverflowConversion>, DefaultIgnore;
3078 def warn_impcast_float_to_integer_zero : Warning<
3079   "implicit conversion from %0 to %1 changes non-zero value from %2 to %3">,
3080   InGroup<FloatZeroConversion>, DefaultIgnore;
3081
3082 def warn_impcast_string_literal_to_bool : Warning<
3083   "implicit conversion turns string literal into bool: %0 to %1">,
3084   InGroup<StringConversion>, DefaultIgnore;
3085 def warn_impcast_different_enum_types : Warning<
3086   "implicit conversion from enumeration type %0 to different enumeration type "
3087   "%1">, InGroup<EnumConversion>;
3088 def warn_impcast_bool_to_null_pointer : Warning<
3089     "initialization of pointer of type %0 to null from a constant boolean "
3090     "expression">, InGroup<BoolConversion>;
3091 def warn_non_literal_null_pointer : Warning<
3092     "expression which evaluates to zero treated as a null pointer constant of "
3093     "type %0">, InGroup<NonLiteralNullConversion>;
3094 def warn_impcast_null_pointer_to_integer : Warning<
3095     "implicit conversion of %select{NULL|nullptr}0 constant to %1">,
3096     InGroup<NullConversion>;
3097 def warn_impcast_floating_point_to_bool : Warning<
3098     "implicit conversion turns floating-point number into bool: %0 to %1">,
3099     InGroup<ImplicitConversionFloatingPointToBool>;
3100 def ext_ms_impcast_fn_obj : ExtWarn<
3101   "implicit conversion between pointer-to-function and pointer-to-object is a "
3102   "Microsoft extension">, InGroup<MicrosoftCast>;
3103
3104 def warn_impcast_pointer_to_bool : Warning<
3105     "address of%select{| function| array}0 '%1' will always evaluate to "
3106     "'true'">,
3107     InGroup<PointerBoolConversion>;
3108 def warn_cast_nonnull_to_bool : Warning<
3109     "nonnull %select{function call|parameter}0 '%1' will evaluate to "
3110     "'true' on first encounter">,
3111     InGroup<PointerBoolConversion>;
3112 def warn_this_bool_conversion : Warning<
3113   "'this' pointer cannot be null in well-defined C++ code; pointer may be "
3114   "assumed to always convert to true">, InGroup<UndefinedBoolConversion>;
3115 def warn_address_of_reference_bool_conversion : Warning<
3116   "reference cannot be bound to dereferenced null pointer in well-defined C++ "
3117   "code; pointer may be assumed to always convert to true">,
3118   InGroup<UndefinedBoolConversion>;
3119
3120 def warn_null_pointer_compare : Warning<
3121     "comparison of %select{address of|function|array}0 '%1' %select{not |}2"
3122     "equal to a null pointer is always %select{true|false}2">,
3123     InGroup<TautologicalPointerCompare>;
3124 def warn_nonnull_expr_compare : Warning<
3125     "comparison of nonnull %select{function call|parameter}0 '%1' "
3126     "%select{not |}2equal to a null pointer is '%select{true|false}2' on first "
3127     "encounter">,
3128     InGroup<TautologicalPointerCompare>;
3129 def warn_this_null_compare : Warning<
3130   "'this' pointer cannot be null in well-defined C++ code; comparison may be "
3131   "assumed to always evaluate to %select{true|false}0">,
3132   InGroup<TautologicalUndefinedCompare>;
3133 def warn_address_of_reference_null_compare : Warning<
3134   "reference cannot be bound to dereferenced null pointer in well-defined C++ "
3135   "code; comparison may be assumed to always evaluate to "
3136   "%select{true|false}0">,
3137   InGroup<TautologicalUndefinedCompare>;
3138 def note_reference_is_return_value : Note<"%0 returns a reference">;
3139
3140 def note_function_warning_silence : Note<
3141     "prefix with the address-of operator to silence this warning">;
3142 def note_function_to_function_call : Note<
3143     "suffix with parentheses to turn this into a function call">;
3144 def warn_impcast_objective_c_literal_to_bool : Warning<
3145     "implicit boolean conversion of Objective-C object literal always "
3146     "evaluates to true">,
3147     InGroup<ObjCLiteralConversion>;
3148
3149 def warn_cast_align : Warning<
3150   "cast from %0 to %1 increases required alignment from %2 to %3">,
3151   InGroup<CastAlign>, DefaultIgnore;
3152 def warn_old_style_cast : Warning<
3153   "use of old-style cast">, InGroup<OldStyleCast>, DefaultIgnore;
3154
3155 // Separate between casts to void* and non-void* pointers.
3156 // Some APIs use (abuse) void* for something like a user context,
3157 // and often that value is an integer even if it isn't a pointer itself.
3158 // Having a separate warning flag allows users to control the warning
3159 // for their workflow.
3160 def warn_int_to_pointer_cast : Warning<
3161   "cast to %1 from smaller integer type %0">,
3162   InGroup<IntToPointerCast>;
3163 def warn_int_to_void_pointer_cast : Warning<
3164   "cast to %1 from smaller integer type %0">,
3165   InGroup<IntToVoidPointerCast>;
3166
3167 def warn_no_underlying_type_specified_for_enum_bitfield : Warning<
3168   "enums in the Microsoft ABI are signed integers by default; consider giving "
3169   "the enum %0 an unsigned underlying type to make this code portable">,
3170   InGroup<SignedEnumBitfield>, DefaultIgnore;
3171 def warn_attribute_packed_for_bitfield : Warning<
3172   "'packed' attribute was ignored on bit-fields with single-byte alignment "
3173   "in older versions of GCC and Clang">,
3174   InGroup<DiagGroup<"attribute-packed-for-bitfield">>;
3175 def warn_transparent_union_attribute_field_size_align : Warning<
3176   "%select{alignment|size}0 of field %1 (%2 bits) does not match the "
3177   "%select{alignment|size}0 of the first field in transparent union; "
3178   "transparent_union attribute ignored">,
3179   InGroup<IgnoredAttributes>;
3180 def note_transparent_union_first_field_size_align : Note<
3181   "%select{alignment|size}0 of first field is %1 bits">;
3182 def warn_transparent_union_attribute_not_definition : Warning<
3183   "transparent_union attribute can only be applied to a union definition; "
3184   "attribute ignored">,
3185   InGroup<IgnoredAttributes>;
3186 def warn_transparent_union_attribute_floating : Warning<
3187   "first field of a transparent union cannot have %select{floating point|"
3188   "vector}0 type %1; transparent_union attribute ignored">,
3189   InGroup<IgnoredAttributes>;
3190 def warn_transparent_union_attribute_zero_fields : Warning<
3191   "transparent union definition must contain at least one field; "
3192   "transparent_union attribute ignored">,
3193   InGroup<IgnoredAttributes>;
3194 def warn_attribute_type_not_supported : Warning<
3195   "%0 attribute argument not supported: %1">,
3196   InGroup<IgnoredAttributes>;
3197 def warn_attribute_unknown_visibility : Warning<"unknown visibility %0">,
3198   InGroup<IgnoredAttributes>;
3199 def warn_attribute_protected_visibility :
3200   Warning<"target does not support 'protected' visibility; using 'default'">,
3201   InGroup<DiagGroup<"unsupported-visibility">>;
3202 def err_mismatched_visibility: Error<"visibility does not match previous declaration">;
3203 def note_previous_attribute : Note<"previous attribute is here">;
3204 def note_conflicting_attribute : Note<"conflicting attribute is here">;
3205 def note_attribute : Note<"attribute is here">;
3206 def err_mismatched_ms_inheritance : Error<
3207   "inheritance model does not match %select{definition|previous declaration}0">;
3208 def warn_ignored_ms_inheritance : Warning<
3209   "inheritance model ignored on %select{primary template|partial specialization}0">,
3210   InGroup<IgnoredAttributes>;
3211 def note_previous_ms_inheritance : Note<
3212   "previous inheritance model specified here">;
3213 def err_machine_mode : Error<"%select{unknown|unsupported}0 machine mode %1">;
3214 def err_mode_not_primitive : Error<
3215   "mode attribute only supported for integer and floating-point types">;
3216 def err_mode_wrong_type : Error<
3217   "type of machine mode does not match type of base type">;
3218 def warn_vector_mode_deprecated : Warning<
3219   "specifying vector types with the 'mode' attribute is deprecated; "
3220   "use the 'vector_size' attribute instead">,
3221   InGroup<DeprecatedAttributes>;
3222 def err_complex_mode_vector_type : Error<
3223   "type of machine mode does not support base vector types">;
3224 def err_enum_mode_vector_type : Error<
3225   "mode %0 is not supported for enumeration types">;
3226 def warn_attribute_nonnull_no_pointers : Warning<
3227   "'nonnull' attribute applied to function with no pointer arguments">,
3228   InGroup<IgnoredAttributes>;
3229 def warn_attribute_nonnull_parm_no_args : Warning<
3230   "'nonnull' attribute when used on parameters takes no arguments">,
3231   InGroup<IgnoredAttributes>;
3232 def note_declared_nonnull : Note<
3233   "declared %select{'returns_nonnull'|'nonnull'}0 here">;
3234 def warn_attribute_sentinel_named_arguments : Warning<
3235   "'sentinel' attribute requires named arguments">,
3236   InGroup<IgnoredAttributes>;
3237 def warn_attribute_sentinel_not_variadic : Warning<
3238   "'sentinel' attribute only supported for variadic %select{functions|blocks}0">,
3239   InGroup<IgnoredAttributes>;
3240 def err_attribute_sentinel_less_than_zero : Error<
3241   "'sentinel' parameter 1 less than zero">;
3242 def err_attribute_sentinel_not_zero_or_one : Error<
3243   "'sentinel' parameter 2 not 0 or 1">;
3244 def warn_cleanup_ext : Warning<
3245   "GCC does not allow the 'cleanup' attribute argument to be anything other "
3246   "than a simple identifier">, 
3247   InGroup<GccCompat>;
3248 def err_attribute_cleanup_arg_not_function : Error<
3249   "'cleanup' argument %select{|%1 |%1 }0is not a %select{||single }0function">;
3250 def err_attribute_cleanup_func_must_take_one_arg : Error<
3251   "'cleanup' function %0 must take 1 parameter">;
3252 def err_attribute_cleanup_func_arg_incompatible_type : Error<
3253   "'cleanup' function %0 parameter has "
3254   "%diff{type $ which is incompatible with type $|incompatible type}1,2">;
3255 def err_attribute_regparm_wrong_platform : Error<
3256   "'regparm' is not valid on this platform">;
3257 def err_attribute_regparm_invalid_number : Error<
3258   "'regparm' parameter must be between 0 and %0 inclusive">;
3259 def err_attribute_not_supported_in_lang : Error<
3260   "%0 attribute is not supported in %select{C|C++|Objective-C}1">;
3261 def err_attribute_not_supported_on_arch
3262     : Error<"%0 attribute is not supported on '%1'">;
3263
3264 // Clang-Specific Attributes
3265 def warn_attribute_iboutlet : Warning<
3266   "%0 attribute can only be applied to instance variables or properties">,
3267   InGroup<IgnoredAttributes>;
3268 def err_iboutletcollection_type : Error<
3269   "invalid type %0 as argument of iboutletcollection attribute">;
3270 def err_iboutletcollection_builtintype : Error<
3271   "type argument of iboutletcollection attribute cannot be a builtin type">;
3272 def warn_iboutlet_object_type : Warning<
3273   "%select{instance variable|property}2 with %0 attribute must "
3274   "be an object type (invalid %1)">, InGroup<ObjCInvalidIBOutletProperty>;
3275 def warn_iboutletcollection_property_assign : Warning<
3276   "IBOutletCollection properties should be copy/strong and not assign">,
3277   InGroup<ObjCInvalidIBOutletProperty>;
3278   
3279 def err_attribute_overloadable_missing : Error<
3280   "%select{overloaded function|redeclaration of}0 %1 must have the "
3281   "'overloadable' attribute">;
3282 def note_attribute_overloadable_prev_overload : Note<
3283   "previous overload of function is here">;
3284 def err_attribute_overloadable_no_prototype : Error<
3285   "'overloadable' function %0 must have a prototype">;
3286 def warn_ns_attribute_wrong_return_type : Warning<
3287   "%0 attribute only applies to %select{functions|methods|properties}1 that "
3288   "return %select{an Objective-C object|a pointer|a non-retainable pointer}2">,
3289   InGroup<IgnoredAttributes>;
3290 def err_ns_attribute_wrong_parameter_type : Error<
3291   "%0 attribute only applies to "
3292   "%select{Objective-C object|pointer|pointer-to-CF-pointer}1 parameters">;
3293 def warn_ns_attribute_wrong_parameter_type : Warning<
3294   "%0 attribute only applies to "
3295   "%select{Objective-C object|pointer|pointer-to-CF-pointer}1 parameters">,
3296   InGroup<IgnoredAttributes>;
3297 def warn_objc_requires_super_protocol : Warning<
3298   "%0 attribute cannot be applied to %select{methods in protocols|dealloc}1">,
3299   InGroup<DiagGroup<"requires-super-attribute">>;
3300 def note_protocol_decl : Note<
3301   "protocol is declared here">;
3302 def note_protocol_decl_undefined : Note<
3303   "protocol %0 has no definition">;
3304
3305 // objc_designated_initializer attribute diagnostics.
3306 def warn_objc_designated_init_missing_super_call : Warning<
3307   "designated initializer missing a 'super' call to a designated initializer of the super class">,
3308   InGroup<ObjCDesignatedInit>;
3309 def note_objc_designated_init_marked_here : Note<
3310   "method marked as designated initializer of the class here">;
3311 def warn_objc_designated_init_non_super_designated_init_call : Warning<
3312   "designated initializer should only invoke a designated initializer on 'super'">,
3313   InGroup<ObjCDesignatedInit>;
3314 def warn_objc_designated_init_non_designated_init_call : Warning<
3315   "designated initializer invoked a non-designated initializer">,
3316   InGroup<ObjCDesignatedInit>;
3317 def warn_objc_secondary_init_super_init_call : Warning<
3318   "convenience initializer should not invoke an initializer on 'super'">,
3319   InGroup<ObjCDesignatedInit>;
3320 def warn_objc_secondary_init_missing_init_call : Warning<
3321   "convenience initializer missing a 'self' call to another initializer">,
3322   InGroup<ObjCDesignatedInit>;
3323 def warn_objc_implementation_missing_designated_init_override : Warning<
3324   "method override for the designated initializer of the superclass %objcinstance0 not found">,
3325   InGroup<ObjCDesignatedInit>;
3326
3327 // objc_bridge attribute diagnostics.
3328 def err_objc_attr_not_id : Error<
3329   "parameter of %0 attribute must be a single name of an Objective-C %select{class|protocol}1">;
3330 def err_objc_attr_typedef_not_id : Error<
3331   "parameter of %0 attribute must be 'id' when used on a typedef">;
3332 def err_objc_attr_typedef_not_void_pointer : Error<
3333   "'objc_bridge(id)' is only allowed on structs and typedefs of void pointers">;
3334 def err_objc_cf_bridged_not_interface : Error<
3335   "CF object of type %0 is bridged to %1, which is not an Objective-C class">;
3336 def err_objc_ns_bridged_invalid_cfobject : Error<
3337   "ObjectiveC object of type %0 is bridged to %1, which is not valid CF object">;
3338 def warn_objc_invalid_bridge : Warning<
3339   "%0 bridges to %1, not %2">, InGroup<ObjCBridge>;
3340 def warn_objc_invalid_bridge_to_cf : Warning<
3341   "%0 cannot bridge to %1">, InGroup<ObjCBridge>;
3342
3343 // objc_bridge_related attribute diagnostics.
3344 def err_objc_bridged_related_invalid_class : Error<
3345   "could not find Objective-C class %0 to convert %1 to %2">;
3346 def err_objc_bridged_related_invalid_class_name : Error<
3347   "%0 must be name of an Objective-C class to be able to convert %1 to %2">;
3348 def err_objc_bridged_related_known_method : Error<
3349  "%0 must be explicitly converted to %1; use %select{%objcclass2|%objcinstance2}3 "
3350  "method for this conversion">;
3351
3352 def err_objc_attr_protocol_requires_definition : Error<
3353   "attribute %0 can only be applied to @protocol definitions, not forward declarations">;
3354
3355 // Function Parameter Semantic Analysis.
3356 def err_param_with_void_type : Error<"argument may not have 'void' type">;
3357 def err_void_only_param : Error<
3358   "'void' must be the first and only parameter if specified">;
3359 def err_void_param_qualified : Error<
3360   "'void' as parameter must not have type qualifiers">;
3361 def err_ident_list_in_fn_declaration : Error<
3362   "a parameter list without types is only allowed in a function definition">;
3363 def ext_param_not_declared : Extension<
3364   "parameter %0 was not declared, defaulting to type 'int'">;
3365 def err_param_default_argument : Error<
3366   "C does not support default arguments">;
3367 def err_param_default_argument_redefinition : Error<
3368   "redefinition of default argument">;
3369 def ext_param_default_argument_redefinition : ExtWarn<
3370   err_param_default_argument_redefinition.Text>,
3371   InGroup<MicrosoftDefaultArgRedefinition>;
3372 def err_param_default_argument_missing : Error<
3373   "missing default argument on parameter">;
3374 def err_param_default_argument_missing_name : Error<
3375   "missing default argument on parameter %0">;
3376 def err_param_default_argument_references_param : Error<
3377   "default argument references parameter %0">;
3378 def err_param_default_argument_references_local : Error<
3379   "default argument references local variable %0 of enclosing function">;
3380 def err_param_default_argument_references_this : Error<
3381   "default argument references 'this'">;
3382 def err_param_default_argument_nonfunc : Error<
3383   "default arguments can only be specified for parameters in a function "
3384   "declaration">;
3385 def err_param_default_argument_template_redecl : Error<
3386   "default arguments cannot be added to a function template that has already "
3387   "been declared">;
3388 def err_param_default_argument_member_template_redecl : Error<
3389   "default arguments cannot be added to an out-of-line definition of a member "
3390   "of a %select{class template|class template partial specialization|nested "
3391   "class in a template}0">;
3392 def err_param_default_argument_on_parameter_pack : Error<
3393   "parameter pack cannot have a default argument">;
3394 def err_uninitialized_member_for_assign : Error<
3395   "cannot define the implicit copy assignment operator for %0, because "
3396   "non-static %select{reference|const}1 member %2 cannot use copy "
3397   "assignment operator">;
3398 def err_uninitialized_member_in_ctor : Error<
3399   "%select{constructor for %1|"
3400   "implicit default constructor for %1|"
3401   "cannot use constructor inherited from %1:}0 must explicitly "
3402   "initialize the %select{reference|const}2 member %3">;
3403 def err_default_arg_makes_ctor_special : Error<
3404   "addition of default argument on redeclaration makes this constructor a "
3405   "%select{default|copy|move}0 constructor">;
3406
3407 def err_use_of_default_argument_to_function_declared_later : Error<
3408   "use of default argument to function %0 that is declared later in class %1">;
3409 def note_default_argument_declared_here : Note<
3410   "default argument declared here">;
3411 def err_recursive_default_argument : Error<"recursive evaluation of default argument">;
3412
3413 def ext_param_promoted_not_compatible_with_prototype : ExtWarn<
3414   "%diff{promoted type $ of K&R function parameter is not compatible with the "
3415   "parameter type $|promoted type of K&R function parameter is not compatible "
3416   "with parameter type}0,1 declared in a previous prototype">,
3417   InGroup<KNRPromotedParameter>;
3418
3419
3420 // C++ Overloading Semantic Analysis.
3421 def err_ovl_diff_return_type : Error<
3422   "functions that differ only in their return type cannot be overloaded">;
3423 def err_ovl_static_nonstatic_member : Error<
3424   "static and non-static member functions with the same parameter types "
3425   "cannot be overloaded">;
3426
3427 def err_ovl_no_viable_function_in_call : Error<
3428   "no matching function for call to %0">;
3429 def err_ovl_no_viable_member_function_in_call : Error<
3430   "no matching member function for call to %0">;
3431 def err_ovl_ambiguous_call : Error<
3432   "call to %0 is ambiguous">;
3433 def err_ovl_deleted_call : Error<
3434   "call to %select{unavailable|deleted}0 function %1%2">;
3435 def err_ovl_ambiguous_member_call : Error<
3436   "call to member function %0 is ambiguous">;
3437 def err_ovl_deleted_member_call : Error<
3438   "call to %select{unavailable|deleted}0 member function %1%2">;
3439 def note_ovl_too_many_candidates : Note<
3440     "remaining %0 candidate%s0 omitted; "
3441     "pass -fshow-overloads=all to show them">;
3442 def note_ovl_candidate : Note<"candidate "
3443     "%select{function|function|constructor|"
3444     "function |function |constructor |"
3445     "is the implicit default constructor|"
3446     "is the implicit copy constructor|"
3447     "is the implicit move constructor|"
3448     "is the implicit copy assignment operator|"
3449     "is the implicit move assignment operator|"
3450     "inherited constructor|"
3451     "inherited constructor }0%2"
3452     "%select{| has different class%diff{ (expected $ but has $)|}4,5"
3453     "| has different number of parameters (expected %4 but has %5)"
3454     "| has type mismatch at %ordinal4 parameter"
3455     "%diff{ (expected $ but has $)|}5,6"
3456     "| has different return type%diff{ ($ expected but has $)|}4,5"
3457     "| has different qualifiers (expected "
3458     "%select{none|const|restrict|const and restrict|volatile|const and volatile"
3459     "|volatile and restrict|const, volatile, and restrict}4 but found "
3460     "%select{none|const|restrict|const and restrict|volatile|const and volatile"
3461     "|volatile and restrict|const, volatile, and restrict}5)"
3462     "| has different exception specification}3">;
3463
3464 def note_ovl_candidate_inherited_constructor : Note<
3465     "constructor from base class %0 inherited here">;
3466 def note_ovl_candidate_inherited_constructor_slice : Note<
3467     "candidate %select{constructor|template}0 ignored: "
3468     "inherited constructor cannot be used to %select{copy|move}1 object">;
3469 def note_ovl_candidate_illegal_constructor : Note<
3470     "candidate %select{constructor|template}0 ignored: "
3471     "instantiation %select{takes|would take}0 its own class type by value">;
3472 def note_ovl_candidate_bad_deduction : Note<
3473     "candidate template ignored: failed template argument deduction">;
3474 def note_ovl_candidate_incomplete_deduction : Note<"candidate template ignored: "
3475     "couldn't infer template argument %0">;
3476 def note_ovl_candidate_inconsistent_deduction : Note<
3477     "candidate template ignored: deduced conflicting %select{types|values|"
3478     "templates}0 for parameter %1%diff{ ($ vs. $)|}2,3">;
3479 def note_ovl_candidate_inconsistent_deduction_types : Note<
3480     "candidate template ignored: deduced values %diff{"
3481     "of conflicting types for parameter %0 (%1 of type $ vs. %3 of type $)|"
3482     "%1 and %3 of conflicting types for parameter %0}2,4">;
3483 def note_ovl_candidate_explicit_arg_mismatch_named : Note<
3484     "candidate template ignored: invalid explicitly-specified argument "
3485     "for template parameter %0">;
3486 def note_ovl_candidate_explicit_arg_mismatch_unnamed : Note<
3487     "candidate template ignored: invalid explicitly-specified argument "
3488     "for %ordinal0 template parameter">;
3489 def note_ovl_candidate_instantiation_depth : Note<
3490     "candidate template ignored: substitution exceeded maximum template "
3491     "instantiation depth">;
3492 def note_ovl_candidate_underqualified : Note<
3493     "candidate template ignored: cannot deduce a type for %0 that would "
3494     "make %2 equal %1">;
3495 def note_ovl_candidate_substitution_failure : Note<
3496     "candidate template ignored: substitution failure%0%1">;
3497 def note_ovl_candidate_disabled_by_enable_if : Note<
3498     "candidate template ignored: disabled by %0%1">;
3499 def note_ovl_candidate_has_pass_object_size_params: Note<
3500     "candidate address cannot be taken because parameter %0 has "
3501     "pass_object_size attribute">;
3502 def err_diagnose_if_succeeded : Error<"%0">;
3503 def warn_diagnose_if_succeeded : Warning<"%0">, InGroup<UserDefinedWarnings>,
3504     ShowInSystemHeader;
3505 def note_ovl_candidate_disabled_by_function_cond_attr : Note<
3506     "candidate disabled: %0">;
3507 def note_ovl_candidate_disabled_by_extension : Note<
3508     "candidate disabled due to OpenCL extension">;
3509 def err_addrof_function_disabled_by_enable_if_attr : Error<
3510     "cannot take address of function %0 because it has one or more "
3511     "non-tautological enable_if conditions">;
3512 def note_addrof_ovl_candidate_disabled_by_enable_if_attr : Note<
3513     "candidate function made ineligible by enable_if">;
3514 def note_ovl_candidate_deduced_mismatch : Note<
3515     "candidate template ignored: deduced type "
3516     "%diff{$ of %select{|element of }4%ordinal0 parameter does not match "
3517     "adjusted type $ of %select{|element of }4argument"
3518     "|of %select{|element of }4%ordinal0 parameter does not match "
3519     "adjusted type of %select{|element of }4argument}1,2%3">;
3520 def note_ovl_candidate_non_deduced_mismatch : Note<
3521     "candidate template ignored: could not match %diff{$ against $|types}0,1">;
3522 // This note is needed because the above note would sometimes print two
3523 // different types with the same name.  Remove this note when the above note
3524 // can handle that case properly.
3525 def note_ovl_candidate_non_deduced_mismatch_qualified : Note<
3526     "candidate template ignored: could not match %q0 against %q1">;
3527
3528 // Note that we don't treat templates differently for this diagnostic.
3529 def note_ovl_candidate_arity : Note<"candidate "
3530     "%select{function|function|constructor|function|function|constructor|"
3531     "constructor (the implicit default constructor)|"
3532     "constructor (the implicit copy constructor)|"
3533     "constructor (the implicit move constructor)|"
3534     "function (the implicit copy assignment operator)|"
3535     "function (the implicit move assignment operator)|"
3536     "inherited constructor|"
3537     "inherited constructor}0 %select{|template }1"
3538     "not viable: requires%select{ at least| at most|}2 %3 argument%s3, but %4 "
3539     "%plural{1:was|:were}4 provided">;
3540
3541 def note_ovl_candidate_arity_one : Note<"candidate "
3542     "%select{function|function|constructor|function|function|constructor|"
3543     "constructor (the implicit default constructor)|"
3544     "constructor (the implicit copy constructor)|"
3545     "constructor (the implicit move constructor)|"
3546     "function (the implicit copy assignment operator)|"
3547     "function (the implicit move assignment operator)|"
3548     "inherited constructor|"
3549     "inherited constructor}0 %select{|template }1not viable: "
3550     "%select{requires at least|allows at most single|requires single}2 "
3551     "argument %3, but %plural{0:no|:%4}4 arguments were provided">;
3552
3553 def note_ovl_candidate_deleted : Note<
3554     "candidate %select{function|function|constructor|"
3555     "function |function |constructor |"
3556     "constructor (the implicit default constructor)|"
3557     "constructor (the implicit copy constructor)|"
3558     "constructor (the implicit move constructor)|"
3559     "function (the implicit copy assignment operator)|"
3560     "function (the implicit move assignment operator)|"
3561     "inherited constructor|"
3562     "inherited constructor }0%1 has been "
3563     "%select{explicitly made unavailable|explicitly deleted|"
3564     "implicitly deleted}2">;
3565
3566 // Giving the index of the bad argument really clutters this message, and
3567 // it's relatively unimportant because 1) it's generally obvious which
3568 // argument(s) are of the given object type and 2) the fix is usually
3569 // to complete the type, which doesn't involve changes to the call line
3570 // anyway.  If people complain, we can change it.
3571 def note_ovl_candidate_bad_conv_incomplete : Note<"candidate "
3572     "%select{function|function|constructor|"
3573     "function |function |constructor |"
3574     "constructor (the implicit default constructor)|"
3575     "constructor (the implicit copy constructor)|"
3576     "constructor (the implicit move constructor)|"
3577     "function (the implicit copy assignment operator)|"
3578     "function (the implicit move assignment operator)|"
3579     "inherited constructor|"
3580     "inherited constructor }0%1 "
3581     "not viable: cannot convert argument of incomplete type "
3582     "%diff{$ to $|to parameter type}2,3 for "
3583     "%select{%ordinal5 argument|object argument}4"
3584     "%select{|; dereference the argument with *|"
3585     "; take the address of the argument with &|"
3586     "; remove *|"
3587     "; remove &}6">;
3588 def note_ovl_candidate_bad_list_argument : Note<"candidate "
3589     "%select{function|function|constructor|"
3590     "function |function |constructor |"
3591     "constructor (the implicit default constructor)|"
3592     "constructor (the implicit copy constructor)|"
3593     "constructor (the implicit move constructor)|"
3594     "function (the implicit copy assignment operator)|"
3595     "function (the implicit move assignment operator)|"
3596     "inherited constructor|"
3597     "inherited constructor }0%1 "
3598     "not viable: cannot convert initializer list argument to %3">;
3599 def note_ovl_candidate_bad_overload : Note<"candidate "
3600     "%select{function|function|constructor|"
3601     "function |function |constructor |"
3602     "constructor (the implicit default constructor)|"
3603     "constructor (the implicit copy constructor)|"
3604     "constructor (the implicit move constructor)|"
3605     "function (the implicit copy assignment operator)|"
3606     "function (the implicit move assignment operator)|"
3607     "inherited constructor|"
3608     "inherited constructor }0%1"
3609     " not viable: no overload of %3 matching %2 for %ordinal4 argument">;
3610 def note_ovl_candidate_bad_conv : Note<"candidate "
3611     "%select{function|function|constructor|"
3612     "function |function |constructor |"
3613     "constructor (the implicit default constructor)|"
3614     "constructor (the implicit copy constructor)|"
3615     "constructor (the implicit move constructor)|"
3616     "function (the implicit copy assignment operator)|"
3617     "function (the implicit move assignment operator)|"
3618     "inherited constructor|"
3619     "inherited constructor }0%1"
3620     " not viable: no known conversion "
3621     "%diff{from $ to $|from argument type to parameter type}2,3 for "
3622     "%select{%ordinal5 argument|object argument}4"
3623     "%select{|; dereference the argument with *|"
3624     "; take the address of the argument with &|"
3625     "; remove *|"
3626     "; remove &}6">;
3627 def note_ovl_candidate_bad_arc_conv : Note<"candidate "
3628     "%select{function|function|constructor|"
3629     "function |function |constructor |"
3630     "constructor (the implicit default constructor)|"
3631     "constructor (the implicit copy constructor)|"
3632     "constructor (the implicit move constructor)|"
3633     "function (the implicit copy assignment operator)|"
3634     "function (the implicit move assignment operator)|"
3635     "inherited constructor|"
3636     "inherited constructor }0%1"
3637     " not viable: cannot implicitly convert argument "
3638     "%diff{of type $ to $|type to parameter type}2,3 for "
3639     "%select{%ordinal5 argument|object argument}4 under ARC">;
3640 def note_ovl_candidate_bad_lvalue : Note<"candidate "
3641     "%select{function|function|constructor|"
3642     "function |function |constructor |"
3643     "constructor (the implicit default constructor)|"
3644     "constructor (the implicit copy constructor)|"
3645     "constructor (the implicit move constructor)|"
3646     "function (the implicit copy assignment operator)|"
3647     "function (the implicit move assignment operator)|"
3648     "inherited constructor|"
3649     "inherited constructor }0%1"
3650     " not viable: expects an l-value for "
3651     "%select{%ordinal3 argument|object argument}2">;
3652 def note_ovl_candidate_bad_addrspace : Note<"candidate "
3653     "%select{function|function|constructor|"
3654     "function |function |constructor |"
3655     "constructor (the implicit default constructor)|"
3656     "constructor (the implicit copy constructor)|"
3657     "constructor (the implicit move constructor)|"
3658     "function (the implicit copy assignment operator)|"
3659     "function (the implicit move assignment operator)|"
3660     "inherited constructor|"
3661     "inherited constructor }0%1 not viable: "
3662     "%select{%ordinal6|'this'}5 argument (%2) is in "
3663     "address space %3, but parameter must be in address space %4">;
3664 def note_ovl_candidate_bad_gc : Note<"candidate "
3665     "%select{function|function|constructor|"
3666     "function |function |constructor |"
3667     "constructor (the implicit default constructor)|"
3668     "constructor (the implicit copy constructor)|"
3669     "constructor (the implicit move constructor)|"
3670     "function (the implicit copy assignment operator)|"
3671     "function (the implicit move assignment operator)|"
3672     "inherited constructor|"
3673     "inherited constructor }0%1 not viable: "
3674     "%select{%ordinal6|'this'}5 argument (%2) has %select{no|__weak|__strong}3 "
3675     "ownership, but parameter has %select{no|__weak|__strong}4 ownership">;
3676 def note_ovl_candidate_bad_ownership : Note<"candidate "
3677     "%select{function|function|constructor|"
3678     "function |function |constructor |"
3679     "constructor (the implicit default constructor)|"
3680     "constructor (the implicit copy constructor)|"
3681     "constructor (the implicit move constructor)|"
3682     "function (the implicit copy assignment operator)|"
3683     "function (the implicit move assignment operator)|"
3684     "inherited constructor|"
3685     "inherited constructor }0%1 not viable: "
3686     "%select{%ordinal6|'this'}5 argument (%2) has "
3687     "%select{no|__unsafe_unretained|__strong|__weak|__autoreleasing}3 ownership,"
3688     " but parameter has %select{no|__unsafe_unretained|__strong|__weak|"
3689     "__autoreleasing}4 ownership">;
3690 def note_ovl_candidate_bad_cvr_this : Note<"candidate "
3691     "%select{|function|||function|||||"
3692     "function (the implicit copy assignment operator)|"
3693     "function (the implicit move assignment operator)||}0 not viable: "
3694     "'this' argument has type %2, but method is not marked "
3695     "%select{const|restrict|const or restrict|volatile|const or volatile|"
3696     "volatile or restrict|const, volatile, or restrict}3">;
3697 def note_ovl_candidate_bad_cvr : Note<"candidate "
3698     "%select{function|function|constructor|"
3699     "function |function |constructor |"
3700     "constructor (the implicit default constructor)|"
3701     "constructor (the implicit copy constructor)|"
3702     "constructor (the implicit move constructor)|"
3703     "function (the implicit copy assignment operator)|"
3704     "function (the implicit move assignment operator)|"
3705     "inherited constructor|"
3706     "inherited constructor }0%1 not viable: "
3707     "%ordinal4 argument (%2) would lose "
3708     "%select{const|restrict|const and restrict|volatile|const and volatile|"
3709     "volatile and restrict|const, volatile, and restrict}3 qualifier"
3710     "%select{||s||s|s|s}3">;
3711 def note_ovl_candidate_bad_unaligned : Note<"candidate "
3712     "%select{function|function|constructor|"
3713     "function |function |constructor |"
3714     "constructor (the implicit default constructor)|"
3715     "constructor (the implicit copy constructor)|"
3716     "constructor (the implicit move constructor)|"
3717     "function (the implicit copy assignment operator)|"
3718     "function (the implicit move assignment operator)|"
3719     "inherited constructor|"
3720     "inherited constructor }0%1 not viable: "
3721     "%ordinal4 argument (%2) would lose __unaligned qualifier">;
3722 def note_ovl_candidate_bad_base_to_derived_conv : Note<"candidate "
3723     "%select{function|function|constructor|"
3724     "function |function |constructor |"
3725     "constructor (the implicit default constructor)|"
3726     "constructor (the implicit copy constructor)|"
3727     "constructor (the implicit move constructor)|"
3728     "function (the implicit copy assignment operator)|"
3729     "function (the implicit move assignment operator)|"
3730     "inherited constructor|"
3731     "inherited constructor }0%1 not viable: "
3732     "cannot %select{convert from|convert from|bind}2 "
3733     "%select{base class pointer|superclass|base class object of type}2 %3 to "
3734     "%select{derived class pointer|subclass|derived class reference}2 %4 for "
3735     "%ordinal5 argument">;
3736 def note_ovl_candidate_bad_target : Note<
3737     "candidate %select{function|function|constructor|"
3738     "function|function|constructor|"
3739     "constructor (the implicit default constructor)|"
3740     "constructor (the implicit copy constructor)|"
3741     "constructor (the implicit move constructor)|"
3742     "function (the implicit copy assignment operator)|"
3743     "function (the implicit move assignment operator)|"
3744     "inherited constructor|"
3745     "inherited constructor}0 not viable: "
3746     "call to "
3747     "%select{__device__|__global__|__host__|__host__ __device__|invalid}1 function from"
3748     " %select{__device__|__global__|__host__|__host__ __device__|invalid}2 function">;
3749 def note_implicit_member_target_infer_collision : Note<
3750     "implicit %select{"
3751     "default constructor|"
3752     "copy constructor|"
3753     "move constructor|"
3754     "copy assignment operator|"
3755     "move assignment operator|"
3756     "destructor}0 inferred target collision: call to both "
3757     "%select{__device__|__global__|__host__|__host__ __device__}1 and "
3758     "%select{__device__|__global__|__host__|__host__ __device__}2 members">;
3759
3760 def note_ambiguous_type_conversion: Note<
3761     "because of ambiguity in conversion %diff{of $ to $|between types}0,1">;
3762 def note_ovl_builtin_binary_candidate : Note<
3763     "built-in candidate %0">;
3764 def note_ovl_builtin_unary_candidate : Note<
3765     "built-in candidate %0">;
3766 def err_ovl_no_viable_function_in_init : Error<
3767   "no matching constructor for initialization of %0">;
3768 def err_ovl_no_conversion_in_cast : Error<
3769   "cannot convert %1 to %2 without a conversion operator">;
3770 def err_ovl_no_viable_conversion_in_cast : Error<
3771   "no matching conversion for %select{|static_cast|reinterpret_cast|"
3772   "dynamic_cast|C-style cast|functional-style cast}0 from %1 to %2">;
3773 def err_ovl_ambiguous_conversion_in_cast : Error<
3774   "ambiguous conversion for %select{|static_cast|reinterpret_cast|"
3775   "dynamic_cast|C-style cast|functional-style cast}0 from %1 to %2">;
3776 def err_ovl_deleted_conversion_in_cast : Error<
3777   "%select{|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
3778   "functional-style cast}0 from %1 to %2 uses deleted function">;
3779 def err_ovl_ambiguous_init : Error<"call to constructor of %0 is ambiguous">;
3780 def err_ref_init_ambiguous : Error<
3781   "reference initialization of type %0 with initializer of type %1 is ambiguous">;
3782 def err_ovl_deleted_init : Error<
3783   "call to %select{unavailable|deleted}0 constructor of %1">;
3784 def err_ovl_deleted_special_init : Error<
3785   "call to implicitly-deleted %select{default constructor|copy constructor|"
3786   "move constructor|copy assignment operator|move assignment operator|"
3787   "destructor|function}0 of %1">;
3788 def err_ovl_ambiguous_oper_unary : Error<
3789   "use of overloaded operator '%0' is ambiguous (operand type %1)">;
3790 def err_ovl_ambiguous_oper_binary : Error<
3791   "use of overloaded operator '%0' is ambiguous (with operand types %1 and %2)">;
3792 def err_ovl_no_viable_oper : Error<"no viable overloaded '%0'">;
3793 def note_assign_lhs_incomplete : Note<"type %0 is incomplete">;
3794 def err_ovl_deleted_oper : Error<
3795   "overload resolution selected %select{unavailable|deleted}0 operator '%1'%2">;
3796 def err_ovl_deleted_special_oper : Error<
3797   "object of type %0 cannot be %select{constructed|copied|moved|assigned|"
3798   "assigned|destroyed}1 because its %select{default constructor|"
3799   "copy constructor|move constructor|copy assignment operator|"
3800   "move assignment operator|destructor}1 is implicitly deleted">;
3801 def err_ovl_no_viable_subscript :
3802     Error<"no viable overloaded operator[] for type %0">;
3803 def err_ovl_no_oper :
3804     Error<"type %0 does not provide a %select{subscript|call}1 operator">;
3805 def err_ovl_unresolvable : Error<
3806   "reference to overloaded function could not be resolved; "
3807   "did you mean to call it%select{| with no arguments}0?">;
3808 def err_bound_member_function : Error<
3809   "reference to non-static member function must be called"
3810   "%select{|; did you mean to call it with no arguments?}0">;
3811 def note_possible_target_of_call : Note<"possible target for call">;
3812
3813 def err_ovl_no_viable_object_call : Error<
3814   "no matching function for call to object of type %0">;
3815 def err_ovl_ambiguous_object_call : Error<
3816   "call to object of type %0 is ambiguous">;
3817 def err_ovl_deleted_object_call : Error<
3818   "call to %select{unavailable|deleted}0 function call operator in type %1%2">;
3819 def note_ovl_surrogate_cand : Note<"conversion candidate of type %0">;
3820 def err_member_call_without_object : Error<
3821   "call to non-static member function without an object argument">;
3822
3823 // C++ Address of Overloaded Function
3824 def err_addr_ovl_no_viable : Error<
3825   "address of overloaded function %0 does not match required type %1">;
3826 def err_addr_ovl_ambiguous : Error<
3827   "address of overloaded function %0 is ambiguous">;
3828 def err_addr_ovl_not_func_ptrref : Error<
3829   "address of overloaded function %0 cannot be converted to type %1">;
3830 def err_addr_ovl_no_qualifier : Error<
3831   "cannot form member pointer of type %0 without '&' and class name">;
3832
3833 // C++11 Literal Operators
3834 def err_ovl_no_viable_literal_operator : Error<
3835   "no matching literal operator for call to %0"
3836   "%select{| with argument of type %2| with arguments of types %2 and %3}1"
3837   "%select{| or 'const char *'}4"
3838   "%select{|, and no matching literal operator template}5">;
3839
3840 // C++ Template Declarations
3841 def err_template_param_shadow : Error<
3842   "declaration of %0 shadows template parameter">;
3843 def note_template_param_here : Note<"template parameter is declared here">;
3844 def warn_template_export_unsupported : Warning<
3845   "exported templates are unsupported">;
3846 def err_template_outside_namespace_or_class_scope : Error<
3847   "templates can only be declared in namespace or class scope">;
3848 def err_template_inside_local_class : Error<
3849   "templates cannot be declared inside of a local class">;
3850 def err_template_linkage : Error<"templates must have C++ linkage">;
3851 def err_template_typedef : Error<"a typedef cannot be a template">;
3852 def err_template_unnamed_class : Error<
3853   "cannot declare a class template with no name">;
3854 def err_template_param_list_different_arity : Error<
3855   "%select{too few|too many}0 template parameters in template "
3856   "%select{|template parameter }1redeclaration">;
3857 def note_template_param_list_different_arity : Note<
3858   "%select{too few|too many}0 template parameters in template template "
3859   "argument">;
3860 def note_template_prev_declaration : Note<
3861   "previous template %select{declaration|template parameter}0 is here">;
3862 def err_template_param_different_kind : Error<
3863   "template parameter has a different kind in template "
3864   "%select{|template parameter }0redeclaration">;
3865 def note_template_param_different_kind : Note<
3866   "template parameter has a different kind in template argument">;
3867   
3868 def err_template_nontype_parm_different_type : Error<
3869   "template non-type parameter has a different type %0 in template "
3870   "%select{|template parameter }1redeclaration">;
3871
3872 def note_template_nontype_parm_different_type : Note<
3873   "template non-type parameter has a different type %0 in template argument">;
3874 def note_template_nontype_parm_prev_declaration : Note<
3875   "previous non-type template parameter with type %0 is here">;
3876 def err_template_nontype_parm_bad_type : Error<
3877   "a non-type template parameter cannot have type %0">;
3878 def warn_cxx14_compat_template_nontype_parm_auto_type : Warning<
3879   "non-type template parameters declared with %0 are incompatible with C++ "
3880   "standards before C++1z">,
3881   DefaultIgnore, InGroup<CXXPre1zCompat>;
3882 def err_template_param_default_arg_redefinition : Error<
3883   "template parameter redefines default argument">;
3884 def note_template_param_prev_default_arg : Note<
3885   "previous default template argument defined here">;
3886 def err_template_param_default_arg_missing : Error<
3887   "template parameter missing a default argument">;
3888 def ext_template_parameter_default_in_function_template : ExtWarn<
3889   "default template arguments for a function template are a C++11 extension">,
3890   InGroup<CXX11>;
3891 def warn_cxx98_compat_template_parameter_default_in_function_template : Warning<
3892   "default template arguments for a function template are incompatible with C++98">,
3893   InGroup<CXX98Compat>, DefaultIgnore;
3894 def err_template_parameter_default_template_member : Error<
3895   "cannot add a default template argument to the definition of a member of a "
3896   "class template">;
3897 def err_template_parameter_default_friend_template : Error<
3898   "default template argument not permitted on a friend template">;
3899 def err_template_template_parm_no_parms : Error<
3900   "template template parameter must have its own template parameters">;
3901
3902 def ext_variable_template : ExtWarn<"variable templates are a C++14 extension">,
3903   InGroup<CXX14>;
3904 def warn_cxx11_compat_variable_template : Warning<
3905   "variable templates are incompatible with C++ standards before C++14">,
3906   InGroup<CXXPre14Compat>, DefaultIgnore;
3907 def err_template_variable_noparams : Error<
3908   "extraneous 'template<>' in declaration of variable %0">;
3909 def err_template_member : Error<"member %0 declared as a template">;
3910 def err_template_member_noparams : Error<
3911   "extraneous 'template<>' in declaration of member %0">;
3912 def err_template_tag_noparams : Error<
3913   "extraneous 'template<>' in declaration of %0 %1">;
3914 def err_template_decl_ref : Error<
3915   "cannot refer to %select{class|variable}0 template %1 without a template argument list">;
3916
3917 // C++ Template Argument Lists
3918 def err_template_missing_args : Error<
3919   "use of "
3920   "%select{class template|function template|variable template|alias template|"
3921   "template template parameter|template}0 %1 requires template arguments">;
3922 def err_template_arg_list_different_arity : Error<
3923   "%select{too few|too many}0 template arguments for "
3924   "%select{class template|function template|variable template|alias template|"
3925   "template template parameter|template}1 %2">;
3926 def note_template_decl_here : Note<"template is declared here">;
3927 def err_template_arg_must_be_type : Error<
3928   "template argument for template type parameter must be a type">;
3929 def err_template_arg_must_be_type_suggest : Error<
3930   "template argument for template type parameter must be a type; "
3931   "did you forget 'typename'?">;
3932 def ext_ms_template_type_arg_missing_typename : ExtWarn<
3933   "template argument for template type parameter must be a type; "
3934   "omitted 'typename' is a Microsoft extension">,
3935   InGroup<MicrosoftTemplate>;
3936 def err_template_arg_must_be_expr : Error<
3937   "template argument for non-type template parameter must be an expression">;
3938 def err_template_arg_nontype_ambig : Error<
3939   "template argument for non-type template parameter is treated as function type %0">;
3940 def err_template_arg_must_be_template : Error<
3941   "template argument for template template parameter must be a class template%select{| or type alias template}0">;
3942 def ext_template_arg_local_type : ExtWarn<
3943   "template argument uses local type %0">, InGroup<LocalTypeTemplateArgs>;
3944 def ext_template_arg_unnamed_type : ExtWarn<
3945   "template argument uses unnamed type">, InGroup<UnnamedTypeTemplateArgs>;
3946 def warn_cxx98_compat_template_arg_local_type : Warning<
3947   "local type %0 as template argument is incompatible with C++98">,
3948   InGroup<CXX98CompatLocalTypeTemplateArgs>, DefaultIgnore;
3949 def warn_cxx98_compat_template_arg_unnamed_type : Warning<
3950   "unnamed type as template argument is incompatible with C++98">,
3951   InGroup<CXX98CompatUnnamedTypeTemplateArgs>, DefaultIgnore;
3952 def note_template_unnamed_type_here : Note<
3953   "unnamed type used in template argument was declared here">;
3954 def err_template_arg_overload_type : Error<
3955   "template argument is the type of an unresolved overloaded function">;
3956 def err_template_arg_not_valid_template : Error<
3957   "template argument does not refer to a class or alias template, or template "
3958   "template parameter">;
3959 def note_template_arg_refers_here_func : Note<
3960   "template argument refers to function template %0, here">;
3961 def err_template_arg_template_params_mismatch : Error<
3962   "template template argument has different template parameters than its "
3963   "corresponding template template parameter">;
3964 def err_template_arg_not_integral_or_enumeral : Error<
3965   "non-type template argument of type %0 must have an integral or enumeration"
3966   " type">;
3967 def err_template_arg_not_ice : Error<
3968   "non-type template argument of type %0 is not an integral constant "
3969   "expression">;
3970 def err_template_arg_not_address_constant : Error<
3971   "non-type template argument of type %0 is not a constant expression">;
3972 def warn_cxx98_compat_template_arg_null : Warning<
3973   "use of null pointer as non-type template argument is incompatible with "
3974   "C++98">, InGroup<CXX98Compat>, DefaultIgnore;
3975 def err_template_arg_untyped_null_constant : Error<
3976   "null non-type template argument must be cast to template parameter type %0">;
3977 def err_template_arg_wrongtype_null_constant : Error<
3978   "null non-type template argument of type %0 does not match template parameter "
3979   "of type %1">;
3980 def err_non_type_template_parm_type_deduction_failure : Error<
3981   "non-type template parameter %0 with type %1 has incompatible initializer of type %2">;
3982 def err_deduced_non_type_template_arg_type_mismatch : Error<
3983   "deduced non-type template argument does not have the same type as the "
3984   "corresponding template parameter%diff{ ($ vs $)|}0,1">;
3985 def err_non_type_template_arg_subobject : Error<
3986   "non-type template argument refers to subobject '%0'">;
3987 def err_non_type_template_arg_addr_label_diff : Error<
3988   "template argument / label address difference / what did you expect?">;
3989 def err_template_arg_not_convertible : Error<
3990   "non-type template argument of type %0 cannot be converted to a value "
3991   "of type %1">;
3992 def warn_template_arg_negative : Warning<
3993   "non-type template argument with value '%0' converted to '%1' for unsigned "
3994   "template parameter of type %2">, InGroup<Conversion>, DefaultIgnore;
3995 def warn_template_arg_too_large : Warning<
3996   "non-type template argument value '%0' truncated to '%1' for "
3997   "template parameter of type %2">, InGroup<Conversion>, DefaultIgnore;
3998 def err_template_arg_no_ref_bind : Error<
3999   "non-type template parameter of reference type "
4000   "%diff{$ cannot bind to template argument of type $"
4001   "|cannot bind to template of incompatible argument type}0,1">;
4002 def err_template_arg_ref_bind_ignores_quals : Error<
4003   "reference binding of non-type template parameter "
4004   "%diff{of type $ to template argument of type $|to template argument}0,1 "
4005   "ignores qualifiers">;
4006 def err_template_arg_not_decl_ref : Error<
4007   "non-type template argument does not refer to any declaration">;
4008 def err_template_arg_not_address_of : Error<
4009   "non-type template argument for template parameter of pointer type %0 must "
4010   "have its address taken">;
4011 def err_template_arg_address_of_non_pointer : Error<
4012   "address taken in non-type template argument for template parameter of "
4013   "reference type %0">;
4014 def err_template_arg_reference_var : Error<
4015   "non-type template argument of reference type %0 is not an object">;
4016 def err_template_arg_field : Error<
4017   "non-type template argument refers to non-static data member %0">;
4018 def err_template_arg_method : Error<
4019   "non-type template argument refers to non-static member function %0">;
4020 def err_template_arg_object_no_linkage : Error<
4021   "non-type template argument refers to %select{function|object}0 %1 that "
4022   "does not have linkage">;
4023 def warn_cxx98_compat_template_arg_object_internal : Warning<
4024   "non-type template argument referring to %select{function|object}0 %1 with "
4025   "internal linkage is incompatible with C++98">,
4026   InGroup<CXX98Compat>, DefaultIgnore;
4027 def ext_template_arg_object_internal : ExtWarn<
4028   "non-type template argument referring to %select{function|object}0 %1 with "
4029   "internal linkage is a C++11 extension">, InGroup<CXX11>;
4030 def err_template_arg_thread_local : Error<
4031   "non-type template argument refers to thread-local object">;
4032 def note_template_arg_internal_object : Note<
4033   "non-type template argument refers to %select{function|object}0 here">;
4034 def note_template_arg_refers_here : Note<
4035   "non-type template argument refers here">;
4036 def err_template_arg_not_object_or_func : Error<
4037   "non-type template argument does not refer to an object or function">;
4038 def err_template_arg_not_pointer_to_member_form : Error<
4039   "non-type template argument is not a pointer to member constant">;
4040 def err_template_arg_member_ptr_base_derived_not_supported : Error<
4041   "sorry, non-type template argument of pointer-to-member type %1 that refers "
4042   "to member %q0 of a different class is not supported yet">;
4043 def ext_template_arg_extra_parens : ExtWarn<
4044   "address non-type template argument cannot be surrounded by parentheses">;
4045 def warn_cxx98_compat_template_arg_extra_parens : Warning<
4046   "redundant parentheses surrounding address non-type template argument are "
4047   "incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
4048 def err_pointer_to_member_type : Error<
4049   "invalid use of pointer to member type after %select{.*|->*}0">;
4050 def err_pointer_to_member_call_drops_quals : Error<
4051   "call to pointer to member function of type %0 drops '%1' qualifier%s2">;
4052 def err_pointer_to_member_oper_value_classify: Error<
4053   "pointer-to-member function type %0 can only be called on an "
4054   "%select{rvalue|lvalue}1">;
4055 def ext_ms_deref_template_argument: ExtWarn<
4056   "non-type template argument containing a dereference operation is a "
4057   "Microsoft extension">, InGroup<MicrosoftTemplate>;
4058 def ext_ms_delayed_template_argument: ExtWarn<
4059   "using the undeclared type %0 as a default template argument is a "
4060   "Microsoft extension">, InGroup<MicrosoftTemplate>;
4061 def err_template_arg_deduced_incomplete_pack : Error<
4062   "deduced incomplete pack %0 for template parameter %1">;
4063
4064 // C++ template specialization
4065 def err_template_spec_unknown_kind : Error<
4066   "can only provide an explicit specialization for a class template, function "
4067   "template, variable template, or a member function, static data member, "
4068   "%select{or member class|member class, or member enumeration}0 of a "
4069   "class template">;
4070 def note_specialized_entity : Note<
4071   "explicitly specialized declaration is here">;
4072 def note_explicit_specialization_declared_here : Note<
4073   "explicit specialization declared here">;
4074 def err_template_spec_decl_function_scope : Error<
4075   "explicit specialization of %0 in function scope">;
4076 def err_template_spec_decl_class_scope : Error<
4077   "explicit specialization of %0 in class scope">;
4078 def err_template_spec_decl_friend : Error<
4079   "cannot declare an explicit specialization in a friend">;
4080 def err_template_spec_decl_out_of_scope_global : Error<
4081   "%select{class template|class template partial|variable template|"
4082   "variable template partial|function template|member function|"
4083   "static data member|member class|member enumeration}0 "
4084   "specialization of %1 must originally be declared in the global scope">;
4085 def err_template_spec_decl_out_of_scope : Error<
4086   "%select{class template|class template partial|variable template|"
4087   "variable template partial|function template|member "
4088   "function|static data member|member class|member enumeration}0 "
4089   "specialization of %1 must originally be declared in namespace %2">;
4090 def ext_template_spec_decl_out_of_scope : ExtWarn<
4091   "first declaration of %select{class template|class template partial|"
4092   "variable template|variable template partial|"
4093   "function template|member function|static data member|member class|"
4094   "member enumeration}0 specialization of %1 outside namespace %2 is a "
4095   "C++11 extension">, InGroup<CXX11>;
4096 def warn_cxx98_compat_template_spec_decl_out_of_scope : Warning<
4097   "%select{class template|class template partial|variable template|"
4098   "variable template partial|function template|member "
4099   "function|static data member|member class|member enumeration}0 "
4100   "specialization of %1 outside namespace %2 is incompatible with C++98">,
4101   InGroup<CXX98Compat>, DefaultIgnore;
4102 def err_template_spec_redecl_out_of_scope : Error<
4103   "%select{class template|class template partial|variable template|"
4104   "variable template partial|function template|member "
4105   "function|static data member|member class|member enumeration}0 "
4106   "specialization of %1 not in a namespace enclosing %2">;
4107 def ext_ms_template_spec_redecl_out_of_scope: ExtWarn<
4108   "%select{class template|class template partial|variable template|"
4109   "variable template partial|function template|member "
4110   "function|static data member|member class|member enumeration}0 "
4111   "specialization of %1 outside namespace enclosing %2 "
4112   "is a Microsoft extension">, InGroup<MicrosoftTemplate>;
4113 def err_template_spec_redecl_global_scope : Error<
4114   "%select{class template|class template partial|variable template|"
4115   "variable template partial|function template|member "
4116   "function|static data member|member class|member enumeration}0 "
4117   "specialization of %1 must occur at global scope">;
4118 def err_spec_member_not_instantiated : Error<
4119   "specialization of member %q0 does not specialize an instantiated member">;
4120 def note_specialized_decl : Note<"attempt to specialize declaration here">;
4121 def err_specialization_after_instantiation : Error<
4122   "explicit specialization of %0 after instantiation">;
4123 def note_instantiation_required_here : Note<
4124   "%select{implicit|explicit}0 instantiation first required here">;
4125 def err_template_spec_friend : Error<
4126   "template specialization declaration cannot be a friend">;
4127 def err_template_spec_default_arg : Error<
4128   "default argument not permitted on an explicit "
4129   "%select{instantiation|specialization}0 of function %1">;
4130 def err_not_class_template_specialization : Error<
4131   "cannot specialize a %select{dependent template|template template "
4132   "parameter}0">;
4133 def err_function_specialization_in_class : Error<
4134   "cannot specialize a function %0 within class scope">;
4135 def ext_function_specialization_in_class : ExtWarn<
4136   "explicit specialization of %0 within class scope is a Microsoft extension">,
4137   InGroup<MicrosoftTemplate>;
4138 def ext_explicit_specialization_storage_class : ExtWarn<
4139   "explicit specialization cannot have a storage class">;
4140 def err_explicit_specialization_inconsistent_storage_class : Error<
4141   "explicit specialization has extraneous, inconsistent storage class "
4142   "'%select{none|extern|static|__private_extern__|auto|register}0'">;
4143
4144 // C++ class template specializations and out-of-line definitions
4145 def err_template_spec_needs_header : Error<
4146   "template specialization requires 'template<>'">;
4147 def err_template_spec_needs_template_parameters : Error<
4148   "template specialization or definition requires a template parameter list "
4149   "corresponding to the nested type %0">;
4150 def err_template_param_list_matches_nontemplate : Error<
4151   "template parameter list matching the non-templated nested type %0 should "
4152   "be empty ('template<>')">;
4153 def err_alias_template_extra_headers : Error<
4154   "extraneous template parameter list in alias template declaration">;
4155 def err_template_spec_extra_headers : Error<
4156   "extraneous template parameter list in template specialization or "
4157   "out-of-line template definition">;
4158 def warn_template_spec_extra_headers : Warning<
4159   "extraneous template parameter list in template specialization">;
4160 def note_explicit_template_spec_does_not_need_header : Note<
4161   "'template<>' header not required for explicitly-specialized class %0 "
4162   "declared here">;
4163 def err_template_qualified_declarator_no_match : Error<
4164   "nested name specifier '%0' for declaration does not refer into a class, "
4165   "class template or class template partial specialization">;
4166 def err_specialize_member_of_template : Error<
4167   "cannot specialize %select{|(with 'template<>') }0a member of an "
4168   "unspecialized template">;
4169
4170 // C++ Class Template Partial Specialization
4171 def err_default_arg_in_partial_spec : Error<
4172     "default template argument in a class template partial specialization">;
4173 def err_dependent_non_type_arg_in_partial_spec : Error<
4174     "type of specialized non-type template argument depends on a template "
4175     "parameter of the partial specialization">;
4176 def note_dependent_non_type_default_arg_in_partial_spec : Note<
4177     "template parameter is used in default argument declared here">;
4178 def err_dependent_typed_non_type_arg_in_partial_spec : Error<
4179     "non-type template argument specializes a template parameter with "
4180     "dependent type %0">;
4181 def err_partial_spec_args_match_primary_template : Error<
4182     "%select{class|variable}0 template partial specialization does not "
4183     "specialize any template argument; to %select{declare|define}1 the "
4184     "primary template, remove the template argument list">; 
4185 def ext_partial_spec_not_more_specialized_than_primary : ExtWarn<
4186     "%select{class|variable}0 template partial specialization is not "
4187     "more specialized than the primary template">, DefaultError,
4188     InGroup<DiagGroup<"invalid-partial-specialization">>;
4189 def note_partial_spec_not_more_specialized_than_primary : Note<"%0">;
4190 def ext_partial_specs_not_deducible : ExtWarn<
4191     "%select{class|variable}0 template partial specialization contains "
4192     "%select{a template parameter|template parameters}1 that cannot be "
4193     "deduced; this partial specialization will never be used">,
4194     DefaultError, InGroup<DiagGroup<"unusable-partial-specialization">>;
4195 def note_non_deducible_parameter : Note<
4196     "non-deducible template parameter %0">;
4197 def err_partial_spec_ordering_ambiguous : Error<
4198     "ambiguous partial specializations of %0">;
4199 def note_partial_spec_match : Note<"partial specialization matches %0">;
4200 def err_partial_spec_redeclared : Error<
4201   "class template partial specialization %0 cannot be redeclared">;
4202 def note_partial_specialization_declared_here : Note<
4203   "explicit specialization declared here">;
4204 def note_prev_partial_spec_here : Note<
4205   "previous declaration of class template partial specialization %0 is here">;
4206 def err_partial_spec_fully_specialized : Error<
4207   "partial specialization of %0 does not use any of its template parameters">;
4208
4209 // C++ Variable Template Partial Specialization
4210 def err_var_partial_spec_redeclared : Error<
4211   "variable template partial specialization %0 cannot be redefined">;
4212 def note_var_prev_partial_spec_here : Note<
4213   "previous declaration of variable template partial specialization is here">;
4214 def err_var_spec_no_template : Error<
4215   "no variable template matches%select{| partial}0 specialization">;
4216 def err_var_spec_no_template_but_method : Error<
4217   "no variable template matches specialization; "
4218   "did you mean to use %0 as function template instead?">;
4219   
4220 // C++ Function template specializations
4221 def err_function_template_spec_no_match : Error<
4222     "no function template matches function template specialization %0">;
4223 def err_function_template_spec_ambiguous : Error<
4224     "function template specialization %0 ambiguously refers to more than one "
4225     "function template; explicitly specify%select{| additional}1 template "
4226     "arguments to identify a particular function template">;
4227 def note_function_template_spec_matched : Note<
4228     "function template %q0 matches specialization %1">;
4229 def err_function_template_partial_spec : Error<
4230     "function template partial specialization is not allowed">;
4231
4232 // C++ Template Instantiation
4233 def err_template_recursion_depth_exceeded : Error<
4234   "recursive template instantiation exceeded maximum depth of %0">,
4235   DefaultFatal, NoSFINAE;
4236 def note_template_recursion_depth : Note<
4237   "use -ftemplate-depth=N to increase recursive template instantiation depth">;
4238
4239 def err_template_instantiate_within_definition : Error<
4240   "%select{implicit|explicit}0 instantiation of template %1 within its"
4241   " own definition">;
4242 def err_template_instantiate_undefined : Error<
4243   "%select{implicit|explicit}0 instantiation of undefined template %1">;
4244 def err_implicit_instantiate_member_undefined : Error<
4245   "implicit instantiation of undefined member %0">;
4246 def note_template_class_instantiation_was_here : Note<
4247   "class template %0 was instantiated here">;
4248 def note_template_class_explicit_specialization_was_here : Note<
4249   "class template %0 was explicitly specialized here">;
4250 def note_template_class_instantiation_here : Note<
4251   "in instantiation of template class %q0 requested here">;
4252 def note_template_member_class_here : Note<
4253   "in instantiation of member class %q0 requested here">;
4254 def note_template_member_function_here : Note<
4255   "in instantiation of member function %q0 requested here">;
4256 def note_function_template_spec_here : Note<
4257   "in instantiation of function template specialization %q0 requested here">;
4258 def note_template_static_data_member_def_here : Note<
4259   "in instantiation of static data member %q0 requested here">;
4260 def note_template_variable_def_here : Note<
4261   "in instantiation of variable template specialization %q0 requested here">;
4262 def note_template_enum_def_here : Note<
4263   "in instantiation of enumeration %q0 requested here">;
4264 def note_template_nsdmi_here : Note<
4265   "in instantiation of default member initializer %q0 requested here">;
4266 def note_template_type_alias_instantiation_here : Note<
4267   "in instantiation of template type alias %0 requested here">;
4268 def note_template_exception_spec_instantiation_here : Note<
4269   "in instantiation of exception specification for %0 requested here">;
4270 def warn_var_template_missing : Warning<"instantiation of variable %q0 "
4271   "required here, but no definition is available">,
4272   InGroup<UndefinedVarTemplate>;
4273 def warn_func_template_missing : Warning<"instantiation of function %q0 "
4274   "required here, but no definition is available">,
4275   InGroup<UndefinedFuncTemplate>, DefaultIgnore;
4276 def note_forward_template_decl : Note<
4277   "forward declaration of template entity is here">;
4278 def note_inst_declaration_hint : Note<"add an explicit instantiation "
4279   "declaration to suppress this warning if %q0 is explicitly instantiated in "
4280   "another translation unit">;
4281
4282 def note_default_arg_instantiation_here : Note<
4283   "in instantiation of default argument for '%0' required here">;
4284 def note_default_function_arg_instantiation_here : Note<
4285   "in instantiation of default function argument expression "
4286   "for '%0' required here">;
4287 def note_explicit_template_arg_substitution_here : Note<
4288   "while substituting explicitly-specified template arguments into function "
4289   "template %0 %1">;
4290 def note_function_template_deduction_instantiation_here : Note<
4291   "while substituting deduced template arguments into function template %0 "
4292   "%1">;
4293 def note_deduced_template_arg_substitution_here : Note<
4294   "during template argument deduction for %select{class|variable}0 template "
4295   "%select{partial specialization |}1%2 %3">;
4296 def note_prior_template_arg_substitution : Note<
4297   "while substituting prior template arguments into %select{non-type|template}0"
4298   " template parameter%1 %2">;
4299 def note_template_default_arg_checking : Note<
4300   "while checking a default template argument used here">;
4301 def note_instantiation_contexts_suppressed : Note<
4302   "(skipping %0 context%s0 in backtrace; use -ftemplate-backtrace-limit=0 to "
4303   "see all)">;
4304
4305 def err_field_instantiates_to_function : Error<
4306   "data member instantiated with function type %0">;
4307 def err_variable_instantiates_to_function : Error<
4308   "%select{variable|static data member}0 instantiated with function type %1">;
4309 def err_nested_name_spec_non_tag : Error<
4310   "type %0 cannot be used prior to '::' because it has no members">;
4311
4312 def err_using_pack_expansion_empty : Error<
4313   "%select{|member}0 using declaration %1 instantiates to an empty pack">;
4314
4315 // C++ Explicit Instantiation
4316 def err_explicit_instantiation_duplicate : Error<
4317     "duplicate explicit instantiation of %0">;
4318 def ext_explicit_instantiation_duplicate : ExtWarn<
4319     "duplicate explicit instantiation of %0 ignored as a Microsoft extension">,
4320     InGroup<MicrosoftTemplate>;
4321 def note_previous_explicit_instantiation : Note<
4322     "previous explicit instantiation is here">;
4323 def warn_explicit_instantiation_after_specialization : Warning<
4324   "explicit instantiation of %0 that occurs after an explicit "
4325   "specialization has no effect">,
4326   InGroup<DiagGroup<"instantiation-after-specialization">>;
4327 def note_previous_template_specialization : Note<
4328     "previous template specialization is here">;
4329 def err_explicit_instantiation_nontemplate_type : Error<
4330     "explicit instantiation of non-templated type %0">;
4331 def note_nontemplate_decl_here : Note<
4332     "non-templated declaration is here">;
4333 def err_explicit_instantiation_in_class : Error<
4334   "explicit instantiation of %0 in class scope">;
4335 def err_explicit_instantiation_out_of_scope : Error<
4336   "explicit instantiation of %0 not in a namespace enclosing %1">;
4337 def err_explicit_instantiation_must_be_global : Error<
4338   "explicit instantiation of %0 must occur at global scope">;
4339 def warn_explicit_instantiation_out_of_scope_0x : Warning<
4340   "explicit instantiation of %0 not in a namespace enclosing %1">, 
4341   InGroup<CXX11Compat>, DefaultIgnore;
4342 def warn_explicit_instantiation_must_be_global_0x : Warning<
4343   "explicit instantiation of %0 must occur at global scope">, 
4344   InGroup<CXX11Compat>, DefaultIgnore;
4345   
4346 def err_explicit_instantiation_requires_name : Error<
4347   "explicit instantiation declaration requires a name">;
4348 def err_explicit_instantiation_of_typedef : Error<
4349   "explicit instantiation of typedef %0">;
4350 def err_explicit_instantiation_storage_class : Error<
4351   "explicit instantiation cannot have a storage class">;
4352 def err_explicit_instantiation_not_known : Error<
4353   "explicit instantiation of %0 does not refer to a function template, "
4354   "variable template, member function, member class, or static data member">;
4355 def note_explicit_instantiation_here : Note<
4356   "explicit instantiation refers here">;
4357 def err_explicit_instantiation_data_member_not_instantiated : Error<
4358   "explicit instantiation refers to static data member %q0 that is not an "
4359   "instantiation">;
4360 def err_explicit_instantiation_member_function_not_instantiated : Error<
4361   "explicit instantiation refers to member function %q0 that is not an "
4362   "instantiation">;
4363 def err_explicit_instantiation_ambiguous : Error<
4364   "partial ordering for explicit instantiation of %0 is ambiguous">;
4365 def note_explicit_instantiation_candidate : Note<
4366   "explicit instantiation candidate function %q0 template here %1">;
4367 def err_explicit_instantiation_inline : Error<
4368   "explicit instantiation cannot be 'inline'">;
4369 def warn_explicit_instantiation_inline_0x : Warning<
4370   "explicit instantiation cannot be 'inline'">, InGroup<CXX11Compat>,
4371   DefaultIgnore;
4372 def err_explicit_instantiation_constexpr : Error<
4373   "explicit instantiation cannot be 'constexpr'">;
4374 def ext_explicit_instantiation_without_qualified_id : Extension<
4375   "qualifier in explicit instantiation of %q0 requires a template-id "
4376   "(a typedef is not permitted)">;
4377 def err_explicit_instantiation_without_template_id : Error<
4378   "explicit instantiation of %q0 must specify a template argument list">;
4379 def err_explicit_instantiation_unqualified_wrong_namespace : Error<
4380   "explicit instantiation of %q0 must occur in namespace %1">;
4381 def warn_explicit_instantiation_unqualified_wrong_namespace_0x : Warning<
4382   "explicit instantiation of %q0 must occur in namespace %1">,
4383   InGroup<CXX11Compat>, DefaultIgnore;
4384 def err_explicit_instantiation_undefined_member : Error<
4385   "explicit instantiation of undefined %select{member class|member function|"
4386   "static data member}0 %1 of class template %2">;
4387 def err_explicit_instantiation_undefined_func_template : Error<
4388   "explicit instantiation of undefined function template %0">;
4389 def err_explicit_instantiation_undefined_var_template : Error<
4390   "explicit instantiation of undefined variable template %q0">;
4391 def err_explicit_instantiation_declaration_after_definition : Error<
4392   "explicit instantiation declaration (with 'extern') follows explicit "
4393   "instantiation definition (without 'extern')">;
4394 def note_explicit_instantiation_definition_here : Note<
4395   "explicit instantiation definition is here">;
4396 def err_invalid_var_template_spec_type : Error<"type %2 "
4397   "of %select{explicit instantiation|explicit specialization|"
4398   "partial specialization|redeclaration}0 of %1 does not match"
4399   " expected type %3">;
4400 def err_mismatched_exception_spec_explicit_instantiation : Error<
4401   "exception specification in explicit instantiation does not match "
4402   "instantiated one">;
4403 def ext_mismatched_exception_spec_explicit_instantiation : ExtWarn<
4404   err_mismatched_exception_spec_explicit_instantiation.Text>,
4405   InGroup<MicrosoftExceptionSpec>;
4406   
4407 // C++ typename-specifiers
4408 def err_typename_nested_not_found : Error<"no type named %0 in %1">;
4409 def err_typename_nested_not_found_enable_if : Error<
4410   "no type named 'type' in %0; 'enable_if' cannot be used to disable "
4411   "this declaration">;
4412 def err_typename_nested_not_type : Error<
4413     "typename specifier refers to non-type member %0 in %1">;
4414 def note_typename_refers_here : Note<
4415     "referenced member %0 is declared here">;
4416 def err_typename_missing : Error<
4417   "missing 'typename' prior to dependent type name '%0%1'">;
4418 def err_typename_missing_template : Error<
4419   "missing 'typename' prior to dependent type template name '%0%1'">;
4420 def ext_typename_missing : ExtWarn<
4421   "missing 'typename' prior to dependent type name '%0%1'">,
4422   InGroup<DiagGroup<"typename-missing">>;
4423 def ext_typename_outside_of_template : ExtWarn<
4424   "'typename' occurs outside of a template">, InGroup<CXX11>;
4425 def warn_cxx98_compat_typename_outside_of_template : Warning<
4426   "use of 'typename' outside of a template is incompatible with C++98">,
4427   InGroup<CXX98Compat>, DefaultIgnore;
4428 def err_typename_refers_to_using_value_decl : Error<
4429   "typename specifier refers to a dependent using declaration for a value "
4430   "%0 in %1">;
4431 def note_using_value_decl_missing_typename : Note<
4432   "add 'typename' to treat this using declaration as a type">;
4433
4434 def err_template_kw_refers_to_non_template : Error<
4435   "%0 following the 'template' keyword does not refer to a template">;
4436 def err_template_kw_refers_to_class_template : Error<
4437   "'%0%1' instantiated to a class template, not a function template">;
4438 def note_referenced_class_template : Note<
4439   "class template declared here">;
4440 def err_template_kw_missing : Error<
4441   "missing 'template' keyword prior to dependent template name '%0%1'">;
4442 def ext_template_outside_of_template : ExtWarn<
4443   "'template' keyword outside of a template">, InGroup<CXX11>;
4444 def warn_cxx98_compat_template_outside_of_template : Warning<
4445   "use of 'template' keyword outside of a template is incompatible with C++98">,
4446   InGroup<CXX98Compat>, DefaultIgnore;
4447
4448 def err_non_type_template_in_nested_name_specifier : Error<
4449   "qualified name refers into a specialization of %select{function|variable}0 "
4450   "template %1">;
4451 def err_template_id_not_a_type : Error<
4452   "template name refers to non-type template %0">;
4453 def note_template_declared_here : Note<
4454   "%select{function template|class template|variable template"
4455   "|type alias template|template template parameter}0 "
4456   "%1 declared here">;
4457 def err_alias_template_expansion_into_fixed_list : Error<
4458   "pack expansion used as argument for non-pack parameter of alias template">;
4459 def note_parameter_type : Note<
4460   "parameter of type %0 is declared here">;
4461
4462 // C++11 Variadic Templates
4463 def err_template_param_pack_default_arg : Error<
4464   "template parameter pack cannot have a default argument">;
4465 def err_template_param_pack_must_be_last_template_parameter : Error<
4466   "template parameter pack must be the last template parameter">;
4467
4468 def err_template_parameter_pack_non_pack : Error<
4469   "%select{template type|non-type template|template template}0 parameter"
4470   "%select{| pack}1 conflicts with previous %select{template type|"
4471   "non-type template|template template}0 parameter%select{ pack|}1">;
4472 def note_template_parameter_pack_non_pack : Note<
4473   "%select{template type|non-type template|template template}0 parameter"
4474   "%select{| pack}1 does not match %select{template type|non-type template"
4475   "|template template}0 parameter%select{ pack|}1 in template argument">;
4476 def note_template_parameter_pack_here : Note<
4477   "previous %select{template type|non-type template|template template}0 "
4478   "parameter%select{| pack}1 declared here">;
4479   
4480 def err_unexpanded_parameter_pack : Error<
4481   "%select{expression|base type|declaration type|data member type|bit-field "
4482   "size|static assertion|fixed underlying type|enumerator value|"
4483   "using declaration|friend declaration|qualifier|initializer|default argument|"
4484   "non-type template parameter type|exception type|partial specialization|"
4485   "__if_exists name|__if_not_exists name|lambda|block}0 contains"
4486   "%plural{0: an|:}1 unexpanded parameter pack"
4487   "%plural{0:|1: %2|2:s %2 and %3|:s %2, %3, ...}1">;
4488
4489 def err_pack_expansion_without_parameter_packs : Error<
4490   "pack expansion does not contain any unexpanded parameter packs">;
4491 def err_pack_expansion_length_conflict : Error<
4492   "pack expansion contains parameter packs %0 and %1 that have different "
4493   "lengths (%2 vs. %3)">;
4494 def err_pack_expansion_length_conflict_multilevel : Error<
4495   "pack expansion contains parameter pack %0 that has a different "
4496   "length (%1 vs. %2) from outer parameter packs">;
4497 def err_pack_expansion_member_init : Error<
4498   "pack expansion for initialization of member %0">;
4499
4500 def err_function_parameter_pack_without_parameter_packs : Error<
4501   "type %0 of function parameter pack does not contain any unexpanded "
4502   "parameter packs">;
4503 def err_ellipsis_in_declarator_not_parameter : Error<
4504   "only function and template parameters can be parameter packs">;
4505
4506 def err_sizeof_pack_no_pack_name : Error<
4507   "%0 does not refer to the name of a parameter pack">;
4508
4509 def err_fold_expression_packs_both_sides : Error<
4510   "binary fold expression has unexpanded parameter packs in both operands">;
4511 def err_fold_expression_empty : Error<
4512   "unary fold expression has empty expansion for operator '%0' "
4513   "with no fallback value">;
4514 def err_fold_expression_bad_operand : Error<
4515   "expression not permitted as operand of fold expression">;
4516
4517 def err_unexpected_typedef : Error<
4518   "unexpected type name %0: expected expression">;
4519 def err_unexpected_namespace : Error<
4520   "unexpected namespace name %0: expected expression">;
4521 def err_undeclared_var_use : Error<"use of undeclared identifier %0">;
4522 def ext_undeclared_unqual_id_with_dependent_base : ExtWarn<
4523   "use of undeclared identifier %0; "
4524   "unqualified lookup into dependent bases of class template %1 is a Microsoft extension">,
4525   InGroup<MicrosoftTemplate>;
4526 def ext_found_via_dependent_bases_lookup : ExtWarn<"use of identifier %0 "
4527   "found via unqualified lookup into dependent bases of class templates is a "
4528   "Microsoft extension">, InGroup<MicrosoftTemplate>;
4529 def note_dependent_var_use : Note<"must qualify identifier to find this "
4530     "declaration in dependent base class">;
4531 def err_not_found_by_two_phase_lookup : Error<"call to function %0 that is neither "
4532     "visible in the template definition nor found by argument-dependent lookup">;
4533 def note_not_found_by_two_phase_lookup : Note<"%0 should be declared prior to the "
4534     "call site%select{| or in %2| or in an associated namespace of one of its arguments}1">;
4535 def err_undeclared_use : Error<"use of undeclared %0">;
4536 def warn_deprecated : Warning<"%0 is deprecated">,
4537     InGroup<DeprecatedDeclarations>;
4538 def note_from_diagnose_if : Note<"from 'diagnose_if' attribute on %0:">;
4539 def warn_property_method_deprecated :
4540     Warning<"property access is using %0 method which is deprecated">,
4541     InGroup<DeprecatedDeclarations>;
4542 def warn_deprecated_message : Warning<"%0 is deprecated: %1">,
4543     InGroup<DeprecatedDeclarations>;
4544 def warn_deprecated_anonymous_namespace : Warning<
4545   "'deprecated' attribute on anonymous namespace ignored">,
4546   InGroup<IgnoredAttributes>;
4547 def warn_deprecated_fwdclass_message : Warning<
4548     "%0 may be deprecated because the receiver type is unknown">,
4549     InGroup<DeprecatedDeclarations>;
4550 def warn_deprecated_def : Warning<
4551     "Implementing deprecated %select{method|class|category}0">,
4552     InGroup<DeprecatedImplementations>, DefaultIgnore;
4553 def err_unavailable : Error<"%0 is unavailable">;
4554 def err_property_method_unavailable :
4555     Error<"property access is using %0 method which is unavailable">;
4556 def err_unavailable_message : Error<"%0 is unavailable: %1">;
4557 def warn_unavailable_fwdclass_message : Warning<
4558     "%0 may be unavailable because the receiver type is unknown">,
4559     InGroup<UnavailableDeclarations>;
4560 def note_availability_specified_here : Note<
4561   "%0 has been explicitly marked "
4562   "%select{unavailable|deleted|deprecated|partial}1 here">;
4563 def note_implicitly_deleted : Note<
4564   "explicitly defaulted function was implicitly deleted here">;
4565 def warn_not_enough_argument : Warning<
4566   "not enough variable arguments in %0 declaration to fit a sentinel">,
4567   InGroup<Sentinel>;
4568 def warn_missing_sentinel : Warning <
4569   "missing sentinel in %select{function call|method dispatch|block call}0">,
4570   InGroup<Sentinel>;
4571 def note_sentinel_here : Note<
4572   "%select{function|method|block}0 has been explicitly marked sentinel here">;
4573 def warn_missing_prototype : Warning<
4574   "no previous prototype for function %0">,
4575   InGroup<DiagGroup<"missing-prototypes">>, DefaultIgnore;
4576 def note_declaration_not_a_prototype : Note<
4577   "this declaration is not a prototype; add 'void' to make it a prototype for a zero-parameter function">; 
4578 def warn_strict_prototypes : Warning<
4579   "this %select{function declaration is not|"
4580   "old-style function definition is not preceded by}0 a prototype">,
4581   InGroup<DiagGroup<"strict-prototypes">>, DefaultIgnore;
4582 def warn_missing_variable_declarations : Warning<
4583   "no previous extern declaration for non-static variable %0">,
4584   InGroup<DiagGroup<"missing-variable-declarations">>, DefaultIgnore;
4585 def err_static_data_member_reinitialization :
4586   Error<"static data member %0 already has an initializer">;
4587 def err_redefinition : Error<"redefinition of %0">;
4588 def err_alias_after_tentative :
4589   Error<"alias definition of %0 after tentative definition">;
4590 def err_alias_is_definition :
4591   Error<"definition %0 cannot also be an %select{alias|ifunc}1">;
4592 def err_definition_of_implicitly_declared_member : Error<
4593   "definition of implicitly declared %select{default constructor|copy "
4594   "constructor|move constructor|copy assignment operator|move assignment "
4595   "operator|destructor|function}1">;
4596 def err_definition_of_explicitly_defaulted_member : Error<
4597   "definition of explicitly defaulted %select{default constructor|copy "
4598   "constructor|move constructor|copy assignment operator|move assignment "
4599   "operator|destructor|function}0">;
4600 def err_redefinition_extern_inline : Error<
4601   "redefinition of a 'extern inline' function %0 is not supported in "
4602   "%select{C99 mode|C++}1">;
4603 def warn_attr_abi_tag_namespace : Warning<
4604   "'abi_tag' attribute on %select{non-inline|anonymous}0 namespace ignored">,
4605   InGroup<IgnoredAttributes>;
4606 def err_abi_tag_on_redeclaration : Error<
4607   "cannot add 'abi_tag' attribute in a redeclaration">;
4608 def err_new_abi_tag_on_redeclaration : Error<
4609   "'abi_tag' %0 missing in original declaration">;
4610
4611 def note_deleted_dtor_no_operator_delete : Note<
4612   "virtual destructor requires an unambiguous, accessible 'operator delete'">;
4613 def note_deleted_special_member_class_subobject : Note<
4614   "%select{default constructor of|copy constructor of|move constructor of|"
4615   "copy assignment operator of|move assignment operator of|destructor of|"
4616   "constructor inherited by}0 "
4617   "%1 is implicitly deleted because "
4618   "%select{base class %3|%select{||||variant }4field %3}2 has "
4619   "%select{no|a deleted|multiple|an inaccessible|a non-trivial}4 "
4620   "%select{%select{default constructor|copy constructor|move constructor|copy "
4621   "assignment operator|move assignment operator|destructor|"
4622   "%select{default|corresponding|default|default|default}4 constructor}0|"
4623   "destructor}5"
4624   "%select{||s||}4">;
4625 def note_deleted_default_ctor_uninit_field : Note<
4626   "%select{default constructor of|constructor inherited by}0 "
4627   "%1 is implicitly deleted because field %2 of "
4628   "%select{reference|const-qualified}4 type %3 would not be initialized">;
4629 def note_deleted_default_ctor_all_const : Note<
4630   "%select{default constructor of|constructor inherited by}0 "
4631   "%1 is implicitly deleted because all "
4632   "%select{data members|data members of an anonymous union member}2"
4633   " are const-qualified">;
4634 def note_deleted_copy_ctor_rvalue_reference : Note<
4635   "copy constructor of %0 is implicitly deleted because field %1 is of "
4636   "rvalue reference type %2">;
4637 def note_deleted_copy_user_declared_move : Note<
4638   "copy %select{constructor|assignment operator}0 is implicitly deleted because"
4639   " %1 has a user-declared move %select{constructor|assignment operator}2">;
4640 def note_deleted_assign_field : Note<
4641   "%select{copy|move}0 assignment operator of %1 is implicitly deleted "
4642   "because field %2 is of %select{reference|const-qualified}4 type %3">;
4643
4644 // These should be errors.
4645 def warn_undefined_internal : Warning<
4646   "%select{function|variable}0 %q1 has internal linkage but is not defined">,
4647   InGroup<DiagGroup<"undefined-internal">>;
4648 def warn_undefined_inline : Warning<"inline function %q0 is not defined">,
4649   InGroup<DiagGroup<"undefined-inline">>;
4650 def err_undefined_inline_var : Error<"inline variable %q0 is not defined">;
4651 def note_used_here : Note<"used here">;
4652
4653 def err_internal_linkage_redeclaration : Error<
4654   "'internal_linkage' attribute does not appear on the first declaration of %0">;
4655 def warn_internal_linkage_local_storage : Warning<
4656   "'internal_linkage' attribute on a non-static local variable is ignored">,
4657   InGroup<IgnoredAttributes>;
4658
4659 def ext_internal_in_extern_inline : ExtWarn<
4660   "static %select{function|variable}0 %1 is used in an inline function with "
4661   "external linkage">, InGroup<StaticInInline>;
4662 def ext_internal_in_extern_inline_quiet : Extension<
4663   "static %select{function|variable}0 %1 is used in an inline function with "
4664   "external linkage">, InGroup<StaticInInline>;
4665 def warn_static_local_in_extern_inline : Warning<
4666   "non-constant static local variable in inline function may be different "
4667   "in different files">, InGroup<StaticLocalInInline>;
4668 def note_convert_inline_to_static : Note<
4669   "use 'static' to give inline function %0 internal linkage">;
4670
4671 def ext_redefinition_of_typedef : ExtWarn<
4672   "redefinition of typedef %0 is a C11 feature">,
4673   InGroup<DiagGroup<"typedef-redefinition"> >;
4674 def err_redefinition_variably_modified_typedef : Error<
4675   "redefinition of %select{typedef|type alias}0 for variably-modified type %1">;
4676
4677 def err_inline_decl_follows_def : Error<
4678   "inline declaration of %0 follows non-inline definition">;
4679 def err_inline_declaration_block_scope : Error<
4680   "inline declaration of %0 not allowed in block scope">;
4681 def err_static_non_static : Error<
4682   "static declaration of %0 follows non-static declaration">;
4683 def err_different_language_linkage : Error<
4684   "declaration of %0 has a different language linkage">;
4685 def ext_retained_language_linkage : Extension<
4686   "friend function %0 retaining previous language linkage is an extension">,
4687   InGroup<DiagGroup<"retained-language-linkage">>;
4688 def err_extern_c_global_conflict : Error<
4689   "declaration of %1 %select{with C language linkage|in global scope}0 "
4690   "conflicts with declaration %select{in global scope|with C language linkage}0">;
4691 def note_extern_c_global_conflict : Note<
4692   "declared %select{in global scope|with C language linkage}0 here">;
4693 def note_extern_c_begins_here : Note<
4694   "extern \"C\" language linkage specification begins here">;
4695 def warn_weak_import : Warning <
4696   "an already-declared variable is made a weak_import declaration %0">;
4697 def ext_static_non_static : Extension<
4698   "redeclaring non-static %0 as static is a Microsoft extension">,
4699   InGroup<MicrosoftRedeclareStatic>;
4700 def err_non_static_static : Error<
4701   "non-static declaration of %0 follows static declaration">;
4702 def err_extern_non_extern : Error<
4703   "extern declaration of %0 follows non-extern declaration">;
4704 def err_non_extern_extern : Error<
4705   "non-extern declaration of %0 follows extern declaration">;
4706 def err_non_thread_thread : Error<
4707   "non-thread-local declaration of %0 follows thread-local declaration">;
4708 def err_thread_non_thread : Error<
4709   "thread-local declaration of %0 follows non-thread-local declaration">;
4710 def err_thread_thread_different_kind : Error<
4711   "thread-local declaration of %0 with %select{static|dynamic}1 initialization "
4712   "follows declaration with %select{dynamic|static}1 initialization">;
4713 def err_redefinition_different_type : Error<
4714   "redefinition of %0 with a different type%diff{: $ vs $|}1,2">;
4715 def err_redefinition_different_kind : Error<
4716   "redefinition of %0 as different kind of symbol">;
4717 def err_redefinition_different_namespace_alias : Error<
4718   "redefinition of %0 as an alias for a different namespace">;
4719 def note_previous_namespace_alias : Note<
4720   "previously defined as an alias for %0">;
4721 def warn_forward_class_redefinition : Warning<
4722   "redefinition of forward class %0 of a typedef name of an object type is ignored">,
4723   InGroup<DiagGroup<"objc-forward-class-redefinition">>;
4724 def err_redefinition_different_typedef : Error<
4725   "%select{typedef|type alias|type alias template}0 "
4726   "redefinition with different types%diff{ ($ vs $)|}1,2">;
4727 def err_tag_reference_non_tag : Error<
4728   "%select{non-struct type|non-class type|non-union type|non-enum "
4729   "type|typedef|type alias|template|type alias template|template "
4730   "template argument}1 %0 cannot be referenced with a "
4731   "%select{struct|interface|union|class|enum}2 specifier">;
4732 def err_tag_reference_conflict : Error<
4733   "implicit declaration introduced by elaborated type conflicts with a "
4734   "%select{non-struct type|non-class type|non-union type|non-enum "
4735   "type|typedef|type alias|template|type alias template|template "
4736   "template argument}0 of the same name">;
4737 def err_dependent_tag_decl : Error<
4738   "%select{declaration|definition}0 of "
4739   "%select{struct|interface|union|class|enum}1 in a dependent scope">;
4740 def err_tag_definition_of_typedef : Error<
4741   "definition of type %0 conflicts with %select{typedef|type alias}1 of the same name">;
4742 def err_conflicting_types : Error<"conflicting types for %0">;
4743 def err_different_pass_object_size_params : Error<
4744   "conflicting pass_object_size attributes on parameters">;
4745 def err_late_asm_label_name : Error<
4746   "cannot apply asm label to %select{variable|function}0 after its first use">;
4747 def err_different_asm_label : Error<"conflicting asm label">;
4748 def err_nested_redefinition : Error<"nested redefinition of %0">;
4749 def err_use_with_wrong_tag : Error<
4750   "use of %0 with tag type that does not match previous declaration">;
4751 def warn_struct_class_tag_mismatch : Warning<
4752     "%select{struct|interface|class}0%select{| template}1 %2 was previously "
4753     "declared as a %select{struct|interface|class}3%select{| template}1">,
4754     InGroup<MismatchedTags>, DefaultIgnore;
4755 def warn_struct_class_previous_tag_mismatch : Warning<
4756     "%2 defined as %select{a struct|an interface|a class}0%select{| template}1 "
4757     "here but previously declared as "
4758     "%select{a struct|an interface|a class}3%select{| template}1">,
4759      InGroup<MismatchedTags>, DefaultIgnore;
4760 def note_struct_class_suggestion : Note<
4761     "did you mean %select{struct|interface|class}0 here?">;
4762 def ext_forward_ref_enum : Extension<
4763   "ISO C forbids forward references to 'enum' types">;
4764 def err_forward_ref_enum : Error<
4765   "ISO C++ forbids forward references to 'enum' types">;
4766 def ext_ms_forward_ref_enum : ExtWarn<
4767   "forward references to 'enum' types are a Microsoft extension">,
4768   InGroup<MicrosoftEnumForwardReference>;
4769 def ext_forward_ref_enum_def : Extension<
4770   "redeclaration of already-defined enum %0 is a GNU extension">,
4771   InGroup<GNURedeclaredEnum>;
4772   
4773 def err_redefinition_of_enumerator : Error<"redefinition of enumerator %0">;
4774 def err_duplicate_member : Error<"duplicate member %0">;
4775 def err_misplaced_ivar : Error<
4776   "instance variables may not be placed in %select{categories|class extension}0">;
4777 def warn_ivars_in_interface : Warning<
4778   "declaration of instance variables in the interface is deprecated">,
4779   InGroup<DiagGroup<"objc-interface-ivars">>, DefaultIgnore;
4780 def ext_enum_value_not_int : Extension<
4781   "ISO C restricts enumerator values to range of 'int' (%0 is too "
4782   "%select{small|large}1)">;
4783 def ext_enum_too_large : ExtWarn<
4784   "enumeration values exceed range of largest integer">, InGroup<EnumTooLarge>;
4785 def ext_enumerator_increment_too_large : ExtWarn<
4786   "incremented enumerator value %0 is not representable in the "
4787   "largest integer type">, InGroup<EnumTooLarge>;
4788 def warn_flag_enum_constant_out_of_range : Warning<
4789   "enumeration value %0 is out of range of flags in enumeration type %1">,
4790   InGroup<FlagEnum>;
4791   
4792 def warn_illegal_constant_array_size : Extension<
4793   "size of static array must be an integer constant expression">;
4794 def err_vm_decl_in_file_scope : Error<
4795   "variably modified type declaration not allowed at file scope">;
4796 def err_vm_decl_has_extern_linkage : Error<
4797   "variably modified type declaration cannot have 'extern' linkage">;
4798 def err_typecheck_field_variable_size : Error<
4799   "fields must have a constant size: 'variable length array in structure' "
4800   "extension will never be supported">;
4801 def err_vm_func_decl : Error<
4802   "function declaration cannot have variably modified type">;
4803 def err_array_too_large : Error<
4804   "array is too large (%0 elements)">;
4805
4806 // -Wpadded, -Wpacked
4807 def warn_padded_struct_field : Warning<
4808   "padding %select{struct|interface|class}0 %1 with %2 "
4809   "%select{byte|bit}3%s2 to align %4">,
4810   InGroup<Padded>, DefaultIgnore;
4811 def warn_padded_struct_anon_field : Warning<
4812   "padding %select{struct|interface|class}0 %1 with %2 "
4813   "%select{byte|bit}3%s2 to align anonymous bit-field">,
4814   InGroup<Padded>, DefaultIgnore;
4815 def warn_padded_struct_size : Warning<
4816   "padding size of %0 with %1 %select{byte|bit}2%s1 to alignment boundary">,
4817   InGroup<Padded>, DefaultIgnore;
4818 def warn_unnecessary_packed : Warning<
4819   "packed attribute is unnecessary for %0">, InGroup<Packed>, DefaultIgnore;
4820
4821 def err_typecheck_negative_array_size : Error<"array size is negative">;
4822 def warn_typecheck_function_qualifiers_ignored : Warning<
4823   "'%0' qualifier on function type %1 has no effect">,
4824   InGroup<IgnoredQualifiers>;
4825 def warn_typecheck_function_qualifiers_unspecified : Warning<
4826   "'%0' qualifier on function type %1 has unspecified behavior">;
4827 def warn_typecheck_reference_qualifiers : Warning<
4828   "'%0' qualifier on reference type %1 has no effect">,
4829   InGroup<IgnoredQualifiers>;
4830 def err_typecheck_invalid_restrict_not_pointer : Error<
4831   "restrict requires a pointer or reference (%0 is invalid)">;
4832 def err_typecheck_invalid_restrict_not_pointer_noarg : Error<
4833   "restrict requires a pointer or reference">;
4834 def err_typecheck_invalid_restrict_invalid_pointee : Error<
4835   "pointer to function type %0 may not be 'restrict' qualified">;
4836 def ext_typecheck_zero_array_size : Extension<
4837   "zero size arrays are an extension">, InGroup<ZeroLengthArray>;
4838 def err_typecheck_zero_array_size : Error<
4839   "zero-length arrays are not permitted in C++">;
4840 def warn_typecheck_zero_static_array_size : Warning<
4841   "'static' has no effect on zero-length arrays">,
4842   InGroup<ArrayBounds>;
4843 def err_array_size_non_int : Error<"size of array has non-integer type %0">;
4844 def err_init_element_not_constant : Error<
4845   "initializer element is not a compile-time constant">;
4846 def ext_aggregate_init_not_constant : Extension<
4847   "initializer for aggregate is not a compile-time constant">, InGroup<C99>;
4848 def err_local_cant_init : Error<
4849   "'__local' variable cannot have an initializer">;
4850 def err_block_extern_cant_init : Error<
4851   "'extern' variable cannot have an initializer">;
4852 def warn_extern_init : Warning<"'extern' variable has an initializer">,
4853   InGroup<DiagGroup<"extern-initializer">>;
4854 def err_variable_object_no_init : Error<
4855   "variable-sized object may not be initialized">;
4856 def err_excess_initializers : Error<
4857   "excess elements in %select{array|vector|scalar|union|struct}0 initializer">;
4858 def ext_excess_initializers : ExtWarn<
4859   "excess elements in %select{array|vector|scalar|union|struct}0 initializer">;
4860 def err_excess_initializers_in_char_array_initializer : Error<
4861   "excess elements in char array initializer">;
4862 def ext_excess_initializers_in_char_array_initializer : ExtWarn<
4863   "excess elements in char array initializer">;
4864 def err_initializer_string_for_char_array_too_long : Error<
4865   "initializer-string for char array is too long">;
4866 def ext_initializer_string_for_char_array_too_long : ExtWarn<
4867   "initializer-string for char array is too long">;
4868 def warn_missing_field_initializers : Warning<
4869   "missing field %0 initializer">,
4870   InGroup<MissingFieldInitializers>, DefaultIgnore;
4871 def warn_braces_around_scalar_init : Warning<
4872   "braces around scalar initializer">, InGroup<DiagGroup<"braced-scalar-init">>;
4873 def ext_many_braces_around_scalar_init : ExtWarn<
4874   "too many braces around scalar initializer">,
4875   InGroup<DiagGroup<"many-braces-around-scalar-init">>;
4876 def ext_complex_component_init : Extension<
4877   "complex initialization specifying real and imaginary components "
4878   "is an extension">, InGroup<DiagGroup<"complex-component-init">>;
4879 def err_empty_scalar_initializer : Error<"scalar initializer cannot be empty">;
4880 def warn_cxx98_compat_empty_scalar_initializer : Warning<
4881   "scalar initialized from empty initializer list is incompatible with C++98">,
4882   InGroup<CXX98Compat>, DefaultIgnore;
4883 def warn_cxx98_compat_reference_list_init : Warning<
4884   "reference initialized from initializer list is incompatible with C++98">,
4885   InGroup<CXX98Compat>, DefaultIgnore;
4886 def warn_cxx98_compat_initializer_list_init : Warning<
4887   "initialization of initializer_list object is incompatible with C++98">,
4888   InGroup<CXX98Compat>, DefaultIgnore;
4889 def warn_cxx98_compat_ctor_list_init : Warning<
4890   "constructor call from initializer list is incompatible with C++98">,
4891   InGroup<CXX98Compat>, DefaultIgnore;
4892 def err_illegal_initializer : Error<
4893   "illegal initializer (only variables can be initialized)">;
4894 def err_illegal_initializer_type : Error<"illegal initializer type %0">;
4895 def ext_init_list_type_narrowing : ExtWarn<
4896   "type %0 cannot be narrowed to %1 in initializer list">, 
4897   InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
4898 def ext_init_list_variable_narrowing : ExtWarn<
4899   "non-constant-expression cannot be narrowed from type %0 to %1 in "
4900   "initializer list">, InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
4901 def ext_init_list_constant_narrowing : ExtWarn<
4902   "constant expression evaluates to %0 which cannot be narrowed to type %1">,
4903   InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
4904 def warn_init_list_type_narrowing : Warning<
4905   "type %0 cannot be narrowed to %1 in initializer list in C++11">,
4906   InGroup<CXX11Narrowing>, DefaultIgnore;
4907 def warn_init_list_variable_narrowing : Warning<
4908   "non-constant-expression cannot be narrowed from type %0 to %1 in "
4909   "initializer list in C++11">,
4910   InGroup<CXX11Narrowing>, DefaultIgnore;
4911 def warn_init_list_constant_narrowing : Warning<
4912   "constant expression evaluates to %0 which cannot be narrowed to type %1 in "
4913   "C++11">,
4914   InGroup<CXX11Narrowing>, DefaultIgnore;
4915 def note_init_list_narrowing_silence : Note<
4916   "insert an explicit cast to silence this issue">;
4917 def err_init_objc_class : Error<
4918   "cannot initialize Objective-C class type %0">;
4919 def err_implicit_empty_initializer : Error<
4920   "initializer for aggregate with no elements requires explicit braces">;
4921 def err_bitfield_has_negative_width : Error<
4922   "bit-field %0 has negative width (%1)">;
4923 def err_anon_bitfield_has_negative_width : Error<
4924   "anonymous bit-field has negative width (%0)">;
4925 def err_bitfield_has_zero_width : Error<"named bit-field %0 has zero width">;
4926 def err_bitfield_width_exceeds_type_width : Error<
4927   "width of bit-field %0 (%1 bits) exceeds %select{width|size}2 "
4928   "of its type (%3 bit%s3)">;
4929 def err_anon_bitfield_width_exceeds_type_width : Error<
4930   "width of anonymous bit-field (%0 bits) exceeds %select{width|size}1 "
4931   "of its type (%2 bit%s2)">;
4932 def err_incorrect_number_of_vector_initializers : Error<
4933   "number of elements must be either one or match the size of the vector">;
4934
4935 // Used by C++ which allows bit-fields that are wider than the type.
4936 def warn_bitfield_width_exceeds_type_width: Warning<
4937   "width of bit-field %0 (%1 bits) exceeds the width of its type; value will "
4938   "be truncated to %2 bit%s2">, InGroup<BitFieldWidth>;
4939 def warn_anon_bitfield_width_exceeds_type_width : Warning<
4940   "width of anonymous bit-field (%0 bits) exceeds width of its type; value "
4941   "will be truncated to %1 bit%s1">, InGroup<BitFieldWidth>;
4942 def warn_bitfield_too_small_for_enum : Warning<
4943   "bit-field %0 is not wide enough to store all enumerators of %1">,
4944   InGroup<BitFieldEnumConversion>, DefaultIgnore;
4945 def note_widen_bitfield : Note<
4946   "widen this field to %0 bits to store all values of %1">;
4947 def warn_unsigned_bitfield_assigned_signed_enum : Warning<
4948   "assigning value of signed enum type %1 to unsigned bit-field %0; "
4949   "negative enumerators of enum %1 will be converted to positive values">,
4950   InGroup<BitFieldEnumConversion>, DefaultIgnore;
4951 def warn_signed_bitfield_enum_conversion : Warning<
4952   "signed bit-field %0 needs an extra bit to represent the largest positive "
4953   "enumerators of %1">,
4954   InGroup<BitFieldEnumConversion>, DefaultIgnore;
4955 def note_change_bitfield_sign : Note<
4956   "consider making the bitfield type %select{unsigned|signed}0">;
4957
4958 def warn_missing_braces : Warning<
4959   "suggest braces around initialization of subobject">,
4960   InGroup<MissingBraces>, DefaultIgnore;
4961
4962 def err_redefinition_of_label : Error<"redefinition of label %0">;
4963 def err_undeclared_label_use : Error<"use of undeclared label %0">;
4964 def err_goto_ms_asm_label : Error<
4965   "cannot jump from this goto statement to label %0 inside an inline assembly block">;
4966 def note_goto_ms_asm_label : Note<
4967   "inline assembly label %0 declared here">;
4968 def warn_unused_label : Warning<"unused label %0">,
4969   InGroup<UnusedLabel>, DefaultIgnore;
4970
4971 def err_goto_into_protected_scope : Error<
4972   "cannot jump from this goto statement to its label">;
4973 def ext_goto_into_protected_scope : ExtWarn<
4974   "jump from this goto statement to its label is a Microsoft extension">,
4975   InGroup<MicrosoftGoto>;
4976 def warn_cxx98_compat_goto_into_protected_scope : Warning<
4977   "jump from this goto statement to its label is incompatible with C++98">,
4978   InGroup<CXX98Compat>, DefaultIgnore;
4979 def err_switch_into_protected_scope : Error<
4980   "cannot jump from switch statement to this case label">;
4981 def warn_cxx98_compat_switch_into_protected_scope : Warning<
4982   "jump from switch statement to this case label is incompatible with C++98">,
4983   InGroup<CXX98Compat>, DefaultIgnore;
4984 def err_indirect_goto_without_addrlabel : Error<
4985   "indirect goto in function with no address-of-label expressions">;
4986 def err_indirect_goto_in_protected_scope : Error<
4987   "cannot jump from this indirect goto statement to one of its possible targets">;
4988 def warn_cxx98_compat_indirect_goto_in_protected_scope : Warning<
4989   "jump from this indirect goto statement to one of its possible targets "
4990   "is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
4991 def note_indirect_goto_target : Note<
4992   "possible target of indirect goto statement">;
4993 def note_protected_by_variable_init : Note<
4994   "jump bypasses variable initialization">;
4995 def note_protected_by_variable_nontriv_destructor : Note<
4996   "jump bypasses variable with a non-trivial destructor">;
4997 def note_protected_by_variable_non_pod : Note<
4998   "jump bypasses initialization of non-POD variable">;
4999 def note_protected_by_cleanup : Note<
5000   "jump bypasses initialization of variable with __attribute__((cleanup))">;
5001 def note_protected_by_vla_typedef : Note<
5002   "jump bypasses initialization of VLA typedef">;
5003 def note_protected_by_vla_type_alias : Note<
5004   "jump bypasses initialization of VLA type alias">;
5005 def note_protected_by_constexpr_if : Note<
5006   "jump enters controlled statement of constexpr if">;
5007 def note_protected_by_if_available : Note<
5008   "jump enters controlled statement of if available">;
5009 def note_protected_by_vla : Note<
5010   "jump bypasses initialization of variable length array">;
5011 def note_protected_by_objc_fast_enumeration : Note<
5012   "jump enters Objective-C fast enumeration loop">;
5013 def note_protected_by_objc_try : Note<
5014   "jump bypasses initialization of @try block">;
5015 def note_protected_by_objc_catch : Note<
5016   "jump bypasses initialization of @catch block">;
5017 def note_protected_by_objc_finally : Note<
5018   "jump bypasses initialization of @finally block">;
5019 def note_protected_by_objc_synchronized : Note<
5020   "jump bypasses initialization of @synchronized block">;
5021 def note_protected_by_objc_autoreleasepool : Note<
5022   "jump bypasses auto release push of @autoreleasepool block">;
5023 def note_protected_by_cxx_try : Note<
5024   "jump bypasses initialization of try block">;
5025 def note_protected_by_cxx_catch : Note<
5026   "jump bypasses initialization of catch block">;
5027 def note_protected_by_seh_try : Note<
5028   "jump bypasses initialization of __try block">;
5029 def note_protected_by_seh_except : Note<
5030   "jump bypasses initialization of __except block">;
5031 def note_protected_by_seh_finally : Note<
5032   "jump bypasses initialization of __finally block">;
5033 def note_protected_by___block : Note<
5034   "jump bypasses setup of __block variable">;
5035 def note_protected_by_objc_strong_init : Note<
5036   "jump bypasses initialization of __strong variable">;
5037 def note_protected_by_objc_weak_init : Note<
5038   "jump bypasses initialization of __weak variable">;
5039 def note_enters_block_captures_cxx_obj : Note<
5040   "jump enters lifetime of block which captures a destructible C++ object">;
5041 def note_enters_block_captures_strong : Note<
5042   "jump enters lifetime of block which strongly captures a variable">;
5043 def note_enters_block_captures_weak : Note<
5044   "jump enters lifetime of block which weakly captures a variable">;
5045
5046 def note_exits_cleanup : Note<
5047   "jump exits scope of variable with __attribute__((cleanup))">;
5048 def note_exits_dtor : Note<
5049   "jump exits scope of variable with non-trivial destructor">;
5050 def note_exits_temporary_dtor : Note<
5051   "jump exits scope of lifetime-extended temporary with non-trivial "
5052   "destructor">;
5053 def note_exits___block : Note<
5054   "jump exits scope of __block variable">;
5055 def note_exits_objc_try : Note<
5056   "jump exits @try block">;
5057 def note_exits_objc_catch : Note<
5058   "jump exits @catch block">;
5059 def note_exits_objc_finally : Note<
5060   "jump exits @finally block">;
5061 def note_exits_objc_synchronized : Note<
5062   "jump exits @synchronized block">;
5063 def note_exits_cxx_try : Note<
5064   "jump exits try block">;
5065 def note_exits_cxx_catch : Note<
5066   "jump exits catch block">;
5067 def note_exits_seh_try : Note<
5068   "jump exits __try block">;
5069 def note_exits_seh_except : Note<
5070   "jump exits __except block">;
5071 def note_exits_seh_finally : Note<
5072   "jump exits __finally block">;
5073 def note_exits_objc_autoreleasepool : Note<
5074   "jump exits autoreleasepool block">;
5075 def note_exits_objc_strong : Note<
5076   "jump exits scope of __strong variable">;
5077 def note_exits_objc_weak : Note<
5078   "jump exits scope of __weak variable">;
5079 def note_exits_block_captures_cxx_obj : Note<
5080   "jump exits lifetime of block which captures a destructible C++ object">;
5081 def note_exits_block_captures_strong : Note<
5082   "jump exits lifetime of block which strongly captures a variable">;
5083 def note_exits_block_captures_weak : Note<
5084   "jump exits lifetime of block which weakly captures a variable">;
5085
5086 def err_func_returning_qualified_void : ExtWarn<
5087   "function cannot return qualified void type %0">,
5088   InGroup<DiagGroup<"qualified-void-return-type">>;
5089 def err_func_returning_array_function : Error<
5090   "function cannot return %select{array|function}0 type %1">;
5091 def err_field_declared_as_function : Error<"field %0 declared as a function">;
5092 def err_field_incomplete : Error<"field has incomplete type %0">;
5093 def ext_variable_sized_type_in_struct : ExtWarn<
5094   "field %0 with variable sized type %1 not at the end of a struct or class is"
5095   " a GNU extension">, InGroup<GNUVariableSizedTypeNotAtEnd>;
5096
5097 def ext_c99_flexible_array_member : Extension<
5098   "flexible array members are a C99 feature">, InGroup<C99>;
5099 def err_flexible_array_virtual_base : Error<
5100   "flexible array member %0 not allowed in "
5101   "%select{struct|interface|union|class|enum}1 which has a virtual base class">;
5102 def err_flexible_array_empty_aggregate : Error<
5103   "flexible array member %0 not allowed in otherwise empty "
5104   "%select{struct|interface|union|class|enum}1">;
5105 def err_flexible_array_has_nontrivial_dtor : Error<
5106   "flexible array member %0 of type %1 with non-trivial destruction">;
5107 def ext_flexible_array_in_struct : Extension<
5108   "%0 may not be nested in a struct due to flexible array member">,
5109   InGroup<FlexibleArrayExtensions>;
5110 def ext_flexible_array_in_array : Extension<
5111   "%0 may not be used as an array element due to flexible array member">,
5112   InGroup<FlexibleArrayExtensions>;
5113 def err_flexible_array_init : Error<
5114   "initialization of flexible array member is not allowed">;
5115 def ext_flexible_array_empty_aggregate_ms : Extension<
5116   "flexible array member %0 in otherwise empty "
5117   "%select{struct|interface|union|class|enum}1 is a Microsoft extension">,
5118   InGroup<MicrosoftFlexibleArray>;
5119 def err_flexible_array_union : Error<
5120   "flexible array member %0 in a union is not allowed">;
5121 def ext_flexible_array_union_ms : Extension<
5122   "flexible array member %0 in a union is a Microsoft extension">,
5123   InGroup<MicrosoftFlexibleArray>;
5124 def ext_flexible_array_empty_aggregate_gnu : Extension<
5125   "flexible array member %0 in otherwise empty "
5126   "%select{struct|interface|union|class|enum}1 is a GNU extension">,
5127   InGroup<GNUEmptyStruct>;
5128 def ext_flexible_array_union_gnu : Extension<
5129   "flexible array member %0 in a union is a GNU extension">, InGroup<GNUFlexibleArrayUnionMember>;
5130
5131 let CategoryName = "ARC Semantic Issue" in {
5132
5133 // ARC-mode diagnostics.
5134
5135 let CategoryName = "ARC Weak References" in {
5136
5137 def err_arc_weak_no_runtime : Error<
5138   "cannot create __weak reference because the current deployment target "
5139   "does not support weak references">;
5140 def err_arc_weak_disabled : Error<
5141   "cannot create __weak reference in file using manual reference counting">;
5142 def err_synthesizing_arc_weak_property_disabled : Error<
5143   "cannot synthesize weak property in file using manual reference counting">;
5144 def err_synthesizing_arc_weak_property_no_runtime : Error<
5145   "cannot synthesize weak property because the current deployment target "
5146   "does not support weak references">;
5147 def err_arc_unsupported_weak_class : Error<
5148   "class is incompatible with __weak references">;
5149 def err_arc_weak_unavailable_assign : Error<
5150   "assignment of a weak-unavailable object to a __weak object">;
5151 def err_arc_weak_unavailable_property : Error<
5152   "synthesizing __weak instance variable of type %0, which does not "
5153   "support weak references">;
5154 def note_implemented_by_class : Note<
5155   "when implemented by class %0">;
5156 def err_arc_convesion_of_weak_unavailable : Error<
5157   "%select{implicit conversion|cast}0 of weak-unavailable object of type %1 to"
5158   " a __weak object of type %2">;
5159
5160 } // end "ARC Weak References" category
5161
5162 let CategoryName = "ARC Restrictions" in {
5163
5164 def err_unavailable_in_arc : Error<
5165   "%0 is unavailable in ARC">;
5166 def note_arc_forbidden_type : Note<
5167   "declaration uses type that is ill-formed in ARC">;
5168 def note_performs_forbidden_arc_conversion : Note<
5169   "inline function performs a conversion which is forbidden in ARC">;
5170 def note_arc_init_returns_unrelated : Note<
5171   "init method must return a type related to its receiver type">;
5172 def note_arc_weak_disabled : Note<
5173   "declaration uses __weak, but ARC is disabled">;
5174 def note_arc_weak_no_runtime : Note<"declaration uses __weak, which "
5175   "the current deployment target does not support">;
5176 def note_arc_field_with_ownership : Note<
5177   "field has non-trivial ownership qualification">;
5178
5179 def err_arc_illegal_explicit_message : Error<
5180   "ARC forbids explicit message send of %0">;
5181 def err_arc_unused_init_message : Error<
5182   "the result of a delegate init call must be immediately returned "
5183   "or assigned to 'self'">;
5184 def err_arc_mismatched_cast : Error<
5185   "%select{implicit conversion|cast}0 of "
5186   "%select{%2|a non-Objective-C pointer type %2|a block pointer|"
5187   "an Objective-C pointer|an indirect pointer to an Objective-C pointer}1"
5188   " to %3 is disallowed with ARC">;
5189 def err_arc_nolifetime_behavior : Error<
5190   "explicit ownership qualifier on cast result has no effect">;
5191 def err_arc_objc_object_in_tag : Error<
5192   "ARC forbids %select{Objective-C objects|blocks}0 in "
5193   "%select{struct|interface|union|<<ERROR>>|enum}1">;
5194 def err_arc_objc_property_default_assign_on_object : Error<
5195   "ARC forbids synthesizing a property of an Objective-C object "
5196   "with unspecified ownership or storage attribute">;
5197 def err_arc_illegal_selector : Error<
5198   "ARC forbids use of %0 in a @selector">;
5199 def err_arc_illegal_method_def : Error<
5200   "ARC forbids %select{implementation|synthesis}0 of %1">;
5201 def warn_arc_strong_pointer_objc_pointer : Warning<
5202   "method parameter of type %0 with no explicit ownership">,
5203   InGroup<DiagGroup<"explicit-ownership-type">>, DefaultIgnore;
5204   
5205 } // end "ARC Restrictions" category
5206   
5207 def err_arc_lost_method_convention : Error<
5208   "method was declared as %select{an 'alloc'|a 'copy'|an 'init'|a 'new'}0 "
5209   "method, but its implementation doesn't match because %select{"
5210   "its result type is not an object pointer|"
5211   "its result type is unrelated to its receiver type}1">;
5212 def note_arc_lost_method_convention : Note<"declaration in interface">;
5213 def err_arc_gained_method_convention : Error<
5214   "method implementation does not match its declaration">;
5215 def note_arc_gained_method_convention : Note<
5216   "declaration in interface is not in the '%select{alloc|copy|init|new}0' "
5217   "family because %select{its result type is not an object pointer|"
5218   "its result type is unrelated to its receiver type}1">;
5219 def err_typecheck_arc_assign_self : Error<
5220   "cannot assign to 'self' outside of a method in the init family">;
5221 def err_typecheck_arc_assign_self_class_method : Error<
5222   "cannot assign to 'self' in a class method">;
5223 def err_typecheck_arr_assign_enumeration : Error<
5224   "fast enumeration variables cannot be modified in ARC by default; "
5225   "declare the variable __strong to allow this">;
5226 def warn_arc_retained_assign : Warning<
5227   "assigning retained object to %select{weak|unsafe_unretained}0 "
5228   "%select{property|variable}1"
5229   "; object will be released after assignment">,
5230   InGroup<ARCUnsafeRetainedAssign>;
5231 def warn_arc_retained_property_assign : Warning<
5232   "assigning retained object to unsafe property"
5233   "; object will be released after assignment">,
5234   InGroup<ARCUnsafeRetainedAssign>;
5235 def warn_arc_literal_assign : Warning<
5236   "assigning %select{array literal|dictionary literal|numeric literal|boxed expression|<should not happen>|block literal}0"
5237   " to a weak %select{property|variable}1"
5238   "; object will be released after assignment">,
5239   InGroup<ARCUnsafeRetainedAssign>;
5240 def err_arc_new_array_without_ownership : Error<
5241   "'new' cannot allocate an array of %0 with no explicit ownership">;
5242 def err_arc_autoreleasing_var : Error<
5243   "%select{__block variables|global variables|fields|instance variables}0 cannot have "
5244   "__autoreleasing ownership">;
5245 def err_arc_autoreleasing_capture : Error<
5246   "cannot capture __autoreleasing variable in a "
5247   "%select{block|lambda by copy}0">;
5248 def err_arc_thread_ownership : Error<
5249   "thread-local variable has non-trivial ownership: type is %0">;
5250 def err_arc_indirect_no_ownership : Error<
5251   "%select{pointer|reference}1 to non-const type %0 with no explicit ownership">;
5252 def err_arc_array_param_no_ownership : Error<
5253   "must explicitly describe intended ownership of an object array parameter">;
5254 def err_arc_pseudo_dtor_inconstant_quals : Error<
5255   "pseudo-destructor destroys object of type %0 with inconsistently-qualified "
5256   "type %1">;
5257 def err_arc_init_method_unrelated_result_type : Error<
5258   "init methods must return a type related to the receiver type">;
5259 def err_arc_nonlocal_writeback : Error<
5260   "passing address of %select{non-local|non-scalar}0 object to "
5261   "__autoreleasing parameter for write-back">;
5262 def err_arc_method_not_found : Error<
5263   "no known %select{instance|class}1 method for selector %0">;
5264 def err_arc_receiver_forward_class : Error<
5265   "receiver %0 for class message is a forward declaration">;
5266 def err_arc_may_not_respond : Error<
5267   "no visible @interface for %0 declares the selector %1">;
5268 def err_arc_receiver_forward_instance : Error<
5269   "receiver type %0 for instance message is a forward declaration">;
5270 def warn_receiver_forward_instance : Warning<
5271   "receiver type %0 for instance message is a forward declaration">,
5272   InGroup<ForwardClassReceiver>, DefaultIgnore;
5273 def err_arc_collection_forward : Error<
5274   "collection expression type %0 is a forward declaration">;
5275 def err_arc_multiple_method_decl : Error< 
5276   "multiple methods named %0 found with mismatched result, "
5277   "parameter type or attributes">;
5278 def warn_arc_lifetime_result_type : Warning<
5279   "ARC %select{unused|__unsafe_unretained|__strong|__weak|__autoreleasing}0 "
5280   "lifetime qualifier on return type is ignored">,
5281   InGroup<IgnoredQualifiers>;
5282
5283 let CategoryName = "ARC Retain Cycle" in {
5284
5285 def warn_arc_retain_cycle : Warning<
5286   "capturing %0 strongly in this block is likely to lead to a retain cycle">,
5287   InGroup<ARCRetainCycles>;
5288 def note_arc_retain_cycle_owner : Note<
5289   "block will be retained by %select{the captured object|an object strongly "
5290   "retained by the captured object}0">;
5291
5292 } // end "ARC Retain Cycle" category
5293
5294 def warn_arc_object_memaccess : Warning<
5295   "%select{destination for|source of}0 this %1 call is a pointer to "
5296   "ownership-qualified type %2">, InGroup<ARCNonPodMemAccess>;
5297
5298 let CategoryName = "ARC and @properties" in {
5299
5300 def err_arc_strong_property_ownership : Error<
5301   "existing instance variable %1 for strong property %0 may not be "
5302   "%select{|__unsafe_unretained||__weak}2">;
5303 def err_arc_assign_property_ownership : Error<
5304   "existing instance variable %1 for property %0 with %select{unsafe_unretained|assign}2 "
5305   "attribute must be __unsafe_unretained">;
5306 def err_arc_inconsistent_property_ownership : Error<
5307   "%select{|unsafe_unretained|strong|weak}1 property %0 may not also be "
5308   "declared %select{|__unsafe_unretained|__strong|__weak|__autoreleasing}2">;
5309
5310 } // end "ARC and @properties" category
5311
5312 def warn_block_capture_autoreleasing : Warning<
5313   "block captures an autoreleasing out-parameter, which may result in "
5314   "use-after-free bugs">,
5315   InGroup<BlockCaptureAutoReleasing>;
5316 def note_declare_parameter_autoreleasing : Note<
5317   "declare the parameter __autoreleasing explicitly to suppress this warning">;
5318 def note_declare_parameter_strong : Note<
5319   "declare the parameter __strong or capture a __block __strong variable to "
5320   "keep values alive across autorelease pools">;
5321
5322 def err_arc_atomic_ownership : Error<
5323   "cannot perform atomic operation on a pointer to type %0: type has "
5324   "non-trivial ownership">;
5325
5326 let CategoryName = "ARC Casting Rules" in {
5327
5328 def err_arc_bridge_cast_incompatible : Error<
5329   "incompatible types casting %0 to %1 with a %select{__bridge|"
5330   "__bridge_transfer|__bridge_retained}2 cast">;
5331 def err_arc_bridge_cast_wrong_kind : Error<
5332   "cast of %select{Objective-C|block|C}0 pointer type %1 to "
5333   "%select{Objective-C|block|C}2 pointer type %3 cannot use %select{__bridge|"
5334   "__bridge_transfer|__bridge_retained}4">;
5335 def err_arc_cast_requires_bridge : Error<
5336   "%select{cast|implicit conversion}0 of %select{Objective-C|block|C}1 "
5337   "pointer type %2 to %select{Objective-C|block|C}3 pointer type %4 "
5338   "requires a bridged cast">;
5339 def note_arc_bridge : Note<
5340   "use __bridge to convert directly (no change in ownership)">;
5341 def note_arc_cstyle_bridge : Note<
5342   "use __bridge with C-style cast to convert directly (no change in ownership)">;
5343 def note_arc_bridge_transfer : Note<
5344   "use %select{__bridge_transfer|CFBridgingRelease call}1 to transfer "
5345   "ownership of a +1 %0 into ARC">;
5346 def note_arc_cstyle_bridge_transfer : Note<
5347   "use __bridge_transfer with C-style cast to transfer "
5348   "ownership of a +1 %0 into ARC">;
5349 def note_arc_bridge_retained : Note<
5350   "use %select{__bridge_retained|CFBridgingRetain call}1 to make an "
5351   "ARC object available as a +1 %0">;
5352 def note_arc_cstyle_bridge_retained : Note<
5353   "use __bridge_retained with C-style cast to make an "
5354   "ARC object available as a +1 %0">;
5355
5356 } // ARC Casting category
5357
5358 } // ARC category name
5359
5360 def err_flexible_array_init_needs_braces : Error<
5361   "flexible array requires brace-enclosed initializer">;
5362 def err_illegal_decl_array_of_functions : Error<
5363   "'%0' declared as array of functions of type %1">;
5364 def err_illegal_decl_array_incomplete_type : Error<
5365   "array has incomplete element type %0">;
5366 def err_illegal_message_expr_incomplete_type : Error<
5367   "Objective-C message has incomplete result type %0">;
5368 def err_illegal_decl_array_of_references : Error<
5369   "'%0' declared as array of references of type %1">;
5370 def err_decl_negative_array_size : Error<
5371   "'%0' declared as an array with a negative size">;
5372 def err_array_static_outside_prototype : Error<
5373   "%0 used in array declarator outside of function prototype">;
5374 def err_array_static_not_outermost : Error<
5375   "%0 used in non-outermost array type derivation">;
5376 def err_array_star_outside_prototype : Error<
5377   "star modifier used outside of function prototype">;
5378 def err_illegal_decl_pointer_to_reference : Error<
5379   "'%0' declared as a pointer to a reference of type %1">;
5380 def err_illegal_decl_mempointer_to_reference : Error<
5381   "'%0' declared as a member pointer to a reference of type %1">;
5382 def err_illegal_decl_mempointer_to_void : Error<
5383   "'%0' declared as a member pointer to void">;
5384 def err_illegal_decl_mempointer_in_nonclass : Error<
5385   "'%0' does not point into a class">;
5386 def err_mempointer_in_nonclass_type : Error<
5387   "member pointer refers into non-class type %0">;
5388 def err_reference_to_void : Error<"cannot form a reference to 'void'">;
5389 def err_nonfunction_block_type : Error<
5390   "block pointer to non-function type is invalid">;
5391 def err_return_block_has_expr : Error<"void block should not return a value">;
5392 def err_block_return_missing_expr : Error<
5393   "non-void block should return a value">;
5394 def err_func_def_incomplete_result : Error<
5395   "incomplete result type %0 in function definition">;
5396 def err_atomic_specifier_bad_type : Error<
5397   "_Atomic cannot be applied to "
5398   "%select{incomplete |array |function |reference |atomic |qualified |}0type "
5399   "%1 %select{||||||which is not trivially copyable}0">;
5400
5401 // Expressions.
5402 def ext_sizeof_alignof_function_type : Extension<
5403   "invalid application of '%select{sizeof|alignof|vec_step}0' to a "
5404   "function type">, InGroup<PointerArith>;
5405 def ext_sizeof_alignof_void_type : Extension<
5406   "invalid application of '%select{sizeof|alignof|vec_step}0' to a void "
5407   "type">, InGroup<PointerArith>;
5408 def err_opencl_sizeof_alignof_type : Error<
5409   "invalid application of '%select{sizeof|alignof|vec_step|__builtin_omp_required_simd_align}0' to a void type">;
5410 def err_sizeof_alignof_incomplete_type : Error<
5411   "invalid application of '%select{sizeof|alignof|vec_step|__builtin_omp_required_simd_align}0' to an "
5412   "incomplete type %1">;
5413 def err_sizeof_alignof_function_type : Error<
5414   "invalid application of '%select{sizeof|alignof|vec_step|__builtin_omp_required_simd_align}0' to a "
5415   "function type">;
5416 def err_openmp_default_simd_align_expr : Error<
5417   "invalid application of '__builtin_omp_required_simd_align' to an expression, only type is allowed">;
5418 def err_sizeof_alignof_typeof_bitfield : Error<
5419   "invalid application of '%select{sizeof|alignof|typeof}0' to bit-field">;
5420 def err_alignof_member_of_incomplete_type : Error<
5421   "invalid application of 'alignof' to a field of a class still being defined">;
5422 def err_vecstep_non_scalar_vector_type : Error<
5423   "'vec_step' requires built-in scalar or vector type, %0 invalid">;
5424 def err_offsetof_incomplete_type : Error<
5425   "offsetof of incomplete type %0">;
5426 def err_offsetof_record_type : Error<
5427   "offsetof requires struct, union, or class type, %0 invalid">;
5428 def err_offsetof_array_type : Error<"offsetof requires array type, %0 invalid">;
5429 def ext_offsetof_extended_field_designator : Extension<
5430   "using extended field designator is an extension">,
5431   InGroup<DiagGroup<"extended-offsetof">>;
5432 def ext_offsetof_non_pod_type : ExtWarn<"offset of on non-POD type %0">,
5433   InGroup<InvalidOffsetof>;
5434 def ext_offsetof_non_standardlayout_type : ExtWarn<
5435   "offset of on non-standard-layout type %0">, InGroup<InvalidOffsetof>;
5436 def err_offsetof_bitfield : Error<"cannot compute offset of bit-field %0">;
5437 def err_offsetof_field_of_virtual_base : Error<
5438   "invalid application of 'offsetof' to a field of a virtual base">;
5439 def warn_sub_ptr_zero_size_types : Warning<
5440   "subtraction of pointers to type %0 of zero size has undefined behavior">,
5441   InGroup<PointerArith>;
5442
5443 def warn_floatingpoint_eq : Warning<
5444   "comparing floating point with == or != is unsafe">,
5445   InGroup<DiagGroup<"float-equal">>, DefaultIgnore;
5446
5447 def warn_remainder_division_by_zero : Warning<
5448   "%select{remainder|division}0 by zero is undefined">,
5449   InGroup<DivZero>;
5450 def warn_shift_lhs_negative : Warning<"shifting a negative signed value is undefined">,
5451   InGroup<DiagGroup<"shift-negative-value">>;
5452 def warn_shift_negative : Warning<"shift count is negative">,
5453   InGroup<DiagGroup<"shift-count-negative">>;
5454 def warn_shift_gt_typewidth : Warning<"shift count >= width of type">,
5455   InGroup<DiagGroup<"shift-count-overflow">>;
5456 def warn_shift_result_gt_typewidth : Warning<
5457   "signed shift result (%0) requires %1 bits to represent, but %2 only has "
5458   "%3 bits">, InGroup<DiagGroup<"shift-overflow">>;
5459 def warn_shift_result_sets_sign_bit : Warning<
5460   "signed shift result (%0) sets the sign bit of the shift expression's "
5461   "type (%1) and becomes negative">,
5462   InGroup<DiagGroup<"shift-sign-overflow">>, DefaultIgnore;
5463
5464 def warn_precedence_bitwise_rel : Warning<
5465   "%0 has lower precedence than %1; %1 will be evaluated first">,
5466   InGroup<Parentheses>;
5467 def note_precedence_bitwise_first : Note<
5468   "place parentheses around the %0 expression to evaluate it first">;
5469 def note_precedence_silence : Note<
5470   "place parentheses around the '%0' expression to silence this warning">;
5471
5472 def warn_precedence_conditional : Warning<
5473   "operator '?:' has lower precedence than '%0'; '%0' will be evaluated first">,
5474   InGroup<Parentheses>;
5475 def note_precedence_conditional_first : Note<
5476   "place parentheses around the '?:' expression to evaluate it first">;
5477
5478 def warn_logical_instead_of_bitwise : Warning<
5479   "use of logical '%0' with constant operand">,
5480   InGroup<DiagGroup<"constant-logical-operand">>;
5481 def note_logical_instead_of_bitwise_change_operator : Note<
5482   "use '%0' for a bitwise operation">;
5483 def note_logical_instead_of_bitwise_remove_constant : Note<
5484   "remove constant to silence this warning">;
5485
5486 def warn_bitwise_op_in_bitwise_op : Warning<
5487   "'%0' within '%1'">, InGroup<BitwiseOpParentheses>;
5488
5489 def warn_logical_and_in_logical_or : Warning<
5490   "'&&' within '||'">, InGroup<LogicalOpParentheses>;
5491
5492 def warn_overloaded_shift_in_comparison :Warning<
5493   "overloaded operator %select{>>|<<}0 has higher precedence than "
5494   "comparison operator">,
5495   InGroup<OverloadedShiftOpParentheses>;
5496 def note_evaluate_comparison_first :Note<
5497   "place parentheses around comparison expression to evaluate it first">;
5498
5499 def warn_addition_in_bitshift : Warning<
5500   "operator '%0' has lower precedence than '%1'; "
5501   "'%1' will be evaluated first">, InGroup<ShiftOpParentheses>;
5502
5503 def warn_self_assignment : Warning<
5504   "explicitly assigning value of variable of type %0 to itself">,
5505   InGroup<SelfAssignment>, DefaultIgnore;
5506 def warn_self_move : Warning<
5507   "explicitly moving variable of type %0 to itself">,
5508   InGroup<SelfMove>, DefaultIgnore;
5509
5510 def warn_redundant_move_on_return : Warning<
5511   "redundant move in return statement">,
5512   InGroup<RedundantMove>, DefaultIgnore;
5513 def warn_pessimizing_move_on_return : Warning<
5514   "moving a local object in a return statement prevents copy elision">,
5515   InGroup<PessimizingMove>, DefaultIgnore;
5516 def warn_pessimizing_move_on_initialization : Warning<
5517   "moving a temporary object prevents copy elision">,
5518   InGroup<PessimizingMove>, DefaultIgnore;
5519 def note_remove_move : Note<"remove std::move call here">;
5520
5521 def warn_string_plus_int : Warning<
5522   "adding %0 to a string does not append to the string">,
5523   InGroup<StringPlusInt>;
5524 def warn_string_plus_char : Warning<
5525   "adding %0 to a string pointer does not append to the string">,
5526   InGroup<StringPlusChar>;
5527 def note_string_plus_scalar_silence : Note<
5528   "use array indexing to silence this warning">;
5529
5530 def warn_sizeof_array_param : Warning<
5531   "sizeof on array function parameter will return size of %0 instead of %1">,
5532   InGroup<SizeofArrayArgument>;
5533
5534 def warn_sizeof_array_decay : Warning<
5535   "sizeof on pointer operation will return size of %0 instead of %1">,
5536   InGroup<SizeofArrayDecay>;
5537
5538 def err_sizeof_nonfragile_interface : Error<
5539   "application of '%select{alignof|sizeof}1' to interface %0 is "
5540   "not supported on this architecture and platform">;
5541 def err_atdef_nonfragile_interface : Error<
5542   "use of @defs is not supported on this architecture and platform">;
5543 def err_subscript_nonfragile_interface : Error<
5544   "subscript requires size of interface %0, which is not constant for "
5545   "this architecture and platform">;
5546
5547 def err_arithmetic_nonfragile_interface : Error<
5548   "arithmetic on pointer to interface %0, which is not a constant size for "
5549   "this architecture and platform">;
5550
5551
5552 def ext_subscript_non_lvalue : Extension<
5553   "ISO C90 does not allow subscripting non-lvalue array">;
5554 def err_typecheck_subscript_value : Error<
5555   "subscripted value is not an array, pointer, or vector">;
5556 def err_typecheck_subscript_not_integer : Error<
5557   "array subscript is not an integer">;
5558 def err_subscript_function_type : Error<
5559   "subscript of pointer to function type %0">;
5560 def err_subscript_incomplete_type : Error<
5561   "subscript of pointer to incomplete type %0">;
5562 def err_dereference_incomplete_type : Error<
5563   "dereference of pointer to incomplete type %0">;
5564 def ext_gnu_subscript_void_type : Extension<
5565   "subscript of a pointer to void is a GNU extension">, InGroup<PointerArith>;
5566 def err_typecheck_member_reference_struct_union : Error<
5567   "member reference base type %0 is not a structure or union">;
5568 def err_typecheck_member_reference_ivar : Error<
5569   "%0 does not have a member named %1">;
5570 def err_arc_weak_ivar_access : Error<
5571   "dereferencing a __weak pointer is not allowed due to possible "
5572   "null value caused by race condition, assign it to strong variable first">;
5573 def err_typecheck_member_reference_arrow : Error<
5574   "member reference type %0 is not a pointer">;
5575 def err_typecheck_member_reference_suggestion : Error<
5576   "member reference type %0 is %select{a|not a}1 pointer; did you mean to use '%select{->|.}1'?">;
5577 def note_typecheck_member_reference_suggestion : Note<
5578   "did you mean to use '.' instead?">;
5579 def note_member_reference_arrow_from_operator_arrow : Note<
5580   "'->' applied to return value of the operator->() declared here">;
5581 def err_typecheck_member_reference_type : Error<
5582   "cannot refer to type member %0 in %1 with '%select{.|->}2'">;
5583 def err_typecheck_member_reference_unknown : Error<
5584   "cannot refer to member %0 in %1 with '%select{.|->}2'">;
5585 def err_member_reference_needs_call : Error<
5586   "base of member reference is a function; perhaps you meant to call "
5587   "it%select{| with no arguments}0?">;
5588 def warn_subscript_is_char : Warning<"array subscript is of type 'char'">,
5589   InGroup<CharSubscript>, DefaultIgnore;
5590
5591 def err_typecheck_incomplete_tag : Error<"incomplete definition of type %0">;
5592 def err_no_member : Error<"no member named %0 in %1">;
5593 def err_no_member_overloaded_arrow : Error<
5594   "no member named %0 in %1; did you mean to use '->' instead of '.'?">;
5595
5596 def err_member_not_yet_instantiated : Error<
5597   "no member %0 in %1; it has not yet been instantiated">;
5598 def note_non_instantiated_member_here : Note<
5599   "not-yet-instantiated member is declared here">;
5600
5601 def err_enumerator_does_not_exist : Error<
5602   "enumerator %0 does not exist in instantiation of %1">;
5603 def note_enum_specialized_here : Note<
5604   "enum %0 was explicitly specialized here">;
5605
5606 def err_member_redeclared : Error<"class member cannot be redeclared">;
5607 def ext_member_redeclared : ExtWarn<"class member cannot be redeclared">,
5608   InGroup<RedeclaredClassMember>;
5609 def err_member_redeclared_in_instantiation : Error<
5610   "multiple overloads of %0 instantiate to the same signature %1">;
5611 def err_member_name_of_class : Error<"member %0 has the same name as its class">;
5612 def err_member_def_undefined_record : Error<
5613   "out-of-line definition of %0 from class %1 without definition">;
5614 def err_member_decl_does_not_match : Error<
5615   "out-of-line %select{declaration|definition}2 of %0 "
5616   "does not match any declaration in %1">;
5617 def err_friend_decl_with_def_arg_must_be_def : Error<
5618   "friend declaration specifying a default argument must be a definition">;
5619 def err_friend_decl_with_def_arg_redeclared : Error<
5620   "friend declaration specifying a default argument must be the only declaration">;
5621 def err_friend_decl_does_not_match : Error<
5622   "friend declaration of %0 does not match any declaration in %1">;
5623 def err_member_decl_does_not_match_suggest : Error<
5624   "out-of-line %select{declaration|definition}2 of %0 "
5625   "does not match any declaration in %1; did you mean %3?">;
5626 def err_member_def_does_not_match_ret_type : Error<
5627   "return type of out-of-line definition of %q0 differs from "
5628   "that in the declaration">;
5629 def err_nonstatic_member_out_of_line : Error<
5630   "non-static data member defined out-of-line">;
5631 def err_qualified_typedef_declarator : Error<
5632   "typedef declarator cannot be qualified">;
5633 def err_qualified_param_declarator : Error<
5634   "parameter declarator cannot be qualified">;
5635 def ext_out_of_line_declaration : ExtWarn<
5636   "out-of-line declaration of a member must be a definition">,
5637   InGroup<OutOfLineDeclaration>, DefaultError;
5638 def err_member_extra_qualification : Error<
5639   "extra qualification on member %0">;
5640 def warn_member_extra_qualification : Warning<
5641   err_member_extra_qualification.Text>, InGroup<MicrosoftExtraQualification>;
5642 def warn_namespace_member_extra_qualification : Warning<
5643   "extra qualification on member %0">,
5644   InGroup<DiagGroup<"extra-qualification">>;
5645 def err_member_qualification : Error<
5646   "non-friend class member %0 cannot have a qualified name">;  
5647 def note_member_def_close_match : Note<"member declaration nearly matches">;
5648 def note_member_def_close_const_match : Note<
5649   "member declaration does not match because "
5650   "it %select{is|is not}0 const qualified">;
5651 def note_member_def_close_param_match : Note<
5652   "type of %ordinal0 parameter of member declaration does not match definition"
5653   "%diff{ ($ vs $)|}1,2">;
5654 def note_local_decl_close_match : Note<"local declaration nearly matches">;
5655 def note_local_decl_close_param_match : Note<
5656   "type of %ordinal0 parameter of local declaration does not match definition"
5657   "%diff{ ($ vs $)|}1,2">;
5658 def err_typecheck_ivar_variable_size : Error<
5659   "instance variables must have a constant size">;
5660 def err_ivar_reference_type : Error<
5661   "instance variables cannot be of reference type">;
5662 def err_typecheck_illegal_increment_decrement : Error<
5663   "cannot %select{decrement|increment}1 value of type %0">;
5664 def err_typecheck_expect_int : Error<
5665   "used type %0 where integer is required">;
5666 def err_typecheck_arithmetic_incomplete_type : Error<
5667   "arithmetic on a pointer to an incomplete type %0">;
5668 def err_typecheck_pointer_arith_function_type : Error<
5669   "arithmetic on%select{ a|}0 pointer%select{|s}0 to%select{ the|}2 "
5670   "function type%select{|s}2 %1%select{| and %3}2">;
5671 def err_typecheck_pointer_arith_void_type : Error<
5672   "arithmetic on%select{ a|}0 pointer%select{|s}0 to void">;
5673 def err_typecheck_decl_incomplete_type : Error<
5674   "variable has incomplete type %0">;
5675 def ext_typecheck_decl_incomplete_type : ExtWarn<
5676   "tentative definition of variable with internal linkage has incomplete non-array type %0">,
5677   InGroup<DiagGroup<"tentative-definition-incomplete-type">>;
5678 def err_tentative_def_incomplete_type : Error<
5679   "tentative definition has type %0 that is never completed">;
5680 def warn_tentative_incomplete_array : Warning<
5681   "tentative array definition assumed to have one element">;
5682 def err_typecheck_incomplete_array_needs_initializer : Error<
5683   "definition of variable with array type needs an explicit size "
5684   "or an initializer">;
5685 def err_array_init_not_init_list : Error<
5686   "array initializer must be an initializer "
5687   "list%select{| or string literal| or wide string literal}0">;
5688 def err_array_init_narrow_string_into_wchar : Error<
5689   "initializing wide char array with non-wide string literal">;
5690 def err_array_init_wide_string_into_char : Error<
5691   "initializing char array with wide string literal">;
5692 def err_array_init_incompat_wide_string_into_wchar : Error<
5693   "initializing wide char array with incompatible wide string literal">;
5694 def err_array_init_different_type : Error<
5695   "cannot initialize array %diff{of type $ with array of type $|"
5696   "with different type of array}0,1">;
5697 def err_array_init_non_constant_array : Error<
5698   "cannot initialize array %diff{of type $ with non-constant array of type $|"
5699   "with different type of array}0,1">;
5700 def ext_array_init_copy : Extension<
5701   "initialization of an array "
5702   "%diff{of type $ from a compound literal of type $|"
5703   "from a compound literal}0,1 is a GNU extension">, InGroup<GNUCompoundLiteralInitializer>;
5704 // This is intentionally not disabled by -Wno-gnu.
5705 def ext_array_init_parens : ExtWarn<
5706   "parenthesized initialization of a member array is a GNU extension">,
5707   InGroup<DiagGroup<"gnu-array-member-paren-init">>, DefaultError;
5708 def warn_deprecated_string_literal_conversion : Warning<
5709   "conversion from string literal to %0 is deprecated">,
5710   InGroup<CXX11CompatDeprecatedWritableStr>;
5711 def ext_deprecated_string_literal_conversion : ExtWarn<
5712   "ISO C++11 does not allow conversion from string literal to %0">,
5713   InGroup<WritableStrings>, SFINAEFailure;
5714 def err_realimag_invalid_type : Error<"invalid type %0 to %1 operator">;
5715 def err_typecheck_sclass_fscope : Error<
5716   "illegal storage class on file-scoped variable">;
5717 def warn_standalone_specifier : Warning<"'%0' ignored on this declaration">,
5718   InGroup<MissingDeclarations>;
5719 def ext_standalone_specifier : ExtWarn<"'%0' is not permitted on a declaration "
5720   "of a type">, InGroup<MissingDeclarations>;
5721 def err_standalone_class_nested_name_specifier : Error<
5722   "forward declaration of %select{class|struct|interface|union|enum}0 cannot "
5723   "have a nested name specifier">;
5724 def err_typecheck_sclass_func : Error<"illegal storage class on function">;
5725 def err_static_block_func : Error<
5726   "function declared in block scope cannot have 'static' storage class">;
5727 def err_typecheck_address_of : Error<"address of %select{bit-field"
5728   "|vector element|property expression|register variable}0 requested">;
5729 def ext_typecheck_addrof_void : Extension<
5730   "ISO C forbids taking the address of an expression of type 'void'">;
5731 def err_unqualified_pointer_member_function : Error<
5732   "must explicitly qualify name of member function when taking its address">;
5733 def err_invalid_form_pointer_member_function : Error<
5734   "cannot create a non-constant pointer to member function">;
5735 def err_address_of_function_with_pass_object_size_params: Error<
5736   "cannot take address of function %0 because parameter %1 has "
5737   "pass_object_size attribute">;
5738 def err_parens_pointer_member_function : Error<
5739   "cannot parenthesize the name of a method when forming a member pointer">;
5740 def err_typecheck_invalid_lvalue_addrof_addrof_function : Error<
5741   "extra '&' taking address of overloaded function">;
5742 def err_typecheck_invalid_lvalue_addrof : Error<
5743   "cannot take the address of an rvalue of type %0">;
5744 def ext_typecheck_addrof_temporary : ExtWarn<
5745   "taking the address of a temporary object of type %0">, 
5746   InGroup<AddressOfTemporary>, DefaultError;
5747 def err_typecheck_addrof_temporary : Error<
5748   "taking the address of a temporary object of type %0">;
5749 def err_typecheck_addrof_dtor : Error<
5750   "taking the address of a destructor">;
5751 def err_typecheck_unary_expr : Error<
5752   "invalid argument type %0 to unary expression">;
5753 def err_typecheck_indirection_requires_pointer : Error<
5754   "indirection requires pointer operand (%0 invalid)">;
5755 def ext_typecheck_indirection_through_void_pointer : ExtWarn<
5756   "ISO C++ does not allow indirection on operand of type %0">,
5757   InGroup<DiagGroup<"void-ptr-dereference">>;
5758 def warn_indirection_through_null : Warning<
5759   "indirection of non-volatile null pointer will be deleted, not trap">,
5760   InGroup<NullDereference>;
5761 def warn_binding_null_to_reference : Warning<
5762   "binding dereferenced null pointer to reference has undefined behavior">,
5763   InGroup<NullDereference>;
5764 def note_indirection_through_null : Note<
5765   "consider using __builtin_trap() or qualifying pointer with 'volatile'">;
5766 def warn_pointer_indirection_from_incompatible_type : Warning<
5767   "dereference of type %1 that was reinterpret_cast from type %0 has undefined "
5768   "behavior">,
5769   InGroup<UndefinedReinterpretCast>, DefaultIgnore;
5770 def warn_taking_address_of_packed_member : Warning<
5771   "taking address of packed member %0 of class or structure %q1 may result in an unaligned pointer value">,
5772   InGroup<DiagGroup<"address-of-packed-member">>;
5773
5774 def err_objc_object_assignment : Error<
5775   "cannot assign to class object (%0 invalid)">;
5776 def err_typecheck_invalid_operands : Error<
5777   "invalid operands to binary expression (%0 and %1)">;
5778 def err_typecheck_sub_ptr_compatible : Error<
5779   "%diff{$ and $ are not pointers to compatible types|"
5780   "pointers to incompatible types}0,1">;
5781 def ext_typecheck_ordered_comparison_of_pointer_integer : ExtWarn<
5782   "ordered comparison between pointer and integer (%0 and %1)">;
5783 def ext_typecheck_ordered_comparison_of_pointer_and_zero : Extension<
5784   "ordered comparison between pointer and zero (%0 and %1) is an extension">;
5785 def err_typecheck_ordered_comparison_of_pointer_and_zero : Error<
5786   "ordered comparison between pointer and zero (%0 and %1)">;
5787 def ext_typecheck_ordered_comparison_of_function_pointers : ExtWarn<
5788   "ordered comparison of function pointers (%0 and %1)">;
5789 def ext_typecheck_comparison_of_fptr_to_void : Extension<
5790   "equality comparison between function pointer and void pointer (%0 and %1)">;
5791 def err_typecheck_comparison_of_fptr_to_void : Error<
5792   "equality comparison between function pointer and void pointer (%0 and %1)">;
5793 def ext_typecheck_comparison_of_pointer_integer : ExtWarn<
5794   "comparison between pointer and integer (%0 and %1)">;
5795 def err_typecheck_comparison_of_pointer_integer : Error<
5796   "comparison between pointer and integer (%0 and %1)">;
5797 def ext_typecheck_comparison_of_distinct_pointers : ExtWarn<
5798   "comparison of distinct pointer types%diff{ ($ and $)|}0,1">,
5799   InGroup<CompareDistinctPointerType>;
5800 def ext_typecheck_cond_incompatible_operands : ExtWarn<
5801   "incompatible operand types (%0 and %1)">;
5802 def err_cond_voidptr_arc : Error <
5803   "operands to conditional of types%diff{ $ and $|}0,1 are incompatible "
5804   "in ARC mode">;
5805 def err_typecheck_comparison_of_distinct_pointers : Error<
5806   "comparison of distinct pointer types%diff{ ($ and $)|}0,1">;
5807 def err_typecheck_op_on_nonoverlapping_address_space_pointers : Error<
5808   "%select{comparison between %diff{ ($ and $)|}0,1"
5809   "|arithmetic operation with operands of type %diff{ ($ and $)|}0,1"
5810   "|conditional operator with the second and third operands of type "
5811   "%diff{ ($ and $)|}0,1}2"
5812   " which are pointers to non-overlapping address spaces">;
5813
5814 def err_typecheck_assign_const : Error<
5815   "%select{"
5816   "cannot assign to return value because function %1 returns a const value|"
5817   "cannot assign to variable %1 with const-qualified type %2|"
5818   "cannot assign to %select{non-|}1static data member %2 "
5819   "with const-qualified type %3|"
5820   "cannot assign to non-static data member within const member function %1|"
5821   "read-only variable is not assignable}0">;
5822
5823 def note_typecheck_assign_const : Note<
5824   "%select{"
5825   "function %1 which returns const-qualified type %2 declared here|"
5826   "variable %1 declared const here|"
5827   "%select{non-|}1static data member %2 declared const here|"
5828   "member function %q1 is declared const here}0">;
5829
5830 def warn_mixed_sign_comparison : Warning<
5831   "comparison of integers of different signs: %0 and %1">,
5832   InGroup<SignCompare>, DefaultIgnore;
5833 def warn_lunsigned_always_true_comparison : Warning<
5834   "comparison of unsigned%select{| enum}2 expression %0 is always %1">,
5835   InGroup<TautologicalCompare>;
5836 def warn_out_of_range_compare : Warning<
5837   "comparison of %select{constant %0|true|false}1 with " 
5838   "%select{expression of type %2|boolean expression}3 is always "
5839   "%select{false|true}4">, InGroup<TautologicalOutOfRangeCompare>;
5840 def warn_runsigned_always_true_comparison : Warning<
5841   "comparison of %0 unsigned%select{| enum}2 expression is always %1">,
5842   InGroup<TautologicalCompare>;
5843 def warn_comparison_of_mixed_enum_types : Warning<
5844   "comparison of two values with different enumeration types"
5845   "%diff{ ($ and $)|}0,1">,
5846   InGroup<DiagGroup<"enum-compare">>;
5847 def warn_null_in_arithmetic_operation : Warning<
5848   "use of NULL in arithmetic operation">,
5849   InGroup<NullArithmetic>;
5850 def warn_null_in_comparison_operation : Warning<
5851   "comparison between NULL and non-pointer "
5852   "%select{(%1 and NULL)|(NULL and %1)}0">,
5853   InGroup<NullArithmetic>;
5854 def err_shift_rhs_only_vector : Error<
5855   "requested shift is a vector of type %0 but the first operand is not a "
5856   "vector (%1)">;
5857
5858 def warn_logical_not_on_lhs_of_check : Warning<
5859   "logical not is only applied to the left hand side of this "
5860   "%select{comparison|bitwise operator}0">,
5861   InGroup<LogicalNotParentheses>;
5862 def note_logical_not_fix : Note<
5863   "add parentheses after the '!' to evaluate the "
5864   "%select{comparison|bitwise operator}0 first">;
5865 def note_logical_not_silence_with_parens : Note<
5866   "add parentheses around left hand side expression to silence this warning">;
5867
5868 def err_invalid_this_use : Error<
5869   "invalid use of 'this' outside of a non-static member function">;
5870 def err_this_static_member_func : Error<
5871   "'this' cannot be%select{| implicitly}0 used in a static member function "
5872   "declaration">;
5873 def err_invalid_member_use_in_static_method : Error<
5874   "invalid use of member %0 in static member function">;
5875 def err_invalid_qualified_function_type : Error<
5876   "%select{non-member function|static member function|deduction guide}0 "
5877   "%select{of type %2 |}1cannot have '%3' qualifier">;
5878 def err_compound_qualified_function_type : Error<
5879   "%select{block pointer|pointer|reference}0 to function type %select{%2 |}1"
5880   "cannot have '%3' qualifier">;
5881
5882 def err_ref_qualifier_overload : Error<
5883   "cannot overload a member function %select{without a ref-qualifier|with "
5884   "ref-qualifier '&'|with ref-qualifier '&&'}0 with a member function %select{"
5885   "without a ref-qualifier|with ref-qualifier '&'|with ref-qualifier '&&'}1">;
5886
5887 def err_invalid_non_static_member_use : Error<
5888   "invalid use of non-static data member %0">;
5889 def err_nested_non_static_member_use : Error<
5890   "%select{call to non-static member function|use of non-static data member}0 "
5891   "%2 of %1 from nested type %3">;
5892 def warn_cxx98_compat_non_static_member_use : Warning<
5893   "use of non-static data member %0 in an unevaluated context is "
5894   "incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
5895 def err_invalid_incomplete_type_use : Error<
5896   "invalid use of incomplete type %0">;
5897 def err_builtin_func_cast_more_than_one_arg : Error<
5898   "function-style cast to a builtin type can only take one argument">;
5899 def err_value_init_for_array_type : Error<
5900   "array types cannot be value-initialized">;
5901 def err_init_for_function_type : Error<
5902   "cannot create object of function type %0">;
5903 def warn_format_nonliteral_noargs : Warning<
5904   "format string is not a string literal (potentially insecure)">,
5905   InGroup<FormatSecurity>;
5906 def warn_format_nonliteral : Warning<
5907   "format string is not a string literal">,
5908   InGroup<FormatNonLiteral>, DefaultIgnore;
5909
5910 def err_unexpected_interface : Error<
5911   "unexpected interface name %0: expected expression">;
5912 def err_ref_non_value : Error<"%0 does not refer to a value">;
5913 def err_ref_vm_type : Error<
5914   "cannot refer to declaration with a variably modified type inside block">;
5915 def err_ref_flexarray_type : Error<
5916   "cannot refer to declaration of structure variable with flexible array member "
5917   "inside block">;
5918 def err_ref_array_type : Error<
5919   "cannot refer to declaration with an array type inside block">;
5920 def err_property_not_found : Error<
5921   "property %0 not found on object of type %1">;
5922 def err_invalid_property_name : Error<
5923   "%0 is not a valid property name (accessing an object of type %1)">;
5924 def err_getter_not_found : Error<
5925   "no getter method for read from property">;
5926 def err_objc_subscript_method_not_found : Error<
5927   "expected method to %select{read|write}1 %select{dictionary|array}2 element not "
5928   "found on object of type %0">;
5929 def err_objc_subscript_index_type : Error<
5930   "method index parameter type %0 is not integral type">;
5931 def err_objc_subscript_key_type : Error<
5932   "method key parameter type %0 is not object type">;
5933 def err_objc_subscript_dic_object_type : Error<
5934   "method object parameter type %0 is not object type">;
5935 def err_objc_subscript_object_type : Error<
5936   "cannot assign to this %select{dictionary|array}1 because assigning method's "
5937   "2nd parameter of type %0 is not an Objective-C pointer type">;
5938 def err_objc_subscript_base_type : Error<
5939   "%select{dictionary|array}1 subscript base type %0 is not an Objective-C object">;
5940 def err_objc_multiple_subscript_type_conversion : Error<
5941   "indexing expression is invalid because subscript type %0 has "
5942   "multiple type conversion functions">;
5943 def err_objc_subscript_type_conversion : Error<
5944   "indexing expression is invalid because subscript type %0 is not an integral"
5945   " or Objective-C pointer type">;
5946 def err_objc_subscript_pointer : Error<
5947   "indexing expression is invalid because subscript type %0 is not an"
5948   " Objective-C pointer">;
5949 def err_objc_indexing_method_result_type : Error<
5950   "method for accessing %select{dictionary|array}1 element must have Objective-C"
5951   " object return type instead of %0">;
5952 def err_objc_index_incomplete_class_type : Error<
5953   "Objective-C index expression has incomplete class type %0">;
5954 def err_illegal_container_subscripting_op : Error<
5955   "illegal operation on Objective-C container subscripting">;
5956 def err_property_not_found_forward_class : Error<
5957   "property %0 cannot be found in forward class object %1">;
5958 def err_property_not_as_forward_class : Error<
5959   "property %0 refers to an incomplete Objective-C class %1 "
5960   "(with no @interface available)">;
5961 def note_forward_class : Note<
5962   "forward declaration of class here">;
5963 def err_duplicate_property : Error<
5964   "property has a previous declaration">;
5965 def ext_gnu_void_ptr : Extension<
5966   "arithmetic on%select{ a|}0 pointer%select{|s}0 to void is a GNU extension">,
5967   InGroup<PointerArith>;
5968 def ext_gnu_ptr_func_arith : Extension<
5969   "arithmetic on%select{ a|}0 pointer%select{|s}0 to%select{ the|}2 function "
5970   "type%select{|s}2 %1%select{| and %3}2 is a GNU extension">,
5971   InGroup<PointerArith>;
5972 def err_readonly_message_assignment : Error<
5973   "assigning to 'readonly' return result of an Objective-C message not allowed">;
5974 def ext_integer_increment_complex : Extension<
5975   "ISO C does not support '++'/'--' on complex integer type %0">;
5976 def ext_integer_complement_complex : Extension<
5977   "ISO C does not support '~' for complex conjugation of %0">;
5978 def err_nosetter_property_assignment : Error<
5979   "%select{assignment to readonly property|"
5980   "no setter method %1 for assignment to property}0">;
5981 def err_nosetter_property_incdec : Error<
5982   "%select{%select{increment|decrement}1 of readonly property|"
5983   "no setter method %2 for %select{increment|decrement}1 of property}0">;
5984 def err_nogetter_property_compound_assignment : Error<
5985   "a getter method is needed to perform a compound assignment on a property">;
5986 def err_nogetter_property_incdec : Error<
5987   "no getter method %1 for %select{increment|decrement}0 of property">;
5988 def err_no_subobject_property_setting : Error<
5989   "expression is not assignable">;
5990 def err_qualified_objc_access : Error<
5991   "%select{property|instance variable}0 access cannot be qualified with '%1'">;
5992   
5993 def ext_freestanding_complex : Extension<
5994   "complex numbers are an extension in a freestanding C99 implementation">;
5995
5996 // FIXME: Remove when we support imaginary.
5997 def err_imaginary_not_supported : Error<"imaginary types are not supported">;
5998
5999 // Obj-c expressions
6000 def warn_root_inst_method_not_found : Warning<
6001   "instance method %0 is being used on 'Class' which is not in the root class">,
6002   InGroup<MethodAccess>;
6003 def warn_class_method_not_found : Warning<
6004   "class method %objcclass0 not found (return type defaults to 'id')">,
6005   InGroup<MethodAccess>;
6006 def warn_instance_method_on_class_found : Warning<
6007   "instance method %0 found instead of class method %1">,
6008   InGroup<MethodAccess>;
6009 def warn_inst_method_not_found : Warning<
6010   "instance method %objcinstance0 not found (return type defaults to 'id')">,
6011   InGroup<MethodAccess>;
6012 def warn_instance_method_not_found_with_typo : Warning<
6013   "instance method %objcinstance0 not found (return type defaults to 'id')"
6014   "; did you mean %objcinstance2?">, InGroup<MethodAccess>;
6015 def warn_class_method_not_found_with_typo : Warning<
6016   "class method %objcclass0 not found (return type defaults to 'id')"
6017   "; did you mean %objcclass2?">, InGroup<MethodAccess>;
6018 def err_method_not_found_with_typo : Error<
6019   "%select{instance|class}1 method %0 not found "
6020   "; did you mean %2?">;
6021 def err_no_super_class_message : Error<
6022   "no @interface declaration found in class messaging of %0">;
6023 def err_root_class_cannot_use_super : Error<
6024   "%0 cannot use 'super' because it is a root class">;
6025 def err_invalid_receiver_to_message_super : Error<
6026   "'super' is only valid in a method body">;
6027 def err_invalid_receiver_class_message : Error<
6028   "receiver type %0 is not an Objective-C class">;
6029 def err_missing_open_square_message_send : Error<
6030   "missing '[' at start of message send expression">;
6031 def warn_bad_receiver_type : Warning<
6032   "receiver type %0 is not 'id' or interface pointer, consider "
6033   "casting it to 'id'">,InGroup<ObjCReceiver>;
6034 def err_bad_receiver_type : Error<"bad receiver type %0">;
6035 def err_incomplete_receiver_type : Error<"incomplete receiver type %0">;
6036 def err_unknown_receiver_suggest : Error<
6037   "unknown receiver %0; did you mean %1?">;
6038 def err_objc_throw_expects_object : Error<
6039   "@throw requires an Objective-C object type (%0 invalid)">;
6040 def err_objc_synchronized_expects_object : Error<
6041   "@synchronized requires an Objective-C object type (%0 invalid)">;
6042 def err_rethrow_used_outside_catch : Error<
6043   "@throw (rethrow) used outside of a @catch block">;
6044 def err_attribute_multiple_objc_gc : Error<
6045   "multiple garbage collection attributes specified for type">;
6046 def err_catch_param_not_objc_type : Error<
6047   "@catch parameter is not a pointer to an interface type">;
6048 def err_illegal_qualifiers_on_catch_parm : Error<
6049   "illegal qualifiers on @catch parameter">;
6050 def err_storage_spec_on_catch_parm : Error<
6051   "@catch parameter cannot have storage specifier '%0'">;
6052 def warn_register_objc_catch_parm : Warning<
6053   "'register' storage specifier on @catch parameter will be ignored">;
6054 def err_qualified_objc_catch_parm : Error<
6055   "@catch parameter declarator cannot be qualified">;
6056 def warn_objc_pointer_cxx_catch_fragile : Warning<
6057   "cannot catch an exception thrown with @throw in C++ in the non-unified "
6058   "exception model">, InGroup<ObjCNonUnifiedException>;
6059 def err_objc_object_catch : Error<
6060   "cannot catch an Objective-C object by value">;
6061 def err_incomplete_type_objc_at_encode : Error<
6062   "'@encode' of incomplete type %0">;
6063 def warn_objc_circular_container : Warning<
6064   "adding '%0' to '%1' might cause circular dependency in container">,
6065   InGroup<DiagGroup<"objc-circular-container">>;
6066 def note_objc_circular_container_declared_here : Note<"'%0' declared here">;
6067 def warn_objc_unsafe_perform_selector : Warning<
6068   "%0 is incompatible with selectors that return a "
6069   "%select{struct|union|vector}1 type">,
6070   InGroup<DiagGroup<"objc-unsafe-perform-selector">>;
6071 def note_objc_unsafe_perform_selector_method_declared_here :  Note<
6072   "method %0 that returns %1 declared here">;
6073
6074 def warn_setter_getter_impl_required : Warning<
6075   "property %0 requires method %1 to be defined - "
6076   "use @synthesize, @dynamic or provide a method implementation "
6077   "in this class implementation">,
6078   InGroup<ObjCPropertyImpl>;
6079 def warn_setter_getter_impl_required_in_category : Warning<
6080   "property %0 requires method %1 to be defined - "
6081   "use @dynamic or provide a method implementation in this category">,
6082   InGroup<ObjCPropertyImpl>;
6083 def note_parameter_named_here : Note<
6084   "passing argument to parameter %0 here">;
6085 def note_parameter_here : Note<
6086   "passing argument to parameter here">;
6087 def note_method_return_type_change : Note<
6088   "compiler has implicitly changed method %0 return type">;
6089
6090 def warn_impl_required_for_class_property : Warning<
6091   "class property %0 requires method %1 to be defined - "
6092   "use @dynamic or provide a method implementation "
6093   "in this class implementation">,
6094   InGroup<ObjCPropertyImpl>;
6095 def warn_impl_required_in_category_for_class_property : Warning<
6096   "class property %0 requires method %1 to be defined - "
6097   "use @dynamic or provide a method implementation in this category">,
6098   InGroup<ObjCPropertyImpl>;
6099
6100 // C++ casts
6101 // These messages adhere to the TryCast pattern: %0 is an int specifying the
6102 // cast type, %1 is the source type, %2 is the destination type.
6103 def err_bad_reinterpret_cast_overload : Error<
6104   "reinterpret_cast cannot resolve overloaded function %0 to type %1">;
6105
6106 def warn_reinterpret_different_from_static : Warning<
6107   "'reinterpret_cast' %select{from|to}3 class %0 %select{to|from}3 its "
6108   "%select{virtual base|base at non-zero offset}2 %1 behaves differently from "
6109   "'static_cast'">, InGroup<ReinterpretBaseClass>;
6110 def note_reinterpret_updowncast_use_static: Note<
6111   "use 'static_cast' to adjust the pointer correctly while "
6112   "%select{upcasting|downcasting}0">;
6113
6114 def err_bad_static_cast_overload : Error<
6115   "address of overloaded function %0 cannot be static_cast to type %1">;
6116
6117 def err_bad_cstyle_cast_overload : Error<
6118   "address of overloaded function %0 cannot be cast to type %1">;
6119
6120
6121 def err_bad_cxx_cast_generic : Error<
6122   "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
6123   "functional-style cast}0 from %1 to %2 is not allowed">;
6124 def err_bad_cxx_cast_unrelated_class : Error<
6125   "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
6126   "functional-style cast}0 from %1 to %2, which are not related by "
6127   "inheritance, is not allowed">;
6128 def note_type_incomplete : Note<"%0 is incomplete">;
6129 def err_bad_cxx_cast_rvalue : Error<
6130   "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
6131   "functional-style cast}0 from rvalue to reference type %2">;
6132 def err_bad_cxx_cast_bitfield : Error<
6133   "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
6134   "functional-style cast}0 from bit-field lvalue to reference type %2">;
6135 def err_bad_cxx_cast_qualifiers_away : Error<
6136   "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|"
6137   "functional-style cast}0 from %1 to %2 casts away qualifiers">;
6138 def err_bad_const_cast_dest : Error<
6139   "%select{const_cast||||C-style cast|functional-style cast}0 to %2, "
6140   "which is not a reference, pointer-to-object, or pointer-to-data-member">;
6141 def ext_cast_fn_obj : Extension<
6142   "cast between pointer-to-function and pointer-to-object is an extension">;
6143 def ext_ms_cast_fn_obj : ExtWarn<
6144   "static_cast between pointer-to-function and pointer-to-object is a "
6145   "Microsoft extension">, InGroup<MicrosoftCast>;
6146 def warn_cxx98_compat_cast_fn_obj : Warning<
6147   "cast between pointer-to-function and pointer-to-object is incompatible with C++98">,
6148   InGroup<CXX98CompatPedantic>, DefaultIgnore;
6149 def err_bad_reinterpret_cast_small_int : Error<
6150   "cast from pointer to smaller type %2 loses information">;
6151 def err_bad_cxx_cast_vector_to_scalar_different_size : Error<
6152   "%select{||reinterpret_cast||C-style cast|}0 from vector %1 " 
6153   "to scalar %2 of different size">;
6154 def err_bad_cxx_cast_scalar_to_vector_different_size : Error<
6155   "%select{||reinterpret_cast||C-style cast|}0 from scalar %1 " 
6156   "to vector %2 of different size">;
6157 def err_bad_cxx_cast_vector_to_vector_different_size : Error<
6158   "%select{||reinterpret_cast||C-style cast|}0 from vector %1 " 
6159   "to vector %2 of different size">;
6160 def err_bad_lvalue_to_rvalue_cast : Error<
6161   "cannot cast from lvalue of type %1 to rvalue reference type %2; types are "
6162   "not compatible">;
6163 def err_bad_rvalue_to_rvalue_cast : Error<
6164   "cannot cast from rvalue of type %1 to rvalue reference type %2; types are "
6165   "not compatible">;
6166 def err_bad_static_cast_pointer_nonpointer : Error<
6167   "cannot cast from type %1 to pointer type %2">;
6168 def err_bad_static_cast_member_pointer_nonmp : Error<
6169   "cannot cast from type %1 to member pointer type %2">;
6170 def err_bad_cxx_cast_member_pointer_size : Error<
6171   "cannot %select{||reinterpret_cast||C-style cast|}0 from member pointer "
6172   "type %1 to member pointer type %2 of different size">;
6173 def err_bad_reinterpret_cast_reference : Error<
6174   "reinterpret_cast of a %0 to %1 needs its address, which is not allowed">;
6175 def warn_undefined_reinterpret_cast : Warning<
6176   "reinterpret_cast from %0 to %1 has undefined behavior">,
6177   InGroup<UndefinedReinterpretCast>, DefaultIgnore;
6178
6179 // These messages don't adhere to the pattern.
6180 // FIXME: Display the path somehow better.
6181 def err_ambiguous_base_to_derived_cast : Error<
6182   "ambiguous cast from base %0 to derived %1:%2">;
6183 def err_static_downcast_via_virtual : Error<
6184   "cannot cast %0 to %1 via virtual base %2">;
6185 def err_downcast_from_inaccessible_base : Error<
6186   "cannot cast %select{private|protected}2 base class %1 to %0">;
6187 def err_upcast_to_inaccessible_base : Error<
6188   "cannot cast %0 to its %select{private|protected}2 base class %1">;
6189 def err_bad_dynamic_cast_not_ref_or_ptr : Error<
6190   "%0 is not a reference or pointer">;
6191 def err_bad_dynamic_cast_not_class : Error<"%0 is not a class">;
6192 def err_bad_dynamic_cast_incomplete : Error<"%0 is an incomplete type">;
6193 def err_bad_dynamic_cast_not_ptr : Error<"%0 is not a pointer">;
6194 def err_bad_dynamic_cast_not_polymorphic : Error<"%0 is not polymorphic">;
6195
6196 // Other C++ expressions
6197 def err_need_header_before_typeid : Error<
6198   "you need to include <typeinfo> before using the 'typeid' operator">;
6199 def err_need_header_before_ms_uuidof : Error<
6200   "you need to include <guiddef.h> before using the '__uuidof' operator">;
6201 def err_ms___leave_not_in___try : Error<
6202   "'__leave' statement not in __try block">;
6203 def err_uuidof_without_guid : Error<
6204   "cannot call operator __uuidof on a type with no GUID">;
6205 def err_uuidof_with_multiple_guids : Error<
6206   "cannot call operator __uuidof on a type with multiple GUIDs">;
6207 def err_incomplete_typeid : Error<"'typeid' of incomplete type %0">;
6208 def err_variably_modified_typeid : Error<"'typeid' of variably modified type %0">;
6209 def err_static_illegal_in_new : Error<
6210   "the 'static' modifier for the array size is not legal in new expressions">;
6211 def err_array_new_needs_size : Error<
6212   "array size must be specified in new expressions">;
6213 def err_bad_new_type : Error<
6214   "cannot allocate %select{function|reference}1 type %0 with new">;
6215 def err_new_incomplete_type : Error<
6216   "allocation of incomplete type %0">;
6217 def err_new_array_nonconst : Error<
6218   "only the first dimension of an allocated array may have dynamic size">;
6219 def err_new_array_init_args : Error<
6220   "array 'new' cannot have initialization arguments">;
6221 def ext_new_paren_array_nonconst : ExtWarn<
6222   "when type is in parentheses, array cannot have dynamic size">;
6223 def err_placement_new_non_placement_delete : Error<
6224   "'new' expression with placement arguments refers to non-placement "
6225   "'operator delete'">;
6226 def err_array_size_not_integral : Error<
6227   "array size expression must have integral or %select{|unscoped }0"
6228   "enumeration type, not %1">;
6229 def err_array_size_incomplete_type : Error<
6230   "array size expression has incomplete class type %0">;
6231 def err_array_size_explicit_conversion : Error<
6232   "array size expression of type %0 requires explicit conversion to type %1">;
6233 def note_array_size_conversion : Note<
6234   "conversion to %select{integral|enumeration}0 type %1 declared here">;
6235 def err_array_size_ambiguous_conversion : Error<
6236   "ambiguous conversion of array size expression of type %0 to an integral or "
6237   "enumeration type">;
6238 def ext_array_size_conversion : Extension<
6239   "implicit conversion from array size expression of type %0 to "
6240   "%select{integral|enumeration}1 type %2 is a C++11 extension">,
6241   InGroup<CXX11>;
6242 def warn_cxx98_compat_array_size_conversion : Warning<
6243   "implicit conversion from array size expression of type %0 to "
6244   "%select{integral|enumeration}1 type %2 is incompatible with C++98">,
6245   InGroup<CXX98CompatPedantic>, DefaultIgnore;
6246 def err_address_space_qualified_new : Error<
6247   "'new' cannot allocate objects of type %0 in address space '%1'">;
6248 def err_address_space_qualified_delete : Error<
6249   "'delete' cannot delete objects of type %0 in address space '%1'">;
6250
6251 def err_default_init_const : Error<
6252   "default initialization of an object of const type %0"
6253   "%select{| without a user-provided default constructor}1">;
6254 def ext_default_init_const : ExtWarn<
6255   "default initialization of an object of const type %0"
6256   "%select{| without a user-provided default constructor}1 "
6257   "is a Microsoft extension">,
6258   InGroup<MicrosoftConstInit>;
6259 def err_delete_operand : Error<"cannot delete expression of type %0">;
6260 def ext_delete_void_ptr_operand : ExtWarn<
6261   "cannot delete expression with pointer-to-'void' type %0">,
6262   InGroup<DeleteIncomplete>;
6263 def err_ambiguous_delete_operand : Error<
6264   "ambiguous conversion of delete expression of type %0 to a pointer">;
6265 def warn_delete_incomplete : Warning<
6266   "deleting pointer to incomplete type %0 may cause undefined behavior">,
6267   InGroup<DeleteIncomplete>;
6268 def err_delete_incomplete_class_type : Error<
6269   "deleting incomplete class type %0; no conversions to pointer type">;
6270 def err_delete_explicit_conversion : Error<
6271   "converting delete expression from type %0 to type %1 invokes an explicit "
6272   "conversion function">;
6273 def note_delete_conversion : Note<"conversion to pointer type %0">;
6274 def warn_delete_array_type : Warning<
6275   "'delete' applied to a pointer-to-array type %0 treated as 'delete[]'">;
6276 def warn_mismatched_delete_new : Warning<
6277   "'delete%select{|[]}0' applied to a pointer that was allocated with "
6278   "'new%select{[]|}0'; did you mean 'delete%select{[]|}0'?">,
6279   InGroup<DiagGroup<"mismatched-new-delete">>;
6280 def note_allocated_here : Note<"allocated with 'new%select{[]|}0' here">;
6281 def err_no_suitable_delete_member_function_found : Error<
6282   "no suitable member %0 in %1">;
6283 def err_ambiguous_suitable_delete_member_function_found : Error<
6284   "multiple suitable %0 functions in %1">;
6285 def warn_ambiguous_suitable_delete_function_found : Warning<
6286   "multiple suitable %0 functions for %1; no 'operator delete' function "
6287   "will be invoked if initialization throws an exception">,
6288   InGroup<DiagGroup<"ambiguous-delete">>;
6289 def note_member_declared_here : Note<
6290   "member %0 declared here">;
6291 def err_decrement_bool : Error<"cannot decrement expression of type bool">;
6292 def warn_increment_bool : Warning<
6293   "incrementing expression of type bool is deprecated and "
6294   "incompatible with C++1z">, InGroup<DeprecatedIncrementBool>;
6295 def ext_increment_bool : ExtWarn<
6296   "ISO C++1z does not allow incrementing expression of type bool">,
6297   DefaultError, InGroup<IncrementBool>;
6298 def err_increment_decrement_enum : Error<
6299   "cannot %select{decrement|increment}0 expression of enum type %1">;
6300 def err_catch_incomplete_ptr : Error<
6301   "cannot catch pointer to incomplete type %0">;
6302 def err_catch_incomplete_ref : Error<
6303   "cannot catch reference to incomplete type %0">;
6304 def err_catch_incomplete : Error<"cannot catch incomplete type %0">;
6305 def err_catch_rvalue_ref : Error<"cannot catch exceptions by rvalue reference">;
6306 def err_catch_variably_modified : Error<
6307   "cannot catch variably modified type %0">;
6308 def err_qualified_catch_declarator : Error<
6309   "exception declarator cannot be qualified">;
6310 def err_early_catch_all : Error<"catch-all handler must come last">;
6311 def err_bad_memptr_rhs : Error<
6312   "right hand operand to %0 has non-pointer-to-member type %1">;
6313 def err_bad_memptr_lhs : Error<
6314   "left hand operand to %0 must be a %select{|pointer to }1class "
6315   "compatible with the right hand operand, but is %2">;
6316 def warn_exception_caught_by_earlier_handler : Warning<
6317   "exception of type %0 will be caught by earlier handler">,
6318   InGroup<Exceptions>;
6319 def note_previous_exception_handler : Note<"for type %0">;
6320 def err_exceptions_disabled : Error<
6321   "cannot use '%0' with exceptions disabled">;
6322 def err_objc_exceptions_disabled : Error<
6323   "cannot use '%0' with Objective-C exceptions disabled">;
6324 def err_seh_try_outside_functions : Error<
6325   "cannot use SEH '__try' in blocks, captured regions, or Obj-C method decls">;
6326 def err_mixing_cxx_try_seh_try : Error<
6327   "cannot use C++ 'try' in the same function as SEH '__try'">;
6328 def err_seh_try_unsupported : Error<
6329   "SEH '__try' is not supported on this target">;
6330 def note_conflicting_try_here : Note<
6331   "conflicting %0 here">;
6332 def warn_jump_out_of_seh_finally : Warning<
6333   "jump out of __finally block has undefined behavior">,
6334   InGroup<DiagGroup<"jump-seh-finally">>;
6335 def warn_non_virtual_dtor : Warning<
6336   "%0 has virtual functions but non-virtual destructor">,
6337   InGroup<NonVirtualDtor>, DefaultIgnore;
6338 def warn_delete_non_virtual_dtor : Warning<
6339   "%select{delete|destructor}0 called on non-final %1 that has "
6340   "virtual functions but non-virtual destructor">,
6341   InGroup<DeleteNonVirtualDtor>, DefaultIgnore;
6342 def note_delete_non_virtual : Note<
6343   "qualify call to silence this warning">;
6344 def warn_delete_abstract_non_virtual_dtor : Warning<
6345   "%select{delete|destructor}0 called on %1 that is abstract but has "
6346   "non-virtual destructor">, InGroup<DeleteNonVirtualDtor>;
6347 def warn_overloaded_virtual : Warning<
6348   "%q0 hides overloaded virtual %select{function|functions}1">,
6349   InGroup<OverloadedVirtual>, DefaultIgnore;
6350 def note_hidden_overloaded_virtual_declared_here : Note<
6351   "hidden overloaded virtual function %q0 declared here"
6352   "%select{|: different classes%diff{ ($ vs $)|}2,3"
6353   "|: different number of parameters (%2 vs %3)"
6354   "|: type mismatch at %ordinal2 parameter%diff{ ($ vs $)|}3,4"
6355   "|: different return type%diff{ ($ vs $)|}2,3"
6356   "|: different qualifiers ("
6357   "%select{none|const|restrict|const and restrict|volatile|const and volatile|"
6358   "volatile and restrict|const, volatile, and restrict}2 vs "
6359   "%select{none|const|restrict|const and restrict|volatile|const and volatile|"
6360   "volatile and restrict|const, volatile, and restrict}3)"
6361   "|: different exception specifications}1">;
6362 def warn_using_directive_in_header : Warning<
6363   "using namespace directive in global context in header">,
6364   InGroup<HeaderHygiene>, DefaultIgnore;
6365 def warn_overaligned_type : Warning<
6366   "type %0 requires %1 bytes of alignment and the default allocator only "
6367   "guarantees %2 bytes">,
6368   InGroup<OveralignedType>, DefaultIgnore;
6369
6370 def err_conditional_void_nonvoid : Error<
6371   "%select{left|right}1 operand to ? is void, but %select{right|left}1 operand "
6372   "is of type %0">;
6373 def err_conditional_ambiguous : Error<
6374   "conditional expression is ambiguous; "
6375   "%diff{$ can be converted to $ and vice versa|"
6376   "types can be convert to each other}0,1">;
6377 def err_conditional_ambiguous_ovl : Error<
6378   "conditional expression is ambiguous; %diff{$ and $|types}0,1 "
6379   "can be converted to several common types">;
6380 def err_conditional_vector_size : Error<
6381   "vector condition type %0 and result type %1 do not have the same number "
6382   "of elements">;
6383 def err_conditional_vector_element_size : Error<
6384   "vector condition type %0 and result type %1 do not have elements of the "
6385   "same size">;
6386
6387 def err_throw_incomplete : Error<
6388   "cannot throw object of incomplete type %0">;
6389 def err_throw_incomplete_ptr : Error<
6390   "cannot throw pointer to object of incomplete type %0">;
6391 def err_return_in_constructor_handler : Error<
6392   "return in the catch of a function try block of a constructor is illegal">;
6393 def warn_cdtor_function_try_handler_mem_expr : Warning<
6394   "cannot refer to a non-static member from the handler of a "
6395   "%select{constructor|destructor}0 function try block">, InGroup<Exceptions>;
6396
6397 let CategoryName = "Lambda Issue" in {
6398   def err_capture_more_than_once : Error<
6399     "%0 can appear only once in a capture list">;
6400   def err_reference_capture_with_reference_default : Error<
6401     "'&' cannot precede a capture when the capture default is '&'">;
6402   def err_this_capture_with_copy_default : Error<
6403     "'this' cannot be explicitly captured when the capture default is '='">;
6404   def err_copy_capture_with_copy_default : Error<
6405     "'&' must precede a capture when the capture default is '='">;
6406   def err_capture_does_not_name_variable : Error<
6407     "%0 in capture list does not name a variable">;
6408   def err_capture_non_automatic_variable : Error<
6409     "%0 cannot be captured because it does not have automatic storage "
6410     "duration">;
6411   def err_this_capture : Error<
6412     "'this' cannot be %select{implicitly |}0captured in this context">;
6413   def err_lambda_capture_anonymous_var : Error<
6414     "unnamed variable cannot be implicitly captured in a lambda expression">;
6415   def err_lambda_capture_flexarray_type : Error<
6416     "variable %0 with flexible array member cannot be captured in "
6417     "a lambda expression">;
6418   def err_lambda_impcap : Error<
6419     "variable %0 cannot be implicitly captured in a lambda with no "
6420     "capture-default specified">;
6421   def note_lambda_decl : Note<"lambda expression begins here">;
6422   def err_lambda_unevaluated_operand : Error<
6423     "lambda expression in an unevaluated operand">;
6424   def err_lambda_in_constant_expression : Error<
6425     "a lambda expression may not appear inside of a constant expression">;
6426   def err_lambda_return_init_list : Error<
6427     "cannot deduce lambda return type from initializer list">;
6428   def err_lambda_capture_default_arg : Error<
6429     "lambda expression in default argument cannot capture any entity">;
6430   def err_lambda_incomplete_result : Error<
6431     "incomplete result type %0 in lambda expression">;
6432   def err_noreturn_lambda_has_return_expr : Error<
6433     "lambda declared 'noreturn' should not return">;
6434   def warn_maybe_falloff_nonvoid_lambda : Warning<
6435     "control may reach end of non-void lambda">,
6436     InGroup<ReturnType>;
6437   def warn_falloff_nonvoid_lambda : Warning<
6438     "control reaches end of non-void lambda">,
6439     InGroup<ReturnType>;
6440   def err_access_lambda_capture : Error<
6441     // The ERRORs represent other special members that aren't constructors, in
6442     // hopes that someone will bother noticing and reporting if they appear
6443     "capture of variable '%0' as type %1 calls %select{private|protected}3 "
6444     "%select{default |copy |move |*ERROR* |*ERROR* |*ERROR* |}2constructor">,
6445     AccessControl;
6446   def note_lambda_to_block_conv : Note<
6447     "implicit capture of lambda object due to conversion to block pointer "
6448     "here">;
6449   def note_var_explicitly_captured_here : Note<"variable %0 is"
6450     "%select{| explicitly}1 captured here">;
6451
6452   // C++14 lambda init-captures.
6453   def warn_cxx11_compat_init_capture : Warning<
6454     "initialized lambda captures are incompatible with C++ standards "
6455     "before C++14">, InGroup<CXXPre14Compat>, DefaultIgnore;
6456   def ext_init_capture : ExtWarn<
6457     "initialized lambda captures are a C++14 extension">, InGroup<CXX14>;
6458   def err_init_capture_no_expression : Error<
6459     "initializer missing for lambda capture %0">;
6460   def err_init_capture_multiple_expressions : Error<
6461     "initializer for lambda capture %0 contains multiple expressions">;
6462   def err_init_capture_paren_braces : Error<
6463     "cannot deduce type for lambda capture %1 from "
6464     "%select{parenthesized|nested}0 initializer list">;
6465   def err_init_capture_deduction_failure : Error<
6466     "cannot deduce type for lambda capture %0 from initializer of type %2">;
6467   def err_init_capture_deduction_failure_from_init_list : Error<
6468     "cannot deduce type for lambda capture %0 from initializer list">;
6469
6470   // C++1z '*this' captures.
6471   def warn_cxx14_compat_star_this_lambda_capture : Warning<
6472     "by value capture of '*this' is incompatible with C++ standards before C++1z">,
6473      InGroup<CXXPre1zCompat>, DefaultIgnore;
6474   def ext_star_this_lambda_capture_cxx1z : ExtWarn<
6475     "capture of '*this' by copy is a C++1z extension">, InGroup<CXX1z>;
6476 }
6477
6478 def err_return_in_captured_stmt : Error<
6479   "cannot return from %0">;
6480 def err_capture_block_variable : Error<
6481   "__block variable %0 cannot be captured in a "
6482   "%select{lambda expression|captured statement}1">;
6483
6484 def err_operator_arrow_circular : Error<
6485   "circular pointer delegation detected">;
6486 def err_operator_arrow_depth_exceeded : Error<
6487   "use of 'operator->' on type %0 would invoke a sequence of more than %1 "
6488   "'operator->' calls">;
6489 def note_operator_arrow_here : Note<
6490   "'operator->' declared here produces an object of type %0">;
6491 def note_operator_arrows_suppressed : Note<
6492   "(skipping %0 'operator->'%s0 in backtrace)">;
6493 def note_operator_arrow_depth : Note<
6494   "use -foperator-arrow-depth=N to increase 'operator->' limit">;
6495
6496 def err_pseudo_dtor_base_not_scalar : Error<
6497   "object expression of non-scalar type %0 cannot be used in a "
6498   "pseudo-destructor expression">;
6499 def ext_pseudo_dtor_on_void : ExtWarn<
6500   "pseudo-destructors on type void are a Microsoft extension">,
6501   InGroup<MicrosoftVoidPseudoDtor>;
6502 def err_pseudo_dtor_type_mismatch : Error<
6503   "the type of object expression "
6504   "%diff{($) does not match the type being destroyed ($)|"
6505   "does not match the type being destroyed}0,1 "
6506   "in pseudo-destructor expression">;
6507 def err_pseudo_dtor_call_with_args : Error<
6508   "call to pseudo-destructor cannot have any arguments">;
6509 def err_dtor_expr_without_call : Error<
6510   "reference to %select{destructor|pseudo-destructor}0 must be called"
6511   "%select{|; did you mean to call it with no arguments?}1">;
6512 def err_pseudo_dtor_destructor_non_type : Error<
6513   "%0 does not refer to a type name in pseudo-destructor expression; expected "
6514   "the name of type %1">;
6515 def err_invalid_use_of_function_type : Error<
6516   "a function type is not allowed here">;
6517 def err_invalid_use_of_array_type : Error<"an array type is not allowed here">;
6518 def err_typecheck_bool_condition : Error<
6519   "value of type %0 is not contextually convertible to 'bool'">;
6520 def err_typecheck_ambiguous_condition : Error<
6521   "conversion %diff{from $ to $|between types}0,1 is ambiguous">;
6522 def err_typecheck_nonviable_condition : Error<
6523   "no viable conversion%select{%diff{ from $ to $|}1,2|"
6524   "%diff{ from returned value of type $ to function return type $|}1,2}0">;
6525 def err_typecheck_nonviable_condition_incomplete : Error<
6526   "no viable conversion%diff{ from $ to incomplete type $|}0,1">;
6527 def err_typecheck_deleted_function : Error<
6528   "conversion function %diff{from $ to $|between types}0,1 "
6529   "invokes a deleted function">;
6530   
6531 def err_expected_class_or_namespace : Error<"%0 is not a class"
6532   "%select{ or namespace|, namespace, or enumeration}1">;
6533 def err_invalid_declarator_scope : Error<"cannot define or redeclare %0 here "
6534   "because namespace %1 does not enclose namespace %2">;
6535 def err_invalid_declarator_global_scope : Error<
6536   "definition or redeclaration of %0 cannot name the global scope">;
6537 def err_invalid_declarator_in_function : Error<
6538   "definition or redeclaration of %0 not allowed inside a function">;
6539 def err_invalid_declarator_in_block : Error<
6540   "definition or redeclaration of %0 not allowed inside a block">;
6541 def err_not_tag_in_scope : Error<
6542   "no %select{struct|interface|union|class|enum}0 named %1 in %2">;
6543
6544 def err_no_typeid_with_fno_rtti : Error<
6545   "cannot use typeid with -fno-rtti">;
6546 def err_no_dynamic_cast_with_fno_rtti : Error<
6547   "cannot use dynamic_cast with -fno-rtti">;
6548
6549 def err_cannot_form_pointer_to_member_of_reference_type : Error<
6550   "cannot form a pointer-to-member to member %0 of reference type %1">;
6551 def err_incomplete_object_call : Error<
6552   "incomplete type in call to object of type %0">;
6553
6554 def warn_condition_is_assignment : Warning<"using the result of an "
6555   "assignment as a condition without parentheses">,
6556   InGroup<Parentheses>;
6557 // Completely identical except off by default.
6558 def warn_condition_is_idiomatic_assignment : Warning<"using the result "
6559   "of an assignment as a condition without parentheses">,
6560   InGroup<DiagGroup<"idiomatic-parentheses">>, DefaultIgnore;
6561 def note_condition_assign_to_comparison : Note<
6562   "use '==' to turn this assignment into an equality comparison">;
6563 def note_condition_or_assign_to_comparison : Note<
6564   "use '!=' to turn this compound assignment into an inequality comparison">;
6565 def note_condition_assign_silence : Note<
6566   "place parentheses around the assignment to silence this warning">;
6567
6568 def warn_equality_with_extra_parens : Warning<"equality comparison with "
6569   "extraneous parentheses">, InGroup<ParenthesesOnEquality>;
6570 def note_equality_comparison_to_assign : Note<
6571   "use '=' to turn this equality comparison into an assignment">;
6572 def note_equality_comparison_silence : Note<
6573   "remove extraneous parentheses around the comparison to silence this warning">;
6574
6575 // assignment related diagnostics (also for argument passing, returning, etc).
6576 // In most of these diagnostics the %2 is a value from the
6577 // Sema::AssignmentAction enumeration
6578 def err_typecheck_convert_incompatible : Error<
6579   "%select{%diff{assigning to $ from incompatible type $|"
6580   "assigning to type from incompatible type}0,1"
6581   "|%diff{passing $ to parameter of incompatible type $|"
6582   "passing type to parameter of incompatible type}0,1"
6583   "|%diff{returning $ from a function with incompatible result type $|"
6584   "returning type from a function with incompatible result type}0,1"
6585   "|%diff{converting $ to incompatible type $|"
6586   "converting type to incompatible type}0,1"
6587   "|%diff{initializing $ with an expression of incompatible type $|"
6588   "initializing type with an expression of incompatible type}0,1"
6589   "|%diff{sending $ to parameter of incompatible type $|"
6590   "sending type to parameter of incompatible type}0,1"
6591   "|%diff{casting $ to incompatible type $|"
6592   "casting type to incompatible type}0,1}2"
6593   "%select{|; dereference with *|"
6594   "; take the address with &|"
6595   "; remove *|"
6596   "; remove &}3"
6597   "%select{|: different classes%diff{ ($ vs $)|}5,6"
6598   "|: different number of parameters (%5 vs %6)"
6599   "|: type mismatch at %ordinal5 parameter%diff{ ($ vs $)|}6,7"
6600   "|: different return type%diff{ ($ vs $)|}5,6"
6601   "|: different qualifiers ("
6602   "%select{none|const|restrict|const and restrict|volatile|const and volatile|"
6603   "volatile and restrict|const, volatile, and restrict}5 vs "
6604   "%select{none|const|restrict|const and restrict|volatile|const and volatile|"
6605   "volatile and restrict|const, volatile, and restrict}6)"
6606   "|: different exception specifications}4">;
6607 def err_typecheck_missing_return_type_incompatible : Error<
6608   "%diff{return type $ must match previous return type $|"
6609   "return type must match previous return type}0,1 when %select{block "
6610   "literal|lambda expression}2 has unspecified explicit return type">;
6611
6612 def note_incomplete_class_and_qualified_id : Note<
6613   "conformance of forward class %0 to protocol %1 can not be confirmed">;
6614 def warn_incompatible_qualified_id : Warning<
6615   "%select{%diff{assigning to $ from incompatible type $|"
6616   "assigning to type from incompatible type}0,1"
6617   "|%diff{passing $ to parameter of incompatible type $|"
6618   "passing type to parameter of incompatible type}0,1"
6619   "|%diff{returning $ from a function with incompatible result type $|"
6620   "returning type from a function with incompatible result type}0,1"
6621   "|%diff{converting $ to incompatible type $|"
6622   "converting type to incompatible type}0,1"
6623   "|%diff{initializing $ with an expression of incompatible type $|"
6624   "initializing type with an expression of incompatible type}0,1"
6625   "|%diff{sending $ to parameter of incompatible type $|"
6626   "sending type to parameter of incompatible type}0,1"
6627   "|%diff{casting $ to incompatible type $|"
6628   "casting type to incompatible type}0,1}2">;
6629 def ext_typecheck_convert_pointer_int : ExtWarn<
6630   "incompatible pointer to integer conversion "
6631   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6632   "|%diff{passing $ to parameter of type $|"
6633   "passing to parameter of different type}0,1"
6634   "|%diff{returning $ from a function with result type $|"
6635   "returning from function with different return type}0,1"
6636   "|%diff{converting $ to type $|converting between types}0,1"
6637   "|%diff{initializing $ with an expression of type $|"
6638   "initializing with expression of different type}0,1"
6639   "|%diff{sending $ to parameter of type $|"
6640   "sending to parameter of different type}0,1"
6641   "|%diff{casting $ to type $|casting between types}0,1}2"
6642   "%select{|; dereference with *|"
6643   "; take the address with &|"
6644   "; remove *|"
6645   "; remove &}3">,
6646   InGroup<IntConversion>;
6647 def ext_typecheck_convert_int_pointer : ExtWarn<
6648   "incompatible integer to pointer conversion "
6649   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6650   "|%diff{passing $ to parameter of type $|"
6651   "passing to parameter of different type}0,1"
6652   "|%diff{returning $ from a function with result type $|"
6653   "returning from function with different return type}0,1"
6654   "|%diff{converting $ to type $|converting between types}0,1"
6655   "|%diff{initializing $ with an expression of type $|"
6656   "initializing with expression of different type}0,1"
6657   "|%diff{sending $ to parameter of type $|"
6658   "sending to parameter of different type}0,1"
6659   "|%diff{casting $ to type $|casting between types}0,1}2"
6660   "%select{|; dereference with *|"
6661   "; take the address with &|"
6662   "; remove *|"
6663   "; remove &}3">,
6664   InGroup<IntConversion>;
6665 def ext_typecheck_convert_pointer_void_func : Extension<
6666   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6667   "|%diff{passing $ to parameter of type $|"
6668   "passing to parameter of different type}0,1"
6669   "|%diff{returning $ from a function with result type $|"
6670   "returning from function with different return type}0,1"
6671   "|%diff{converting $ to type $|converting between types}0,1"
6672   "|%diff{initializing $ with an expression of type $|"
6673   "initializing with expression of different type}0,1"
6674   "|%diff{sending $ to parameter of type $|"
6675   "sending to parameter of different type}0,1"
6676   "|%diff{casting $ to type $|casting between types}0,1}2"
6677   " converts between void pointer and function pointer">;
6678 def ext_typecheck_convert_incompatible_pointer_sign : ExtWarn<
6679   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6680   "|%diff{passing $ to parameter of type $|"
6681   "passing to parameter of different type}0,1"
6682   "|%diff{returning $ from a function with result type $|"
6683   "returning from function with different return type}0,1"
6684   "|%diff{converting $ to type $|converting between types}0,1"
6685   "|%diff{initializing $ with an expression of type $|"
6686   "initializing with expression of different type}0,1"
6687   "|%diff{sending $ to parameter of type $|"
6688   "sending to parameter of different type}0,1"
6689   "|%diff{casting $ to type $|casting between types}0,1}2"
6690   " converts between pointers to integer types with different sign">,
6691   InGroup<DiagGroup<"pointer-sign">>;
6692 def ext_typecheck_convert_incompatible_pointer : ExtWarn<
6693   "incompatible pointer types "
6694   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6695   "|%diff{passing $ to parameter of type $|"
6696   "passing to parameter of different type}0,1"
6697   "|%diff{returning $ from a function with result type $|"
6698   "returning from function with different return type}0,1"
6699   "|%diff{converting $ to type $|converting between types}0,1"
6700   "|%diff{initializing $ with an expression of type $|"
6701   "initializing with expression of different type}0,1"
6702   "|%diff{sending $ to parameter of type $|"
6703   "sending to parameter of different type}0,1"
6704   "|%diff{casting $ to type $|casting between types}0,1}2"
6705   "%select{|; dereference with *|"
6706   "; take the address with &|"
6707   "; remove *|"
6708   "; remove &}3">,
6709   InGroup<IncompatiblePointerTypes>;
6710 def ext_typecheck_convert_incompatible_function_pointer : ExtWarn<
6711   "incompatible function pointer types "
6712   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6713   "|%diff{passing $ to parameter of type $|"
6714   "passing to parameter of different type}0,1"
6715   "|%diff{returning $ from a function with result type $|"
6716   "returning from function with different return type}0,1"
6717   "|%diff{converting $ to type $|converting between types}0,1"
6718   "|%diff{initializing $ with an expression of type $|"
6719   "initializing with expression of different type}0,1"
6720   "|%diff{sending $ to parameter of type $|"
6721   "sending to parameter of different type}0,1"
6722   "|%diff{casting $ to type $|casting between types}0,1}2"
6723   "%select{|; dereference with *|"
6724   "; take the address with &|"
6725   "; remove *|"
6726   "; remove &}3">,
6727   InGroup<IncompatibleFunctionPointerTypes>;
6728 def ext_typecheck_convert_discards_qualifiers : ExtWarn<
6729   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6730   "|%diff{passing $ to parameter of type $|"
6731   "passing to parameter of different type}0,1"
6732   "|%diff{returning $ from a function with result type $|"
6733   "returning from function with different return type}0,1"
6734   "|%diff{converting $ to type $|converting between types}0,1"
6735   "|%diff{initializing $ with an expression of type $|"
6736   "initializing with expression of different type}0,1"
6737   "|%diff{sending $ to parameter of type $|"
6738   "sending to parameter of different type}0,1"
6739   "|%diff{casting $ to type $|casting between types}0,1}2"
6740   " discards qualifiers">,
6741   InGroup<IncompatiblePointerTypesDiscardsQualifiers>;
6742 def ext_nested_pointer_qualifier_mismatch : ExtWarn<
6743   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6744   "|%diff{passing $ to parameter of type $|"
6745   "passing to parameter of different type}0,1"
6746   "|%diff{returning $ from a function with result type $|"
6747   "returning from function with different return type}0,1"
6748   "|%diff{converting $ to type $|converting between types}0,1"
6749   "|%diff{initializing $ with an expression of type $|"
6750   "initializing with expression of different type}0,1"
6751   "|%diff{sending $ to parameter of type $|"
6752   "sending to parameter of different type}0,1"
6753   "|%diff{casting $ to type $|casting between types}0,1}2"
6754   " discards qualifiers in nested pointer types">,
6755   InGroup<IncompatiblePointerTypesDiscardsQualifiers>;
6756 def warn_incompatible_vectors : Warning<
6757   "incompatible vector types "
6758   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6759   "|%diff{passing $ to parameter of type $|"
6760   "passing to parameter of different type}0,1"
6761   "|%diff{returning $ from a function with result type $|"
6762   "returning from function with different return type}0,1"
6763   "|%diff{converting $ to type $|converting between types}0,1"
6764   "|%diff{initializing $ with an expression of type $|"
6765   "initializing with expression of different type}0,1"
6766   "|%diff{sending $ to parameter of type $|"
6767   "sending to parameter of different type}0,1"
6768   "|%diff{casting $ to type $|casting between types}0,1}2">,
6769   InGroup<VectorConversion>, DefaultIgnore;
6770 def err_int_to_block_pointer : Error<
6771   "invalid block pointer conversion "
6772   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6773   "|%diff{passing $ to parameter of type $|"
6774   "passing to parameter of different type}0,1"
6775   "|%diff{returning $ from a function with result type $|"
6776   "returning from function with different return type}0,1"
6777   "|%diff{converting $ to type $|converting between types}0,1"
6778   "|%diff{initializing $ with an expression of type $|"
6779   "initializing with expression of different type}0,1"
6780   "|%diff{sending $ to parameter of type $|"
6781   "sending to parameter of different type}0,1"
6782   "|%diff{casting $ to type $|casting between types}0,1}2">;
6783 def err_typecheck_convert_incompatible_block_pointer : Error<
6784   "incompatible block pointer types "
6785   "%select{%diff{assigning to $ from $|assigning to different types}0,1"
6786   "|%diff{passing $ to parameter of type $|"
6787   "passing to parameter of different type}0,1"
6788   "|%diff{returning $ from a function with result type $|"
6789   "returning from function with different return type}0,1"
6790   "|%diff{converting $ to type $|converting between types}0,1"
6791   "|%diff{initializing $ with an expression of type $|"
6792   "initializing with expression of different type}0,1"
6793   "|%diff{sending $ to parameter of type $|"
6794   "sending to parameter of different type}0,1"
6795   "|%diff{casting $ to type $|casting between types}0,1}2">;
6796 def err_typecheck_incompatible_address_space : Error<
6797   "%select{%diff{assigning $ to $|assigning to different types}1,0"
6798   "|%diff{passing $ to parameter of type $|"
6799   "passing to parameter of different type}0,1"
6800   "|%diff{returning $ from a function with result type $|"
6801   "returning from function with different return type}0,1"
6802   "|%diff{converting $ to type $|converting between types}0,1"
6803   "|%diff{initializing $ with an expression of type $|"
6804   "initializing with expression of different type}0,1"
6805   "|%diff{sending $ to parameter of type $|"
6806   "sending to parameter of different type}0,1"
6807   "|%diff{casting $ to type $|casting between types}0,1}2"
6808   " changes address space of pointer">;
6809 def err_typecheck_incompatible_ownership : Error<
6810   "%select{%diff{assigning $ to $|assigning to different types}1,0"
6811   "|%diff{passing $ to parameter of type $|"
6812   "passing to parameter of different type}0,1"
6813   "|%diff{returning $ from a function with result type $|"
6814   "returning from function with different return type}0,1"
6815   "|%diff{converting $ to type $|converting between types}0,1"
6816   "|%diff{initializing $ with an expression of type $|"
6817   "initializing with expression of different type}0,1"
6818   "|%diff{sending $ to parameter of type $|"
6819   "sending to parameter of different type}0,1"
6820   "|%diff{casting $ to type $|casting between types}0,1}2"
6821   " changes retain/release properties of pointer">;
6822 def err_typecheck_comparison_of_distinct_blocks : Error<
6823   "comparison of distinct block types%diff{ ($ and $)|}0,1">;
6824
6825 def err_typecheck_array_not_modifiable_lvalue : Error<
6826   "array type %0 is not assignable">;
6827 def err_typecheck_non_object_not_modifiable_lvalue : Error<
6828   "non-object type %0 is not assignable">;
6829 def err_typecheck_expression_not_modifiable_lvalue : Error<
6830   "expression is not assignable">;
6831 def err_typecheck_incomplete_type_not_modifiable_lvalue : Error<
6832   "incomplete type %0 is not assignable">;
6833 def err_typecheck_lvalue_casts_not_supported : Error<
6834   "assignment to cast is illegal, lvalue casts are not supported">;
6835
6836 def err_typecheck_duplicate_vector_components_not_mlvalue : Error<
6837   "vector is not assignable (contains duplicate components)">;
6838 def err_block_decl_ref_not_modifiable_lvalue : Error<
6839   "variable is not assignable (missing __block type specifier)">;
6840 def err_lambda_decl_ref_not_modifiable_lvalue : Error<
6841   "cannot assign to a variable captured by copy in a non-mutable lambda">;
6842 def err_typecheck_call_not_function : Error<
6843   "called object type %0 is not a function or function pointer">;
6844 def err_call_incomplete_return : Error<
6845   "calling function with incomplete return type %0">;
6846 def err_call_function_incomplete_return : Error<
6847   "calling %0 with incomplete return type %1">;
6848 def err_call_incomplete_argument : Error<
6849   "argument type %0 is incomplete">;
6850 def err_typecheck_call_too_few_args : Error<
6851   "too few %select{|||execution configuration }0arguments to "
6852   "%select{function|block|method|kernel function}0 call, "
6853   "expected %1, have %2">;
6854 def err_typecheck_call_too_few_args_one : Error<
6855   "too few %select{|||execution configuration }0arguments to "
6856   "%select{function|block|method|kernel function}0 call, "
6857   "single argument %1 was not specified">;
6858 def err_typecheck_call_too_few_args_at_least : Error<
6859   "too few %select{|||execution configuration }0arguments to "
6860   "%select{function|block|method|kernel function}0 call, "
6861   "expected at least %1, have %2">;
6862 def err_typecheck_call_too_few_args_at_least_one : Error<
6863   "too few %select{|||execution configuration }0arguments to "
6864   "%select{function|block|method|kernel function}0 call, "
6865   "at least argument %1 must be specified">;
6866 def err_typecheck_call_too_few_args_suggest : Error<
6867   "too few %select{|||execution configuration }0arguments to "
6868   "%select{function|block|method|kernel function}0 call, "
6869   "expected %1, have %2; did you mean %3?">;
6870 def err_typecheck_call_too_few_args_at_least_suggest : Error<
6871   "too few %select{|||execution configuration }0arguments to "
6872   "%select{function|block|method|kernel function}0 call, "
6873   "expected at least %1, have %2; did you mean %3?">;
6874 def err_typecheck_call_too_many_args : Error<
6875   "too many %select{|||execution configuration }0arguments to "
6876   "%select{function|block|method|kernel function}0 call, "
6877   "expected %1, have %2">;
6878 def err_typecheck_call_too_many_args_one : Error<
6879   "too many %select{|||execution configuration }0arguments to "
6880   "%select{function|block|method|kernel function}0 call, "
6881   "expected single argument %1, have %2 arguments">;
6882 def err_typecheck_call_too_many_args_at_most : Error<
6883   "too many %select{|||execution configuration }0arguments to "
6884   "%select{function|block|method|kernel function}0 call, "
6885   "expected at most %1, have %2">;
6886 def err_typecheck_call_too_many_args_at_most_one : Error<
6887   "too many %select{|||execution configuration }0arguments to "
6888   "%select{function|block|method|kernel function}0 call, "
6889   "expected at most single argument %1, have %2 arguments">;
6890 def err_typecheck_call_too_many_args_suggest : Error<
6891   "too many %select{|||execution configuration }0arguments to "
6892   "%select{function|block|method|kernel function}0 call, "
6893   "expected %1, have %2; did you mean %3?">;
6894 def err_typecheck_call_too_many_args_at_most_suggest : Error<
6895   "too many %select{|||execution configuration }0arguments to "
6896   "%select{function|block|method|kernel function}0 call, "
6897   "expected at most %1, have %2; did you mean %3?">;
6898   
6899 def err_arc_typecheck_convert_incompatible_pointer : Error<
6900   "incompatible pointer types passing retainable parameter of type %0"
6901   "to a CF function expecting %1 type">;
6902   
6903 def err_builtin_fn_use : Error<"builtin functions must be directly called">;
6904
6905 def warn_call_wrong_number_of_arguments : Warning<
6906   "too %select{few|many}0 arguments in call to %1">;
6907 def err_atomic_builtin_must_be_pointer : Error<
6908   "address argument to atomic builtin must be a pointer (%0 invalid)">;
6909 def err_atomic_builtin_must_be_pointer_intptr : Error<
6910   "address argument to atomic builtin must be a pointer to integer or pointer"
6911   " (%0 invalid)">;
6912 def err_atomic_builtin_must_be_pointer_intfltptr : Error<
6913   "address argument to atomic builtin must be a pointer to integer,"
6914   " floating-point or pointer (%0 invalid)">;
6915 def err_atomic_builtin_pointer_size : Error<
6916   "address argument to atomic builtin must be a pointer to 1,2,4,8 or 16 byte "
6917   "type (%0 invalid)">;
6918 def err_atomic_exclusive_builtin_pointer_size : Error<
6919   "address argument to load or store exclusive builtin must be a pointer to"
6920   " 1,2,4 or 8 byte type (%0 invalid)">;
6921 def err_atomic_op_needs_atomic : Error<
6922   "address argument to atomic operation must be a pointer to _Atomic "
6923   "type (%0 invalid)">;
6924 def err_atomic_op_needs_non_const_atomic : Error<
6925   "address argument to atomic operation must be a pointer to non-const _Atomic "
6926   "type (%0 invalid)">;
6927 def err_atomic_op_needs_non_const_pointer : Error<
6928   "address argument to atomic operation must be a pointer to non-const "
6929   "type (%0 invalid)">;
6930 def err_atomic_op_needs_trivial_copy : Error<
6931   "address argument to atomic operation must be a pointer to a "
6932   "trivially-copyable type (%0 invalid)">;
6933 def err_atomic_op_needs_atomic_int_or_ptr : Error<
6934   "address argument to atomic operation must be a pointer to %select{|atomic }0"
6935   "integer or pointer (%1 invalid)">;
6936 def err_atomic_op_bitwise_needs_atomic_int : Error<
6937   "address argument to bitwise atomic operation must be a pointer to "
6938   "%select{|atomic }0integer (%1 invalid)">;
6939 def warn_atomic_op_has_invalid_memory_order : Warning<
6940   "memory order argument to atomic operation is invalid">,
6941   InGroup<DiagGroup<"atomic-memory-ordering">>;
6942
6943 def err_overflow_builtin_must_be_int : Error<
6944   "operand argument to overflow builtin must be an integer (%0 invalid)">;
6945 def err_overflow_builtin_must_be_ptr_int : Error<
6946   "result argument to overflow builtin must be a pointer "
6947   "to a non-const integer (%0 invalid)">;
6948
6949 def err_atomic_load_store_uses_lib : Error<
6950   "atomic %select{load|store}0 requires runtime support that is not "
6951   "available for this target">;
6952
6953 def err_nontemporal_builtin_must_be_pointer : Error<
6954   "address argument to nontemporal builtin must be a pointer (%0 invalid)">;
6955 def err_nontemporal_builtin_must_be_pointer_intfltptr_or_vector : Error<
6956   "address argument to nontemporal builtin must be a pointer to integer, float, "
6957   "pointer, or a vector of such types (%0 invalid)">;
6958
6959 def err_deleted_function_use : Error<"attempt to use a deleted function">;
6960 def err_deleted_inherited_ctor_use : Error<
6961   "constructor inherited by %0 from base class %1 is implicitly deleted">;
6962
6963 def note_called_by : Note<"called by %0">;
6964 def err_kern_type_not_void_return : Error<
6965   "kernel function type %0 must have void return type">;
6966 def err_kern_is_nonstatic_method : Error<
6967   "kernel function %0 must be a free function or static member function">;
6968 def err_config_scalar_return : Error<
6969   "CUDA special function 'cudaConfigureCall' must have scalar return type">;
6970 def err_kern_call_not_global_function : Error<
6971   "kernel call to non-global function %0">;
6972 def err_global_call_not_config : Error<
6973   "call to global function %0 not configured">;
6974 def err_ref_bad_target : Error<
6975   "reference to %select{__device__|__global__|__host__|__host__ __device__}0 "
6976   "function %1 in %select{__device__|__global__|__host__|__host__ __device__}2 function">;
6977 def err_ref_bad_target_global_initializer : Error<
6978   "reference to %select{__device__|__global__|__host__|__host__ __device__}0 "
6979   "function %1 in global initializer">;
6980 def warn_kern_is_method : Extension<
6981   "kernel function %0 is a member function; this may not be accepted by nvcc">,
6982   InGroup<CudaCompat>;
6983 def warn_kern_is_inline : Warning<
6984   "ignored 'inline' attribute on kernel function %0">,
6985   InGroup<CudaCompat>;
6986 def err_variadic_device_fn : Error<
6987   "CUDA device code does not support variadic functions">;
6988 def err_va_arg_in_device : Error<
6989   "CUDA device code does not support va_arg">;
6990 def err_alias_not_supported_on_nvptx : Error<"CUDA does not support aliases">;
6991 def err_cuda_unattributed_constexpr_cannot_overload_device : Error<
6992   "constexpr function '%0' without __host__ or __device__ attributes cannot "
6993   "overload __device__ function with same signature.  Add a __host__ "
6994   "attribute, or build with -fno-cuda-host-device-constexpr.">;
6995 def note_cuda_conflicting_device_function_declared_here : Note<
6996   "conflicting __device__ function declared here">;
6997 def err_cuda_device_exceptions : Error<
6998   "cannot use '%0' in "
6999   "%select{__device__|__global__|__host__|__host__ __device__}1 function">;
7000 def err_dynamic_var_init : Error<
7001     "dynamic initialization is not supported for "
7002     "__device__, __constant__, and __shared__ variables.">;
7003 def err_shared_var_init : Error<
7004     "initialization is not supported for __shared__ variables.">;
7005 def err_device_static_local_var : Error<
7006     "within a %select{__device__|__global__|__host__|__host__ __device__}0 "
7007     "function, only __shared__ variables may be marked 'static'">;
7008 def err_cuda_vla : Error<
7009     "cannot use variable-length arrays in "
7010     "%select{__device__|__global__|__host__|__host__ __device__}0 functions">;
7011 def err_cuda_extern_shared : Error<"__shared__ variable %0 cannot be 'extern'">;
7012 def err_cuda_host_shared : Error<
7013     "__shared__ local variables not allowed in "
7014     "%select{__device__|__global__|__host__|__host__ __device__}0 functions">;
7015 def err_cuda_nonglobal_constant : Error<"__constant__ variables must be global">;
7016 def err_cuda_ovl_target : Error<
7017   "%select{__device__|__global__|__host__|__host__ __device__}0 function %1 "
7018   "cannot overload %select{__device__|__global__|__host__|__host__ __device__}2 function %3">;
7019 def note_cuda_ovl_candidate_target_mismatch : Note<
7020     "candidate template ignored: target attributes do not match">;
7021
7022 def warn_non_pod_vararg_with_format_string : Warning<
7023   "cannot pass %select{non-POD|non-trivial}0 object of type %1 to variadic "
7024   "%select{function|block|method|constructor}2; expected type from format "
7025   "string was %3">, InGroup<NonPODVarargs>, DefaultError;
7026 // The arguments to this diagnostic should match the warning above.
7027 def err_cannot_pass_objc_interface_to_vararg_format : Error<
7028   "cannot pass object with interface type %1 by value to variadic "
7029   "%select{function|block|method|constructor}2; expected type from format "
7030   "string was %3">;
7031
7032 def err_cannot_pass_objc_interface_to_vararg : Error<
7033   "cannot pass object with interface type %0 by value through variadic "
7034   "%select{function|block|method|constructor}1">;
7035 def warn_cannot_pass_non_pod_arg_to_vararg : Warning<
7036   "cannot pass object of %select{non-POD|non-trivial}0 type %1 through variadic"
7037   " %select{function|block|method|constructor}2; call will abort at runtime">,
7038   InGroup<NonPODVarargs>, DefaultError;
7039 def warn_cxx98_compat_pass_non_pod_arg_to_vararg : Warning<
7040   "passing object of trivial but non-POD type %0 through variadic"
7041   " %select{function|block|method|constructor}1 is incompatible with C++98">,
7042   InGroup<CXX98Compat>, DefaultIgnore;
7043 def warn_pass_class_arg_to_vararg : Warning<
7044   "passing object of class type %0 through variadic "
7045   "%select{function|block|method|constructor}1"
7046   "%select{|; did you mean to call '%3'?}2">,
7047   InGroup<ClassVarargs>, DefaultIgnore;
7048 def err_cannot_pass_to_vararg : Error<
7049   "cannot pass %select{expression of type %1|initializer list}0 to variadic "
7050   "%select{function|block|method|constructor}2">;
7051 def err_cannot_pass_to_vararg_format : Error<
7052   "cannot pass %select{expression of type %1|initializer list}0 to variadic "
7053   "%select{function|block|method|constructor}2; expected type from format "
7054   "string was %3">;
7055
7056 def err_typecheck_call_invalid_ordered_compare : Error<
7057   "ordered compare requires two args of floating point type"
7058   "%diff{ ($ and $)|}0,1">;
7059 def err_typecheck_call_invalid_unary_fp : Error<
7060   "floating point classification requires argument of floating point type "
7061   "(passed in %0)">;
7062 def err_typecheck_cond_expect_int_float : Error<
7063   "used type %0 where integer or floating point type is required">;
7064 def err_typecheck_cond_expect_scalar : Error<
7065   "used type %0 where arithmetic or pointer type is required">;
7066 def err_typecheck_cond_expect_nonfloat : Error<
7067   "used type %0 where floating point type is not allowed">;
7068 def ext_typecheck_cond_one_void : Extension<
7069   "C99 forbids conditional expressions with only one void side">;
7070 def err_typecheck_cast_to_incomplete : Error<
7071   "cast to incomplete type %0">;
7072 def ext_typecheck_cast_nonscalar : Extension<
7073   "C99 forbids casting nonscalar type %0 to the same type">;
7074 def ext_typecheck_cast_to_union : Extension<
7075   "cast to union type is a GNU extension">,
7076   InGroup<GNUUnionCast>;
7077 def err_typecheck_cast_to_union_no_type : Error<
7078   "cast to union type from type %0 not present in union">;
7079 def err_cast_pointer_from_non_pointer_int : Error<
7080   "operand of type %0 cannot be cast to a pointer type">;
7081 def warn_cast_pointer_from_sel : Warning<
7082   "cast of type %0 to %1 is deprecated; use sel_getName instead">,
7083   InGroup<SelTypeCast>;
7084 def warn_function_def_in_objc_container : Warning<
7085   "function definition inside an Objective-C container is deprecated">,
7086   InGroup<FunctionDefInObjCContainer>;
7087
7088 def warn_cast_calling_conv : Warning<
7089   "cast between incompatible calling conventions '%0' and '%1'; "
7090   "calls through this pointer may abort at runtime">,
7091   InGroup<DiagGroup<"cast-calling-convention">>;
7092 def note_change_calling_conv_fixit : Note<
7093   "consider defining %0 with the '%1' calling convention">;
7094 def warn_bad_function_cast : Warning<
7095   "cast from function call of type %0 to non-matching type %1">,
7096   InGroup<BadFunctionCast>, DefaultIgnore;
7097 def err_cast_pointer_to_non_pointer_int : Error<
7098   "pointer cannot be cast to type %0">;
7099 def err_typecheck_expect_scalar_operand : Error<
7100   "operand of type %0 where arithmetic or pointer type is required">;
7101 def err_typecheck_cond_incompatible_operands : Error<
7102   "incompatible operand types%diff{ ($ and $)|}0,1">;
7103 def err_cast_selector_expr : Error<
7104   "cannot type cast @selector expression">;
7105 def ext_typecheck_cond_incompatible_pointers : ExtWarn<
7106   "pointer type mismatch%diff{ ($ and $)|}0,1">,
7107   InGroup<DiagGroup<"pointer-type-mismatch">>;
7108 def ext_typecheck_cond_pointer_integer_mismatch : ExtWarn<
7109   "pointer/integer type mismatch in conditional expression"
7110   "%diff{ ($ and $)|}0,1">,
7111   InGroup<DiagGroup<"conditional-type-mismatch">>;
7112 def err_typecheck_choose_expr_requires_constant : Error<
7113   "'__builtin_choose_expr' requires a constant expression">;
7114 def warn_unused_expr : Warning<"expression result unused">,
7115   InGroup<UnusedValue>;
7116 def warn_unused_voidptr : Warning<
7117   "expression result unused; should this cast be to 'void'?">,
7118   InGroup<UnusedValue>;
7119 def warn_unused_property_expr : Warning<
7120  "property access result unused - getters should not be used for side effects">,
7121   InGroup<UnusedGetterReturnValue>;
7122 def warn_unused_container_subscript_expr : Warning<
7123  "container access result unused - container access should not be used for side effects">,
7124   InGroup<UnusedValue>;
7125 def warn_unused_call : Warning<
7126   "ignoring return value of function declared with %0 attribute">,
7127   InGroup<UnusedValue>;
7128 def warn_side_effects_unevaluated_context : Warning<
7129   "expression with side effects has no effect in an unevaluated context">,
7130   InGroup<UnevaluatedExpression>;
7131 def warn_side_effects_typeid : Warning<
7132   "expression with side effects will be evaluated despite being used as an "
7133   "operand to 'typeid'">, InGroup<PotentiallyEvaluatedExpression>;
7134 def warn_unused_result : Warning<
7135   "ignoring return value of function declared with %0 attribute">,
7136   InGroup<UnusedResult>;
7137 def warn_unused_volatile : Warning<
7138   "expression result unused; assign into a variable to force a volatile load">,
7139   InGroup<DiagGroup<"unused-volatile-lvalue">>;
7140
7141 def ext_cxx14_attr : Extension<
7142   "use of the %0 attribute is a C++14 extension">, InGroup<CXX14>;
7143 def ext_cxx1z_attr : Extension<
7144   "use of the %0 attribute is a C++1z extension">, InGroup<CXX1z>;
7145
7146 def warn_unused_comparison : Warning<
7147   "%select{%select{|in}1equality|relational}0 comparison result unused">,
7148   InGroup<UnusedComparison>;
7149 def note_inequality_comparison_to_or_assign : Note<
7150   "use '|=' to turn this inequality comparison into an or-assignment">;
7151
7152 def err_incomplete_type_used_in_type_trait_expr : Error<
7153   "incomplete type %0 used in type trait expression">;
7154
7155 def err_require_constant_init_failed : Error<
7156   "variable does not have a constant initializer">;
7157 def note_declared_required_constant_init_here : Note<
7158   "required by 'require_constant_initialization' attribute here">;
7159
7160 def err_dimension_expr_not_constant_integer : Error<
7161   "dimension expression does not evaluate to a constant unsigned int">;
7162
7163 def err_typecheck_cond_incompatible_operands_null : Error<
7164   "non-pointer operand type %0 incompatible with %select{NULL|nullptr}1">;
7165 def ext_empty_struct_union : Extension<
7166   "empty %select{struct|union}0 is a GNU extension">, InGroup<GNUEmptyStruct>;
7167 def ext_no_named_members_in_struct_union : Extension<
7168   "%select{struct|union}0 without named members is a GNU extension">, InGroup<GNUEmptyStruct>;
7169 def warn_zero_size_struct_union_compat : Warning<"%select{|empty }0"
7170   "%select{struct|union}1 has size 0 in C, %select{size 1|non-zero size}2 in C++">,
7171   InGroup<CXXCompat>, DefaultIgnore;
7172 def warn_zero_size_struct_union_in_extern_c : Warning<"%select{|empty }0"
7173   "%select{struct|union}1 has size 0 in C, %select{size 1|non-zero size}2 in C++">,
7174   InGroup<ExternCCompat>;
7175 def warn_cast_qual : Warning<"cast from %0 to %1 drops %select{const and "
7176   "volatile qualifiers|const qualifier|volatile qualifier}2">,
7177   InGroup<CastQual>, DefaultIgnore;
7178 def warn_cast_qual2 : Warning<"cast from %0 to %1 must have all intermediate "
7179   "pointers const qualified to be safe">, InGroup<CastQual>, DefaultIgnore;
7180 def warn_redefine_extname_not_applied : Warning<
7181   "#pragma redefine_extname is applicable to external C declarations only; "
7182   "not applied to %select{function|variable}0 %1">,
7183   InGroup<Pragmas>;
7184 } // End of general sema category.
7185
7186 // inline asm.
7187 let CategoryName = "Inline Assembly Issue" in {
7188   def err_asm_invalid_lvalue_in_output : Error<"invalid lvalue in asm output">;
7189   def err_asm_invalid_output_constraint : Error<
7190     "invalid output constraint '%0' in asm">;
7191   def err_asm_invalid_lvalue_in_input : Error<
7192     "invalid lvalue in asm input for constraint '%0'">;
7193   def err_asm_invalid_input_constraint : Error<
7194     "invalid input constraint '%0' in asm">;
7195   def err_asm_immediate_expected : Error<"constraint '%0' expects "
7196     "an integer constant expression">;
7197   def err_asm_invalid_type_in_input : Error<
7198     "invalid type %0 in asm input for constraint '%1'">;
7199   def err_asm_tying_incompatible_types : Error<
7200     "unsupported inline asm: input with type "
7201     "%diff{$ matching output with type $|}0,1">;
7202   def err_asm_unexpected_constraint_alternatives : Error<
7203     "asm constraint has an unexpected number of alternatives: %0 vs %1">;
7204   def err_asm_incomplete_type : Error<"asm operand has incomplete type %0">;
7205   def err_asm_unknown_register_name : Error<"unknown register name '%0' in asm">;
7206   def err_asm_invalid_global_var_reg : Error<"register '%0' unsuitable for "
7207     "global register variables on this target">;
7208   def err_asm_register_size_mismatch : Error<"size of register '%0' does not "
7209     "match variable size">;
7210   def err_asm_bad_register_type : Error<"bad type for named register variable">;
7211   def err_asm_invalid_input_size : Error<
7212     "invalid input size for constraint '%0'">;
7213   def err_asm_invalid_output_size : Error<
7214     "invalid output size for constraint '%0'">;
7215   def err_invalid_asm_cast_lvalue : Error<
7216     "invalid use of a cast in a inline asm context requiring an l-value: "
7217     "remove the cast or build with -fheinous-gnu-extensions">;
7218   def err_invalid_asm_value_for_constraint
7219       : Error <"value '%0' out of range for constraint '%1'">;
7220   def err_asm_non_addr_value_in_memory_constraint : Error <
7221     "reference to a %select{bit-field|vector element|global register variable}0"
7222     " in asm %select{input|output}1 with a memory constraint '%2'">;
7223   def err_asm_input_duplicate_match : Error<
7224     "more than one input constraint matches the same output '%0'">;
7225
7226   def warn_asm_label_on_auto_decl : Warning<
7227     "ignored asm label '%0' on automatic variable">;
7228   def warn_invalid_asm_cast_lvalue : Warning<
7229     "invalid use of a cast in an inline asm context requiring an l-value: "
7230     "accepted due to -fheinous-gnu-extensions, but clang may remove support "
7231     "for this in the future">;
7232   def warn_asm_mismatched_size_modifier : Warning<
7233     "value size does not match register size specified by the constraint "
7234     "and modifier">,
7235     InGroup<ASMOperandWidths>;
7236
7237   def note_asm_missing_constraint_modifier : Note<
7238     "use constraint modifier \"%0\"">;
7239   def note_asm_input_duplicate_first : Note<
7240     "constraint '%0' is already present here">;
7241 }
7242
7243   def error_inoutput_conflict_with_clobber : Error<
7244     "asm-specifier for input or output variable conflicts with asm"
7245     " clobber list">;
7246
7247 let CategoryName = "Semantic Issue" in {
7248
7249 def err_invalid_conversion_between_vectors : Error<
7250   "invalid conversion between vector type%diff{ $ and $|}0,1 of different "
7251   "size">;
7252 def err_invalid_conversion_between_vector_and_integer : Error<
7253   "invalid conversion between vector type %0 and integer type %1 "
7254   "of different size">;
7255
7256 def err_opencl_function_pointer_variable : Error<
7257   "pointers to functions are not allowed">;
7258
7259 def err_opencl_taking_function_address : Error<
7260   "taking address of function is not allowed">;
7261
7262 def err_invalid_conversion_between_vector_and_scalar : Error<
7263   "invalid conversion between vector type %0 and scalar type %1">;
7264
7265 // C++ member initializers.
7266 def err_only_constructors_take_base_inits : Error<
7267   "only constructors take base initializers">;
7268
7269 def err_multiple_mem_initialization : Error <
7270   "multiple initializations given for non-static member %0">;
7271 def err_multiple_mem_union_initialization : Error <
7272   "initializing multiple members of union">;
7273 def err_multiple_base_initialization : Error <
7274   "multiple initializations given for base %0">;
7275
7276 def err_mem_init_not_member_or_class : Error<
7277   "member initializer %0 does not name a non-static data member or base "
7278   "class">;
7279
7280 def warn_initializer_out_of_order : Warning<
7281   "%select{field|base class}0 %1 will be initialized after "
7282   "%select{field|base}2 %3">,
7283   InGroup<Reorder>, DefaultIgnore;
7284 def warn_abstract_vbase_init_ignored : Warning<
7285   "initializer for virtual base class %0 of abstract class %1 "
7286   "will never be used">,
7287   InGroup<DiagGroup<"abstract-vbase-init">>, DefaultIgnore;
7288
7289 def err_base_init_does_not_name_class : Error<
7290   "constructor initializer %0 does not name a class">;
7291 def err_base_init_direct_and_virtual : Error<
7292   "base class initializer %0 names both a direct base class and an "
7293   "inherited virtual base class">;
7294 def err_not_direct_base_or_virtual : Error<
7295   "type %0 is not a direct or virtual base of %1">;
7296
7297 def err_in_class_initializer_non_const : Error<
7298   "non-const static data member must be initialized out of line">;
7299 def err_in_class_initializer_volatile : Error<
7300   "static const volatile data member must be initialized out of line">;
7301 def err_in_class_initializer_bad_type : Error<
7302   "static data member of type %0 must be initialized out of line">;
7303 def ext_in_class_initializer_float_type : ExtWarn<
7304   "in-class initializer for static data member of type %0 is a GNU extension">,
7305   InGroup<GNUStaticFloatInit>;
7306 def ext_in_class_initializer_float_type_cxx11 : ExtWarn<
7307   "in-class initializer for static data member of type %0 requires "
7308   "'constexpr' specifier">, InGroup<StaticFloatInit>, DefaultError;
7309 def note_in_class_initializer_float_type_cxx11 : Note<"add 'constexpr'">;
7310 def err_in_class_initializer_literal_type : Error<
7311   "in-class initializer for static data member of type %0 requires "
7312   "'constexpr' specifier">;
7313 def err_in_class_initializer_non_constant : Error<
7314   "in-class initializer for static data member is not a constant expression">;
7315 def err_in_class_initializer_not_yet_parsed : Error<
7316   "default member initializer for %1 needed within definition of enclosing "
7317   "class %0 outside of member functions">;
7318 def note_in_class_initializer_not_yet_parsed : Note<
7319   "default member initializer declared here">;
7320 def err_in_class_initializer_cycle
7321     : Error<"default member initializer for %0 uses itself">;
7322 def err_exception_spec_cycle
7323     : Error<"exception specification of %0 uses itself">;
7324
7325 def ext_in_class_initializer_non_constant : Extension<
7326   "in-class initializer for static data member is not a constant expression; "
7327   "folding it to a constant is a GNU extension">, InGroup<GNUFoldingConstant>;
7328
7329 def err_thread_dynamic_init : Error<
7330   "initializer for thread-local variable must be a constant expression">;
7331 def err_thread_nontrivial_dtor : Error<
7332   "type of thread-local variable has non-trivial destruction">;
7333 def note_use_thread_local : Note<
7334   "use 'thread_local' to allow this">;
7335
7336 // C++ anonymous unions and GNU anonymous structs/unions
7337 def ext_anonymous_union : Extension<
7338   "anonymous unions are a C11 extension">, InGroup<C11>;
7339 def ext_gnu_anonymous_struct : Extension<
7340   "anonymous structs are a GNU extension">, InGroup<GNUAnonymousStruct>;
7341 def ext_c11_anonymous_struct : Extension<
7342   "anonymous structs are a C11 extension">, InGroup<C11>;
7343 def err_anonymous_union_not_static : Error<
7344   "anonymous unions at namespace or global scope must be declared 'static'">;
7345 def err_anonymous_union_with_storage_spec : Error<
7346   "anonymous union at class scope must not have a storage specifier">;
7347 def err_anonymous_struct_not_member : Error<
7348   "anonymous %select{structs|structs and classes}0 must be "
7349   "%select{struct or union|class}0 members">;
7350 def err_anonymous_record_member_redecl : Error<
7351   "member of anonymous %select{struct|union}0 redeclares %1">;
7352 def err_anonymous_record_with_type : Error<
7353   "types cannot be declared in an anonymous %select{struct|union}0">;
7354 def ext_anonymous_record_with_type : Extension<
7355   "types declared in an anonymous %select{struct|union}0 are a Microsoft "
7356   "extension">, InGroup<MicrosoftAnonTag>;
7357 def ext_anonymous_record_with_anonymous_type : Extension<
7358   "anonymous types declared in an anonymous %select{struct|union}0 "
7359   "are an extension">, InGroup<DiagGroup<"nested-anon-types">>;
7360 def err_anonymous_record_with_function : Error<
7361   "functions cannot be declared in an anonymous %select{struct|union}0">;
7362 def err_anonymous_record_with_static : Error<
7363   "static members cannot be declared in an anonymous %select{struct|union}0">;
7364 def err_anonymous_record_bad_member : Error<
7365   "anonymous %select{struct|union}0 can only contain non-static data members">;
7366 def err_anonymous_record_nonpublic_member : Error<
7367   "anonymous %select{struct|union}0 cannot contain a "
7368   "%select{private|protected}1 data member">;
7369 def ext_ms_anonymous_record : ExtWarn<
7370   "anonymous %select{structs|unions}0 are a Microsoft extension">,
7371   InGroup<MicrosoftAnonTag>;
7372
7373 // C++ local classes
7374 def err_reference_to_local_in_enclosing_context : Error<
7375   "reference to local %select{variable|binding}1 %0 declared in enclosing "
7376   "%select{%3|block literal|lambda expression|context}2">;
7377
7378 def err_static_data_member_not_allowed_in_local_class : Error<
7379   "static data member %0 not allowed in local class %1">; 
7380   
7381 // C++ derived classes
7382 def err_base_clause_on_union : Error<"unions cannot have base classes">;
7383 def err_base_must_be_class : Error<"base specifier must name a class">;
7384 def err_union_as_base_class : Error<"unions cannot be base classes">;
7385 def err_circular_inheritance : Error<
7386   "circular inheritance between %0 and %1">;
7387 def err_base_class_has_flexible_array_member : Error<
7388   "base class %0 has a flexible array member">;
7389 def err_incomplete_base_class : Error<"base class has incomplete type">;
7390 def err_duplicate_base_class : Error<
7391   "base class %0 specified more than once as a direct base class">;
7392 def warn_inaccessible_base_class : Warning<
7393   "direct base %0 is inaccessible due to ambiguity:%1">,
7394   InGroup<DiagGroup<"inaccessible-base">>;
7395 // FIXME: better way to display derivation?  Pass entire thing into diagclient?
7396 def err_ambiguous_derived_to_base_conv : Error<
7397   "ambiguous conversion from derived class %0 to base class %1:%2">;
7398 def err_ambiguous_memptr_conv : Error<
7399   "ambiguous conversion from pointer to member of %select{base|derived}0 "
7400   "class %1 to pointer to member of %select{derived|base}0 class %2:%3">;
7401
7402 def err_memptr_conv_via_virtual : Error<
7403   "conversion from pointer to member of class %0 to pointer to member "
7404   "of class %1 via virtual base %2 is not allowed">;
7405
7406 // C++ member name lookup
7407 def err_ambiguous_member_multiple_subobjects : Error<
7408   "non-static member %0 found in multiple base-class subobjects of type %1:%2">;
7409 def err_ambiguous_member_multiple_subobject_types : Error<
7410   "member %0 found in multiple base classes of different types">;
7411 def note_ambiguous_member_found : Note<"member found by ambiguous name lookup">;
7412 def err_ambiguous_reference : Error<"reference to %0 is ambiguous">;
7413 def note_ambiguous_candidate : Note<"candidate found by name lookup is %q0">;
7414 def err_ambiguous_tag_hiding : Error<"a type named %0 is hidden by a "
7415   "declaration in a different namespace">;
7416 def note_hidden_tag : Note<"type declaration hidden">;
7417 def note_hiding_object : Note<"declaration hides type">;
7418
7419 // C++ operator overloading
7420 def err_operator_overload_needs_class_or_enum : Error<
7421   "overloaded %0 must have at least one parameter of class "
7422   "or enumeration type">;
7423
7424 def err_operator_overload_variadic : Error<"overloaded %0 cannot be variadic">;
7425 def err_operator_overload_static : Error<
7426   "overloaded %0 cannot be a static member function">;
7427 def err_operator_overload_default_arg : Error<
7428   "parameter of overloaded %0 cannot have a default argument">;
7429 def err_operator_overload_must_be : Error<
7430   "overloaded %0 must be a %select{unary|binary|unary or binary}2 operator "
7431   "(has %1 parameter%s1)">;
7432
7433 def err_operator_overload_must_be_member : Error<
7434   "overloaded %0 must be a non-static member function">;
7435 def err_operator_overload_post_incdec_must_be_int : Error<
7436   "parameter of overloaded post-%select{increment|decrement}1 operator must "
7437   "have type 'int' (not %0)">;
7438
7439 // C++ allocation and deallocation functions.
7440 def err_operator_new_delete_declared_in_namespace : Error<
7441   "%0 cannot be declared inside a namespace">;
7442 def err_operator_new_delete_declared_static : Error<
7443   "%0 cannot be declared static in global scope">;
7444 def ext_operator_new_delete_declared_inline : ExtWarn<
7445   "replacement function %0 cannot be declared 'inline'">,
7446   InGroup<DiagGroup<"inline-new-delete">>;
7447 def err_operator_new_delete_invalid_result_type : Error<
7448   "%0 must return type %1">;
7449 def err_operator_new_delete_dependent_result_type : Error<
7450   "%0 cannot have a dependent return type; use %1 instead">;
7451 def err_operator_new_delete_too_few_parameters : Error<
7452   "%0 must have at least one parameter">;
7453 def err_operator_new_delete_template_too_few_parameters : Error<
7454   "%0 template must have at least two parameters">;
7455 def warn_operator_new_returns_null : Warning<
7456   "%0 should not return a null pointer unless it is declared 'throw()'"
7457   "%select{| or 'noexcept'}1">, InGroup<OperatorNewReturnsNull>;
7458
7459 def err_operator_new_dependent_param_type : Error<
7460   "%0 cannot take a dependent type as first parameter; "
7461   "use size_t (%1) instead">;
7462 def err_operator_new_param_type : Error<
7463   "%0 takes type size_t (%1) as first parameter">;
7464 def err_operator_new_default_arg: Error<
7465   "parameter of %0 cannot have a default argument">;
7466 def err_operator_delete_dependent_param_type : Error<
7467   "%0 cannot take a dependent type as first parameter; use %1 instead">;
7468 def err_operator_delete_param_type : Error<
7469   "first parameter of %0 must have type %1">;
7470
7471 // C++ literal operators
7472 def err_literal_operator_outside_namespace : Error<
7473   "literal operator %0 must be in a namespace or global scope">;
7474 def err_literal_operator_id_outside_namespace : Error<
7475   "non-namespace scope '%0' cannot have a literal operator member">;
7476 def err_literal_operator_default_argument : Error<
7477   "literal operator cannot have a default argument">;
7478 def err_literal_operator_bad_param_count : Error<
7479   "non-template literal operator must have one or two parameters">;
7480 def err_literal_operator_invalid_param : Error<
7481   "parameter of literal operator must have type 'unsigned long long', 'long double', 'char', 'wchar_t', 'char16_t', 'char32_t', or 'const char *'">;
7482 def err_literal_operator_param : Error<
7483   "invalid literal operator parameter type %0, did you mean %1?">;
7484 def err_literal_operator_template_with_params : Error<
7485   "literal operator template cannot have any parameters">;
7486 def err_literal_operator_template : Error<
7487   "template parameter list for literal operator must be either 'char...' or 'typename T, T...'">;
7488 def err_literal_operator_extern_c : Error<
7489   "literal operator must have C++ linkage">;
7490 def ext_string_literal_operator_template : ExtWarn<
7491   "string literal operator templates are a GNU extension">,
7492   InGroup<GNUStringLiteralOperatorTemplate>;
7493 def warn_user_literal_reserved : Warning<
7494   "user-defined literal suffixes not starting with '_' are reserved"
7495   "%select{; no literal will invoke this operator|}0">,
7496   InGroup<UserDefinedLiterals>;
7497
7498 // C++ conversion functions
7499 def err_conv_function_not_member : Error<
7500   "conversion function must be a non-static member function">;
7501 def err_conv_function_return_type : Error<
7502   "conversion function cannot have a return type">;
7503 def err_conv_function_with_params : Error<
7504   "conversion function cannot have any parameters">;
7505 def err_conv_function_variadic : Error<
7506   "conversion function cannot be variadic">;
7507 def err_conv_function_to_array : Error<
7508   "conversion function cannot convert to an array type">;
7509 def err_conv_function_to_function : Error<
7510   "conversion function cannot convert to a function type">;
7511 def err_conv_function_with_complex_decl : Error<
7512   "cannot specify any part of a return type in the "
7513   "declaration of a conversion function"
7514   "%select{"
7515   "; put the complete type after 'operator'|"
7516   "; use a typedef to declare a conversion to %1|"
7517   "; use an alias template to declare a conversion to %1|"
7518   "}0">;
7519 def err_conv_function_redeclared : Error<
7520   "conversion function cannot be redeclared">;
7521 def warn_conv_to_self_not_used : Warning<
7522   "conversion function converting %0 to itself will never be used">;
7523 def warn_conv_to_base_not_used : Warning<
7524   "conversion function converting %0 to its base class %1 will never be used">;
7525 def warn_conv_to_void_not_used : Warning<
7526   "conversion function converting %0 to %1 will never be used">;
7527
7528 def warn_not_compound_assign : Warning<
7529   "use of unary operator that may be intended as compound assignment (%0=)">;
7530
7531 // C++11 explicit conversion operators
7532 def ext_explicit_conversion_functions : ExtWarn<
7533   "explicit conversion functions are a C++11 extension">, InGroup<CXX11>;
7534 def warn_cxx98_compat_explicit_conversion_functions : Warning<
7535   "explicit conversion functions are incompatible with C++98">,
7536   InGroup<CXX98Compat>, DefaultIgnore;
7537
7538 // C++11 defaulted functions
7539 def err_defaulted_special_member_params : Error<
7540   "an explicitly-defaulted %select{|copy |move }0constructor cannot "
7541   "have default arguments">;
7542 def err_defaulted_special_member_variadic : Error<
7543   "an explicitly-defaulted %select{|copy |move }0constructor cannot "
7544   "be variadic">;
7545 def err_defaulted_special_member_return_type : Error<
7546   "explicitly-defaulted %select{copy|move}0 assignment operator must "
7547   "return %1">;
7548 def err_defaulted_special_member_quals : Error<
7549   "an explicitly-defaulted %select{copy|move}0 assignment operator may not "
7550   "have 'const'%select{, 'constexpr'|}1 or 'volatile' qualifiers">;
7551 def err_defaulted_special_member_volatile_param : Error<
7552   "the parameter for an explicitly-defaulted %select{<<ERROR>>|"
7553   "copy constructor|move constructor|copy assignment operator|"
7554   "move assignment operator|<<ERROR>>}0 may not be volatile">;
7555 def err_defaulted_special_member_move_const_param : Error<
7556   "the parameter for an explicitly-defaulted move "
7557   "%select{constructor|assignment operator}0 may not be const">;
7558 def err_defaulted_special_member_copy_const_param : Error<
7559   "the parameter for this explicitly-defaulted copy "
7560   "%select{constructor|assignment operator}0 is const, but a member or base "
7561   "requires it to be non-const">;
7562 def err_defaulted_copy_assign_not_ref : Error<
7563   "the parameter for an explicitly-defaulted copy assignment operator must be an "
7564   "lvalue reference type">;
7565 def err_incorrect_defaulted_exception_spec : Error<
7566   "exception specification of explicitly defaulted %select{default constructor|"
7567   "copy constructor|move constructor|copy assignment operator|move assignment "
7568   "operator|destructor}0 does not match the "
7569   "calculated one">;
7570 def err_incorrect_defaulted_constexpr : Error<
7571   "defaulted definition of %select{default constructor|copy constructor|"
7572   "move constructor|copy assignment operator|move assignment operator}0 "
7573   "is not constexpr">;
7574 def err_out_of_line_default_deletes : Error<
7575   "defaulting this %select{default constructor|copy constructor|move "
7576   "constructor|copy assignment operator|move assignment operator|destructor}0 "
7577   "would delete it after its first declaration">;
7578 def warn_vbase_moved_multiple_times : Warning<
7579   "defaulted move assignment operator of %0 will move assign virtual base "
7580   "class %1 multiple times">, InGroup<DiagGroup<"multiple-move-vbase">>;
7581 def note_vbase_moved_here : Note<
7582   "%select{%1 is a virtual base class of base class %2 declared here|"
7583   "virtual base class %1 declared here}0">;
7584
7585 def ext_implicit_exception_spec_mismatch : ExtWarn<
7586   "function previously declared with an %select{explicit|implicit}0 exception "
7587   "specification redeclared with an %select{implicit|explicit}0 exception "
7588   "specification">, InGroup<DiagGroup<"implicit-exception-spec-mismatch">>;
7589
7590 def warn_ptr_arith_precedes_bounds : Warning<
7591   "the pointer decremented by %0 refers before the beginning of the array">,
7592   InGroup<ArrayBoundsPointerArithmetic>, DefaultIgnore;
7593 def warn_ptr_arith_exceeds_bounds : Warning<
7594   "the pointer incremented by %0 refers past the end of the array (that "
7595   "contains %1 element%s2)">,
7596   InGroup<ArrayBoundsPointerArithmetic>, DefaultIgnore;
7597 def warn_array_index_precedes_bounds : Warning<
7598   "array index %0 is before the beginning of the array">,
7599   InGroup<ArrayBounds>;
7600 def warn_array_index_exceeds_bounds : Warning<
7601   "array index %0 is past the end of the array (which contains %1 "
7602   "element%s2)">, InGroup<ArrayBounds>;
7603 def note_array_index_out_of_bounds : Note<
7604   "array %0 declared here">;
7605
7606 def warn_printf_insufficient_data_args : Warning<
7607   "more '%%' conversions than data arguments">, InGroup<Format>;
7608 def warn_printf_data_arg_not_used : Warning<
7609   "data argument not used by format string">, InGroup<FormatExtraArgs>;
7610 def warn_format_invalid_conversion : Warning<
7611   "invalid conversion specifier '%0'">, InGroup<FormatInvalidSpecifier>;
7612 def warn_printf_incomplete_specifier : Warning<
7613   "incomplete format specifier">, InGroup<Format>;
7614 def warn_missing_format_string : Warning<
7615   "format string missing">, InGroup<Format>;
7616 def warn_scanf_nonzero_width : Warning<
7617   "zero field width in scanf format string is unused">,
7618   InGroup<Format>;
7619 def warn_format_conversion_argument_type_mismatch : Warning<
7620   "format specifies type %0 but the argument has "
7621   "%select{type|underlying type}2 %1">,
7622   InGroup<Format>;
7623 def warn_format_conversion_argument_type_mismatch_pedantic : Extension<
7624   "format specifies type %0 but the argument has "
7625   "%select{type|underlying type}2 %1">,
7626   InGroup<FormatPedantic>;
7627 def warn_format_argument_needs_cast : Warning<
7628   "%select{values of type|enum values with underlying type}2 '%0' should not "
7629   "be used as format arguments; add an explicit cast to %1 instead">,
7630   InGroup<Format>;
7631 def warn_printf_positional_arg_exceeds_data_args : Warning <
7632   "data argument position '%0' exceeds the number of data arguments (%1)">,
7633   InGroup<Format>;
7634 def warn_format_zero_positional_specifier : Warning<
7635   "position arguments in format strings start counting at 1 (not 0)">,
7636   InGroup<Format>;
7637 def warn_format_invalid_positional_specifier : Warning<
7638   "invalid position specified for %select{field width|field precision}0">,
7639   InGroup<Format>;
7640 def warn_format_mix_positional_nonpositional_args : Warning<
7641   "cannot mix positional and non-positional arguments in format string">,
7642   InGroup<Format>;
7643 def warn_static_array_too_small : Warning<
7644   "array argument is too small; contains %0 elements, callee requires at least %1">,
7645   InGroup<ArrayBounds>;
7646 def note_callee_static_array : Note<
7647   "callee declares array parameter as static here">;
7648 def warn_empty_format_string : Warning<
7649   "format string is empty">, InGroup<FormatZeroLength>;
7650 def warn_format_string_is_wide_literal : Warning<
7651   "format string should not be a wide string">, InGroup<Format>;
7652 def warn_printf_format_string_contains_null_char : Warning<
7653   "format string contains '\\0' within the string body">, InGroup<Format>;
7654 def warn_printf_format_string_not_null_terminated : Warning<
7655   "format string is not null-terminated">, InGroup<Format>;
7656 def warn_printf_asterisk_missing_arg : Warning<
7657   "'%select{*|.*}0' specified field %select{width|precision}0 is missing a matching 'int' argument">,
7658   InGroup<Format>;
7659 def warn_printf_asterisk_wrong_type : Warning<
7660   "field %select{width|precision}0 should have type %1, but argument has type %2">,
7661   InGroup<Format>;
7662 def warn_printf_nonsensical_optional_amount: Warning<
7663   "%select{field width|precision}0 used with '%1' conversion specifier, resulting in undefined behavior">,
7664   InGroup<Format>;
7665 def warn_printf_nonsensical_flag: Warning<
7666   "flag '%0' results in undefined behavior with '%1' conversion specifier">,
7667   InGroup<Format>;
7668 def warn_format_nonsensical_length: Warning<
7669   "length modifier '%0' results in undefined behavior or no effect with '%1' conversion specifier">,
7670   InGroup<Format>;
7671 def warn_format_non_standard_positional_arg: Warning<
7672   "positional arguments are not supported by ISO C">, InGroup<FormatNonStandard>, DefaultIgnore;
7673 def warn_format_non_standard: Warning<
7674   "'%0' %select{length modifier|conversion specifier}1 is not supported by ISO C">,
7675   InGroup<FormatNonStandard>, DefaultIgnore;
7676 def warn_format_non_standard_conversion_spec: Warning<
7677   "using length modifier '%0' with conversion specifier '%1' is not supported by ISO C">,
7678   InGroup<FormatNonStandard>, DefaultIgnore;
7679 def warn_format_invalid_annotation : Warning<
7680   "using '%0' format specifier annotation outside of os_log()/os_trace()">,
7681   InGroup<Format>;
7682 def warn_format_P_no_precision : Warning<
7683   "using '%%P' format specifier without precision">,
7684   InGroup<Format>;
7685 def warn_printf_ignored_flag: Warning<
7686   "flag '%0' is ignored when flag '%1' is present">,
7687   InGroup<Format>;
7688 def warn_printf_empty_objc_flag: Warning<
7689   "missing object format flag">,
7690   InGroup<Format>;
7691 def warn_printf_ObjCflags_without_ObjCConversion: Warning<
7692   "object format flags cannot be used with '%0' conversion specifier">,
7693   InGroup<Format>;
7694 def warn_printf_invalid_objc_flag: Warning<
7695     "'%0' is not a valid object format flag">,
7696     InGroup<Format>;
7697 def warn_scanf_scanlist_incomplete : Warning<
7698   "no closing ']' for '%%[' in scanf format string">,
7699   InGroup<Format>;
7700 def note_format_string_defined : Note<"format string is defined here">;
7701 def note_format_fix_specifier : Note<"did you mean to use '%0'?">;
7702 def note_printf_c_str: Note<"did you mean to call the %0 method?">;
7703 def note_format_security_fixit: Note<
7704   "treat the string as an argument to avoid this">;
7705
7706 def warn_null_arg : Warning<
7707   "null passed to a callee that requires a non-null argument">,
7708   InGroup<NonNull>;
7709 def warn_null_ret : Warning<
7710   "null returned from %select{function|method}0 that requires a non-null return value">,
7711   InGroup<NonNull>;
7712
7713 // CHECK: returning address/reference of stack memory
7714 def warn_ret_stack_addr_ref : Warning<
7715   "%select{address of|reference to}0 stack memory associated with local "
7716   "variable %1 returned">,
7717   InGroup<ReturnStackAddress>;
7718 def warn_ret_local_temp_addr_ref : Warning<
7719   "returning %select{address of|reference to}0 local temporary object">,
7720   InGroup<ReturnStackAddress>;
7721 def warn_ret_addr_label : Warning<
7722   "returning address of label, which is local">,
7723   InGroup<ReturnStackAddress>;
7724 def err_ret_local_block : Error<
7725   "returning block that lives on the local stack">;
7726 def note_ref_var_local_bind : Note<
7727   "binding reference variable %0 here">;
7728
7729 // Check for initializing a member variable with the address or a reference to
7730 // a constructor parameter.
7731 def warn_bind_ref_member_to_parameter : Warning<
7732   "binding reference member %0 to stack allocated parameter %1">,
7733   InGroup<DanglingField>;
7734 def warn_init_ptr_member_to_parameter_addr : Warning<
7735   "initializing pointer member %0 with the stack address of parameter %1">,
7736   InGroup<DanglingField>;
7737 def warn_bind_ref_member_to_temporary : Warning<
7738   "binding reference %select{|subobject of }1member %0 to a temporary value">,
7739   InGroup<DanglingField>;
7740 def note_ref_or_ptr_member_declared_here : Note<
7741   "%select{reference|pointer}0 member declared here">;
7742 def note_ref_subobject_of_member_declared_here : Note<
7743   "member with reference subobject declared here">;
7744
7745 // For non-floating point, expressions of the form x == x or x != x
7746 // should result in a warning, since these always evaluate to a constant.
7747 // Array comparisons have similar warnings
7748 def warn_comparison_always : Warning<
7749   "%select{self-|array }0comparison always evaluates to %select{false|true|a constant}1">,
7750   InGroup<TautologicalCompare>;
7751 def warn_comparison_bitwise_always : Warning<
7752   "bitwise comparison always evaluates to %select{false|true}0">,
7753   InGroup<TautologicalCompare>;
7754 def warn_tautological_overlap_comparison : Warning<
7755   "overlapping comparisons always evaluate to %select{false|true}0">,
7756   InGroup<TautologicalOverlapCompare>, DefaultIgnore;
7757
7758 def warn_stringcompare : Warning<
7759   "result of comparison against %select{a string literal|@encode}0 is "
7760   "unspecified (use strncmp instead)">,
7761   InGroup<StringCompare>;
7762
7763 def warn_identity_field_assign : Warning<
7764   "assigning %select{field|instance variable}0 to itself">,
7765   InGroup<SelfAssignmentField>;
7766
7767 // Type safety attributes
7768 def err_type_tag_for_datatype_not_ice : Error<
7769   "'type_tag_for_datatype' attribute requires the initializer to be "
7770   "an %select{integer|integral}0 constant expression">;
7771 def err_type_tag_for_datatype_too_large : Error<
7772   "'type_tag_for_datatype' attribute requires the initializer to be "
7773   "an %select{integer|integral}0 constant expression "
7774   "that can be represented by a 64 bit integer">;
7775 def warn_type_tag_for_datatype_wrong_kind : Warning<
7776   "this type tag was not designed to be used with this function">,
7777   InGroup<TypeSafety>;
7778 def warn_type_safety_type_mismatch : Warning<
7779   "argument type %0 doesn't match specified %1 type tag "
7780   "%select{that requires %3|}2">, InGroup<TypeSafety>;
7781 def warn_type_safety_null_pointer_required : Warning<
7782   "specified %0 type tag requires a null pointer">, InGroup<TypeSafety>;
7783
7784 // Generic selections.
7785 def err_assoc_type_incomplete : Error<
7786   "type %0 in generic association incomplete">;
7787 def err_assoc_type_nonobject : Error<
7788   "type %0 in generic association not an object type">;
7789 def err_assoc_type_variably_modified : Error<
7790   "type %0 in generic association is a variably modified type">;
7791 def err_assoc_compatible_types : Error<
7792   "type %0 in generic association compatible with previously specified type %1">;
7793 def note_compat_assoc : Note<
7794   "compatible type %0 specified here">;
7795 def err_generic_sel_no_match : Error<
7796   "controlling expression type %0 not compatible with any generic association type">;
7797 def err_generic_sel_multi_match : Error<
7798   "controlling expression type %0 compatible with %1 generic association types">;
7799
7800
7801 // Blocks
7802 def err_blocks_disable : Error<"blocks support disabled - compile with -fblocks"
7803   " or %select{pick a deployment target that supports them|for OpenCL 2.0 or above}0">;
7804 def err_block_returning_array_function : Error<
7805   "block cannot return %select{array|function}0 type %1">;
7806
7807 // Builtin annotation
7808 def err_builtin_annotation_first_arg : Error<
7809   "first argument to __builtin_annotation must be an integer">;
7810 def err_builtin_annotation_second_arg : Error<
7811   "second argument to __builtin_annotation must be a non-wide string constant">;
7812
7813 // CFString checking
7814 def err_cfstring_literal_not_string_constant : Error<
7815   "CFString literal is not a string constant">;
7816 def warn_cfstring_truncated : Warning<
7817   "input conversion stopped due to an input byte that does not "
7818   "belong to the input codeset UTF-8">,
7819   InGroup<DiagGroup<"CFString-literal">>;
7820
7821 // os_log checking
7822 // TODO: separate diagnostic for os_trace()
7823 def err_os_log_format_not_string_constant : Error<
7824   "os_log() format argument is not a string constant">;
7825 def err_os_log_argument_too_big : Error<
7826   "os_log() argument %0 is too big (%1 bytes, max %2)">;
7827 def warn_os_log_format_narg : Error<
7828  "os_log() '%%n' format specifier is not allowed">, DefaultError;
7829
7830 // Statements.
7831 def err_continue_not_in_loop : Error<
7832   "'continue' statement not in loop statement">;
7833 def err_break_not_in_loop_or_switch : Error<
7834   "'break' statement not in loop or switch statement">;
7835 def warn_loop_ctrl_binds_to_inner : Warning<
7836   "'%0' is bound to current loop, GCC binds it to the enclosing loop">,
7837   InGroup<GccCompat>;
7838 def warn_break_binds_to_switch : Warning<
7839   "'break' is bound to loop, GCC binds it to switch">,
7840   InGroup<GccCompat>;
7841 def err_default_not_in_switch : Error<
7842   "'default' statement not in switch statement">;
7843 def err_case_not_in_switch : Error<"'case' statement not in switch statement">;
7844 def warn_bool_switch_condition : Warning<
7845   "switch condition has boolean value">, InGroup<SwitchBool>;
7846 def warn_case_value_overflow : Warning<
7847   "overflow converting case value to switch condition type (%0 to %1)">,
7848   InGroup<Switch>;
7849 def err_duplicate_case : Error<"duplicate case value '%0'">;
7850 def err_duplicate_case_differing_expr : Error<
7851   "duplicate case value: '%0' and '%1' both equal '%2'">;
7852 def warn_case_empty_range : Warning<"empty case range specified">;
7853 def warn_missing_case_for_condition :
7854   Warning<"no case matching constant switch condition '%0'">;
7855
7856 def warn_def_missing_case : Warning<"%plural{"
7857   "1:enumeration value %1 not explicitly handled in switch|"
7858   "2:enumeration values %1 and %2 not explicitly handled in switch|"
7859   "3:enumeration values %1, %2, and %3 not explicitly handled in switch|"
7860   ":%0 enumeration values not explicitly handled in switch: %1, %2, %3...}0">,
7861   InGroup<SwitchEnum>, DefaultIgnore;
7862
7863 def warn_missing_case : Warning<"%plural{"
7864   "1:enumeration value %1 not handled in switch|"
7865   "2:enumeration values %1 and %2 not handled in switch|"
7866   "3:enumeration values %1, %2, and %3 not handled in switch|"
7867   ":%0 enumeration values not handled in switch: %1, %2, %3...}0">,
7868   InGroup<Switch>;
7869
7870 def warn_unannotated_fallthrough : Warning<
7871   "unannotated fall-through between switch labels">,
7872   InGroup<ImplicitFallthrough>, DefaultIgnore;
7873 def warn_unannotated_fallthrough_per_function : Warning<
7874   "unannotated fall-through between switch labels in partly-annotated "
7875   "function">, InGroup<ImplicitFallthroughPerFunction>, DefaultIgnore;
7876 def note_insert_fallthrough_fixit : Note<
7877   "insert '%0;' to silence this warning">;
7878 def note_insert_break_fixit : Note<
7879   "insert 'break;' to avoid fall-through">;
7880 def err_fallthrough_attr_wrong_target : Error<
7881   "%0 attribute is only allowed on empty statements">;
7882 def note_fallthrough_insert_semi_fixit : Note<"did you forget ';'?">;
7883 def err_fallthrough_attr_outside_switch : Error<
7884   "fallthrough annotation is outside switch statement">;
7885 def err_fallthrough_attr_invalid_placement : Error<
7886   "fallthrough annotation does not directly precede switch label">;
7887 def warn_fallthrough_attr_unreachable : Warning<
7888   "fallthrough annotation in unreachable code">,
7889   InGroup<ImplicitFallthrough>, DefaultIgnore;
7890
7891 def warn_unreachable_default : Warning<
7892   "default label in switch which covers all enumeration values">,
7893   InGroup<CoveredSwitchDefault>, DefaultIgnore;
7894 def warn_not_in_enum : Warning<"case value not in enumerated type %0">,
7895   InGroup<Switch>;
7896 def warn_not_in_enum_assignment : Warning<"integer constant not in range "
7897   "of enumerated type %0">, InGroup<DiagGroup<"assign-enum">>, DefaultIgnore;
7898 def err_typecheck_statement_requires_scalar : Error<
7899   "statement requires expression of scalar type (%0 invalid)">;
7900 def err_typecheck_statement_requires_integer : Error<
7901   "statement requires expression of integer type (%0 invalid)">;
7902 def err_multiple_default_labels_defined : Error<
7903   "multiple default labels in one switch">;
7904 def err_switch_multiple_conversions : Error<
7905   "multiple conversions from switch condition type %0 to an integral or "
7906   "enumeration type">;
7907 def note_switch_conversion : Note<
7908   "conversion to %select{integral|enumeration}0 type %1">;
7909 def err_switch_explicit_conversion : Error<
7910   "switch condition type %0 requires explicit conversion to %1">;
7911 def err_switch_incomplete_class_type : Error<
7912   "switch condition has incomplete class type %0">;
7913
7914 def warn_empty_if_body : Warning<
7915   "if statement has empty body">, InGroup<EmptyBody>;
7916 def warn_empty_for_body : Warning<
7917   "for loop has empty body">, InGroup<EmptyBody>;
7918 def warn_empty_range_based_for_body : Warning<
7919   "range-based for loop has empty body">, InGroup<EmptyBody>;
7920 def warn_empty_while_body : Warning<
7921   "while loop has empty body">, InGroup<EmptyBody>;
7922 def warn_empty_switch_body : Warning<
7923   "switch statement has empty body">, InGroup<EmptyBody>;
7924 def note_empty_body_on_separate_line : Note<
7925   "put the semicolon on a separate line to silence this warning">;
7926
7927 def err_va_start_captured_stmt : Error<
7928   "'va_start' cannot be used in a captured statement">;
7929 def err_va_start_outside_function : Error<
7930   "'va_start' cannot be used outside a function">;
7931 def err_va_start_fixed_function : Error<
7932   "'va_start' used in function with fixed args">;
7933 def err_va_start_used_in_wrong_abi_function : Error<
7934   "'va_start' used in %select{System V|Win64}0 ABI function">;
7935 def err_ms_va_start_used_in_sysv_function : Error<
7936   "'__builtin_ms_va_start' used in System V ABI function">;
7937 def warn_second_arg_of_va_start_not_last_named_param : Warning<
7938   "second argument to 'va_start' is not the last named parameter">,
7939   InGroup<Varargs>;
7940 def warn_va_start_type_is_undefined : Warning<
7941   "passing %select{an object that undergoes default argument promotion|"
7942   "an object of reference type|a parameter declared with the 'register' "
7943   "keyword}0 to 'va_start' has undefined behavior">, InGroup<Varargs>;
7944 def err_first_argument_to_va_arg_not_of_type_va_list : Error<
7945   "first argument to 'va_arg' is of type %0 and not 'va_list'">;
7946 def err_second_parameter_to_va_arg_incomplete: Error<
7947   "second argument to 'va_arg' is of incomplete type %0">;
7948 def err_second_parameter_to_va_arg_abstract: Error<
7949   "second argument to 'va_arg' is of abstract type %0">;
7950 def warn_second_parameter_to_va_arg_not_pod : Warning<
7951   "second argument to 'va_arg' is of non-POD type %0">,
7952   InGroup<NonPODVarargs>, DefaultError;
7953 def warn_second_parameter_to_va_arg_ownership_qualified : Warning<
7954   "second argument to 'va_arg' is of ARC ownership-qualified type %0">,
7955   InGroup<NonPODVarargs>, DefaultError;
7956 def warn_second_parameter_to_va_arg_never_compatible : Warning<
7957   "second argument to 'va_arg' is of promotable type %0; this va_arg has "
7958   "undefined behavior because arguments will be promoted to %1">, InGroup<Varargs>;
7959
7960 def warn_return_missing_expr : Warning<
7961   "non-void %select{function|method}1 %0 should return a value">, DefaultError,
7962   InGroup<ReturnType>;
7963 def ext_return_missing_expr : ExtWarn<
7964   "non-void %select{function|method}1 %0 should return a value">, DefaultError,
7965   InGroup<ReturnType>;
7966 def ext_return_has_expr : ExtWarn<
7967   "%select{void function|void method|constructor|destructor}1 %0 "
7968   "should not return a value">,
7969   DefaultError, InGroup<ReturnType>;
7970 def ext_return_has_void_expr : Extension<
7971   "void %select{function|method|block}1 %0 should not return void expression">;
7972 def err_return_init_list : Error<
7973   "%select{void function|void method|constructor|destructor}1 %0 "
7974   "must not return a value">;
7975 def err_ctor_dtor_returns_void : Error<
7976   "%select{constructor|destructor}1 %0 must not return void expression">;
7977 def warn_noreturn_function_has_return_expr : Warning<
7978   "function %0 declared 'noreturn' should not return">,
7979   InGroup<InvalidNoreturn>;
7980 def warn_falloff_noreturn_function : Warning<
7981   "function declared 'noreturn' should not return">,
7982   InGroup<InvalidNoreturn>;
7983 def err_noreturn_block_has_return_expr : Error<
7984   "block declared 'noreturn' should not return">;
7985 def err_noreturn_missing_on_first_decl : Error<
7986   "function declared '[[noreturn]]' after its first declaration">;
7987 def note_noreturn_missing_first_decl : Note<
7988   "declaration missing '[[noreturn]]' attribute is here">;
7989 def err_carries_dependency_missing_on_first_decl : Error<
7990   "%select{function|parameter}0 declared '[[carries_dependency]]' "
7991   "after its first declaration">;
7992 def note_carries_dependency_missing_first_decl : Note<
7993   "declaration missing '[[carries_dependency]]' attribute is here">;
7994 def err_carries_dependency_param_not_function_decl : Error<
7995   "'[[carries_dependency]]' attribute only allowed on parameter in a function "
7996   "declaration or lambda">;
7997 def err_block_on_nonlocal : Error<
7998   "__block attribute not allowed, only allowed on local variables">;
7999 def err_block_on_vm : Error<
8000   "__block attribute not allowed on declaration with a variably modified type">;
8001
8002 def err_shufflevector_non_vector : Error<
8003   "first two arguments to __builtin_shufflevector must be vectors">;
8004 def err_shufflevector_incompatible_vector : Error<
8005   "first two arguments to __builtin_shufflevector must have the same type">;
8006 def err_shufflevector_nonconstant_argument : Error<
8007   "index for __builtin_shufflevector must be a constant integer">;
8008 def err_shufflevector_argument_too_large : Error<
8009   "index for __builtin_shufflevector must be less than the total number "
8010   "of vector elements">;
8011
8012 def err_convertvector_non_vector : Error<
8013   "first argument to __builtin_convertvector must be a vector">;
8014 def err_convertvector_non_vector_type : Error<
8015   "second argument to __builtin_convertvector must be a vector type">;
8016 def err_convertvector_incompatible_vector : Error<
8017   "first two arguments to __builtin_convertvector must have the same number of elements">;
8018
8019 def err_first_argument_to_cwsc_not_call : Error<
8020   "first argument to __builtin_call_with_static_chain must be a non-member call expression">;
8021 def err_first_argument_to_cwsc_block_call : Error<
8022   "first argument to __builtin_call_with_static_chain must not be a block call">;
8023 def err_first_argument_to_cwsc_builtin_call : Error<
8024   "first argument to __builtin_call_with_static_chain must not be a builtin call">;
8025 def err_first_argument_to_cwsc_pdtor_call : Error<
8026   "first argument to __builtin_call_with_static_chain must not be a pseudo-destructor call">;
8027 def err_second_argument_to_cwsc_not_pointer : Error<
8028   "second argument to __builtin_call_with_static_chain must be of pointer type">;
8029
8030 def err_vector_incorrect_num_initializers : Error<
8031   "%select{too many|too few}0 elements in vector initialization (expected %1 elements, have %2)">;
8032 def err_altivec_empty_initializer : Error<"expected initializer">;
8033
8034 def err_invalid_neon_type_code : Error<
8035   "incompatible constant for this __builtin_neon function">; 
8036 def err_argument_invalid_range : Error<
8037   "argument should be a value from %0 to %1">;
8038 def err_argument_not_multiple : Error<
8039   "argument should be a multiple of %0">;
8040 def warn_neon_vector_initializer_non_portable : Warning<
8041   "vector initializers are not compatible with NEON intrinsics in big endian "
8042   "mode">, InGroup<DiagGroup<"nonportable-vector-initialization">>;
8043 def note_neon_vector_initializer_non_portable : Note<
8044   "consider using vld1_%0%1() to initialize a vector from memory, or "
8045   "vcreate_%0%1() to initialize from an integer constant">;
8046 def note_neon_vector_initializer_non_portable_q : Note<
8047   "consider using vld1q_%0%1() to initialize a vector from memory, or "
8048   "vcombine_%0%1(vcreate_%0%1(), vcreate_%0%1()) to initialize from integer "
8049   "constants">;
8050 def err_systemz_invalid_tabort_code : Error<
8051   "invalid transaction abort code">;
8052 def err_64_bit_builtin_32_bit_tgt : Error<
8053   "this builtin is only available on 64-bit targets">;
8054 def err_ppc_builtin_only_on_pwr7 : Error<
8055   "this builtin is only valid on POWER7 or later CPUs">;
8056 def err_x86_builtin_64_only : Error<
8057   "this builtin is only available on x86-64 targets">;
8058 def err_x86_builtin_invalid_rounding : Error<
8059   "invalid rounding argument">;
8060 def err_x86_builtin_invalid_scale : Error<
8061   "scale argument must be 1, 2, 4, or 8">;
8062
8063 def err_builtin_longjmp_unsupported : Error<
8064   "__builtin_longjmp is not supported for the current target">;
8065 def err_builtin_setjmp_unsupported : Error<
8066   "__builtin_setjmp is not supported for the current target">;
8067
8068 def err_builtin_longjmp_invalid_val : Error<
8069   "argument to __builtin_longjmp must be a constant 1">;
8070 def err_builtin_requires_language : Error<"'%0' is only available in %1">;
8071
8072 def err_constant_integer_arg_type : Error<
8073   "argument to %0 must be a constant integer">;
8074
8075 def ext_mixed_decls_code : Extension<
8076   "ISO C90 forbids mixing declarations and code">,
8077   InGroup<DiagGroup<"declaration-after-statement">>;
8078   
8079 def err_non_local_variable_decl_in_for : Error<
8080   "declaration of non-local variable in 'for' loop">;
8081 def err_non_variable_decl_in_for : Error<
8082   "non-variable declaration in 'for' loop">;
8083 def err_toomany_element_decls : Error<
8084   "only one element declaration is allowed">;
8085 def err_selector_element_not_lvalue : Error<
8086   "selector element is not a valid lvalue">;
8087 def err_selector_element_type : Error<
8088   "selector element type %0 is not a valid object">;
8089 def err_selector_element_const_type : Error<
8090   "selector element of type %0 cannot be a constant l-value expression">;
8091 def err_collection_expr_type : Error<
8092   "the type %0 is not a pointer to a fast-enumerable object">;
8093 def warn_collection_expr_type : Warning<
8094   "collection expression type %0 may not respond to %1">;
8095
8096 def err_invalid_conversion_between_ext_vectors : Error<
8097   "invalid conversion between ext-vector type %0 and %1">;
8098
8099 def warn_duplicate_attribute_exact : Warning<
8100   "attribute %0 is already applied">, InGroup<IgnoredAttributes>;
8101
8102 def warn_duplicate_attribute : Warning<
8103   "attribute %0 is already applied with different parameters">,
8104   InGroup<IgnoredAttributes>;
8105
8106 def warn_sync_fetch_and_nand_semantics_change : Warning<
8107   "the semantics of this intrinsic changed with GCC "
8108   "version 4.4 - the newer semantics are provided here">,
8109   InGroup<DiagGroup<"sync-fetch-and-nand-semantics-changed">>;
8110
8111 // Type
8112 def ext_invalid_sign_spec : Extension<"'%0' cannot be signed or unsigned">;
8113 def warn_receiver_forward_class : Warning<
8114     "receiver %0 is a forward class and corresponding @interface may not exist">,
8115     InGroup<ForwardClassReceiver>;
8116 def note_method_sent_forward_class : Note<"method %0 is used for the forward class">;
8117 def ext_missing_declspec : ExtWarn<
8118   "declaration specifier missing, defaulting to 'int'">;
8119 def ext_missing_type_specifier : ExtWarn<
8120   "type specifier missing, defaults to 'int'">,
8121   InGroup<ImplicitInt>;
8122 def err_decimal_unsupported : Error<
8123   "GNU decimal type extension not supported">;
8124 def err_missing_type_specifier : Error<
8125   "C++ requires a type specifier for all declarations">;
8126 def err_objc_array_of_interfaces : Error<
8127   "array of interface %0 is invalid (probably should be an array of pointers)">;
8128 def ext_c99_array_usage : Extension<
8129   "%select{qualifier in |static |}0array size %select{||'[*] '}0is a C99 "
8130   "feature">, InGroup<C99>;
8131 def err_c99_array_usage_cxx : Error<
8132   "%select{qualifier in |static |}0array size %select{||'[*] '}0is a C99 "
8133   "feature, not permitted in C++">;
8134 def err_type_unsupported : Error<
8135   "%0 is not supported on this target">;
8136 def err_nsconsumed_attribute_mismatch : Error<
8137   "overriding method has mismatched ns_consumed attribute on its"
8138   " parameter">;
8139 def err_nsreturns_retained_attribute_mismatch : Error<
8140   "overriding method has mismatched ns_returns_%select{not_retained|retained}0"
8141   " attributes">;
8142   
8143 def note_getter_unavailable : Note<
8144   "or because setter is declared here, but no getter method %0 is found">;
8145 def err_invalid_protocol_qualifiers : Error<
8146   "invalid protocol qualifiers on non-ObjC type">;
8147 def warn_ivar_use_hidden : Warning<
8148   "local declaration of %0 hides instance variable">,
8149    InGroup<ShadowIvar>;
8150 def warn_direct_initialize_call : Warning<
8151   "explicit call to +initialize results in duplicate call to +initialize">,
8152    InGroup<ExplicitInitializeCall>;
8153 def warn_direct_super_initialize_call : Warning<
8154   "explicit call to [super initialize] should only be in implementation "
8155   "of +initialize">,
8156    InGroup<ExplicitInitializeCall>;
8157 def err_ivar_use_in_class_method : Error<
8158   "instance variable %0 accessed in class method">;
8159 def err_private_ivar_access : Error<"instance variable %0 is private">,
8160   AccessControl;
8161 def err_protected_ivar_access : Error<"instance variable %0 is protected">,
8162   AccessControl;
8163 def warn_maynot_respond : Warning<"%0 may not respond to %1">;
8164 def ext_typecheck_base_super : Warning<
8165   "method parameter type "
8166   "%diff{$ does not match super class method parameter type $|"
8167   "does not match super class method parameter type}0,1">,
8168    InGroup<SuperSubClassMismatch>, DefaultIgnore;
8169 def warn_missing_method_return_type : Warning<
8170   "method has no return type specified; defaults to 'id'">,
8171   InGroup<MissingMethodReturnType>, DefaultIgnore;
8172 def warn_direct_ivar_access : Warning<"instance variable %0 is being "
8173   "directly accessed">, InGroup<DiagGroup<"direct-ivar-access">>, DefaultIgnore;
8174
8175 // Spell-checking diagnostics
8176 def err_unknown_typename : Error<
8177   "unknown type name %0">;
8178 def err_unknown_type_or_class_name_suggest : Error<
8179   "unknown %select{type|class}1 name %0; did you mean %2?">;
8180 def err_unknown_typename_suggest : Error<
8181   "unknown type name %0; did you mean %1?">;
8182 def err_unknown_nested_typename_suggest : Error<
8183   "no type named %0 in %1; did you mean %select{|simply }2%3?">;
8184 def err_no_member_suggest : Error<"no member named %0 in %1; did you mean %select{|simply }2%3?">;
8185 def err_undeclared_use_suggest : Error<
8186   "use of undeclared %0; did you mean %1?">;
8187 def err_undeclared_var_use_suggest : Error<
8188   "use of undeclared identifier %0; did you mean %1?">;
8189 def err_no_template_suggest : Error<"no template named %0; did you mean %1?">;
8190 def err_no_member_template_suggest : Error<
8191   "no template named %0 in %1; did you mean %select{|simply }2%3?">;
8192 def err_mem_init_not_member_or_class_suggest : Error<
8193   "initializer %0 does not name a non-static data member or base "
8194   "class; did you mean the %select{base class|member}1 %2?">;
8195 def err_field_designator_unknown_suggest : Error<
8196   "field designator %0 does not refer to any field in type %1; did you mean "
8197   "%2?">;
8198 def err_typecheck_member_reference_ivar_suggest : Error<
8199   "%0 does not have a member named %1; did you mean %2?">;
8200 def err_property_not_found_suggest : Error<
8201   "property %0 not found on object of type %1; did you mean %2?">;
8202 def err_class_property_found : Error<
8203   "property %0 is a class property; did you mean to access it with class '%1'?">;
8204 def err_ivar_access_using_property_syntax_suggest : Error<
8205   "property %0 not found on object of type %1; did you mean to access instance variable %2?">;
8206 def warn_property_access_suggest : Warning<
8207 "property %0 not found on object of type %1; did you mean to access property %2?">,
8208 InGroup<PropertyAccessDotSyntax>;
8209 def err_property_found_suggest : Error<
8210   "property %0 found on object of type %1; did you mean to access "
8211   "it with the \".\" operator?">;
8212 def err_undef_interface_suggest : Error<
8213   "cannot find interface declaration for %0; did you mean %1?">;
8214 def warn_undef_interface_suggest : Warning<
8215   "cannot find interface declaration for %0; did you mean %1?">;
8216 def err_undef_superclass_suggest : Error<
8217   "cannot find interface declaration for %0, superclass of %1; did you mean "
8218   "%2?">;
8219 def err_undeclared_protocol_suggest : Error<
8220   "cannot find protocol declaration for %0; did you mean %1?">;
8221 def note_base_class_specified_here : Note<
8222   "base class %0 specified here">;
8223 def err_using_directive_suggest : Error<
8224   "no namespace named %0; did you mean %1?">;
8225 def err_using_directive_member_suggest : Error<
8226   "no namespace named %0 in %1; did you mean %select{|simply }2%3?">;
8227 def note_namespace_defined_here : Note<"namespace %0 defined here">;
8228 def err_sizeof_pack_no_pack_name_suggest : Error<
8229   "%0 does not refer to the name of a parameter pack; did you mean %1?">;
8230 def note_parameter_pack_here : Note<"parameter pack %0 declared here">;
8231
8232 def err_uncasted_use_of_unknown_any : Error<
8233   "%0 has unknown type; cast it to its declared type to use it">;
8234 def err_uncasted_call_of_unknown_any : Error<
8235   "%0 has unknown return type; cast the call to its declared return type">;
8236 def err_uncasted_send_to_unknown_any_method : Error<
8237   "no known method %select{%objcinstance1|%objcclass1}0; cast the "
8238   "message send to the method's return type">;
8239 def err_unsupported_unknown_any_decl : Error<
8240   "%0 has unknown type, which is not supported for this kind of declaration">;
8241 def err_unsupported_unknown_any_expr : Error<
8242   "unsupported expression with unknown type">;
8243 def err_unsupported_unknown_any_call : Error<
8244   "call to unsupported expression with unknown type">;
8245 def err_unknown_any_addrof : Error<
8246   "the address of a declaration with unknown type "
8247   "can only be cast to a pointer type">;
8248 def err_unknown_any_addrof_call : Error<
8249   "address-of operator cannot be applied to a call to a function with "
8250   "unknown return type">;
8251 def err_unknown_any_var_function_type : Error<
8252   "variable %0 with unknown type cannot be given a function type">;
8253 def err_unknown_any_function : Error<
8254   "function %0 with unknown type must be given a function type">;
8255
8256 def err_filter_expression_integral : Error<
8257   "filter expression type should be an integral value not %0">;
8258
8259 def err_non_asm_stmt_in_naked_function : Error<
8260   "non-ASM statement in naked function is not supported">;
8261 def err_asm_naked_this_ref : Error<
8262   "'this' pointer references not allowed in naked functions">;
8263 def err_asm_naked_parm_ref : Error<
8264   "parameter references not allowed in naked functions">;
8265
8266 // OpenCL warnings and errors.
8267 def err_invalid_astype_of_different_size : Error<
8268   "invalid reinterpretation: sizes of %0 and %1 must match">;
8269 def err_static_kernel : Error<
8270   "kernel functions cannot be declared static">;
8271 def err_opencl_ptrptr_kernel_param : Error<
8272   "kernel parameter cannot be declared as a pointer to a pointer">;
8273 def err_kernel_arg_address_space : Error<
8274   "pointer arguments to kernel functions must reside in '__global', "
8275   "'__constant' or '__local' address space">;
8276 def err_opencl_ext_vector_component_invalid_length : Error<
8277   "vector component access has invalid length %0.  Supported: 1,2,3,4,8,16.">;
8278 def err_opencl_function_variable : Error<
8279   "%select{non-kernel function|function scope}0 variable cannot be declared in %1 address space">;
8280 def err_static_function_scope : Error<
8281   "variables in function scope cannot be declared static">;
8282 def err_opencl_bitfields : Error<
8283   "bit-fields are not supported in OpenCL">;
8284 def err_opencl_vla : Error<
8285   "variable length arrays are not supported in OpenCL">;
8286 def err_bad_kernel_param_type : Error<
8287   "%0 cannot be used as the type of a kernel parameter">;
8288 def err_record_with_pointers_kernel_param : Error<
8289   "%select{struct|union}0 kernel parameters may not contain pointers">;
8290 def note_within_field_of_type : Note<
8291   "within field of type %0 declared here">;
8292 def note_illegal_field_declared_here : Note<
8293   "field of illegal %select{type|pointer type}0 %1 declared here">;
8294 def err_opencl_type_struct_or_union_field : Error<
8295   "the %0 type cannot be used to declare a structure or union field">;
8296 def err_event_t_addr_space_qual : Error<
8297   "the event_t type can only be used with __private address space qualifier">;
8298 def err_expected_kernel_void_return_type : Error<
8299   "kernel must have void return type">;
8300 def err_sampler_initializer_not_integer : Error<
8301   "sampler_t initialization requires 32-bit integer, not %0">;
8302 def warn_sampler_initializer_invalid_bits : Warning<
8303   "sampler initializer has invalid %0 bits">, InGroup<SpirCompat>, DefaultIgnore;
8304 def err_sampler_argument_required : Error<
8305   "sampler_t variable required - got %0">;
8306 def err_wrong_sampler_addressspace: Error<
8307   "sampler type cannot be used with the __local and __global address space qualifiers">;
8308 def err_opencl_nonconst_global_sampler : Error<
8309   "global sampler requires a const or constant address space qualifier">;
8310 def err_opencl_cast_non_zero_to_event_t : Error<
8311   "cannot cast non-zero value '%0' to 'event_t'">;
8312 def err_opencl_global_invalid_addr_space : Error<
8313   "%select{program scope|static local|extern}0 variable must reside in %1 address space">;
8314 def err_missing_actual_pipe_type : Error<
8315   "missing actual type specifier for pipe">;
8316 def err_reference_pipe_type : Error <
8317   "pipes packet types cannot be of reference type">;
8318 def err_opencl_no_main : Error<"%select{function|kernel}0 cannot be called 'main'">;
8319 def err_opencl_kernel_attr :
8320   Error<"attribute %0 can only be applied to a kernel function">;
8321 def err_opencl_return_value_with_address_space : Error<
8322   "return value cannot be qualified with address space">;
8323 def err_opencl_constant_no_init : Error<
8324   "variable in constant address space must be initialized">;
8325 def err_opencl_atomic_init: Error<
8326   "atomic variable can be %select{assigned|initialized}0 to a variable only "
8327   "in global address space">;
8328 def err_opencl_implicit_vector_conversion : Error<
8329   "implicit conversions between vector types (%0 and %1) are not permitted">;
8330 def err_opencl_invalid_type_array : Error<
8331   "array of %0 type is invalid in OpenCL">;
8332 def err_opencl_ternary_with_block : Error<
8333   "block type cannot be used as expression in ternary expression in OpenCL">;
8334 def err_opencl_pointer_to_type : Error<
8335   "pointer to type %0 is invalid in OpenCL">;
8336 def err_opencl_type_can_only_be_used_as_function_parameter : Error <
8337   "type %0 can only be used as a function parameter in OpenCL">;
8338 def warn_opencl_attr_deprecated_ignored : Warning <
8339   "%0 attribute is deprecated and ignored in OpenCL version %1">,
8340   InGroup<IgnoredAttributes>;
8341 def err_opencl_variadic_function : Error<
8342   "invalid prototype, variadic arguments are not allowed in OpenCL">;
8343 def err_opencl_requires_extension : Error<
8344   "use of %select{type |declaration}0%1 requires %2 extension to be enabled">;
8345
8346 // OpenCL v2.0 s6.13.6 -- Builtin Pipe Functions
8347 def err_opencl_builtin_pipe_first_arg : Error<
8348   "first argument to %0 must be a pipe type">;
8349 def err_opencl_builtin_pipe_arg_num : Error<
8350   "invalid number of arguments to function: %0">;
8351 def err_opencl_builtin_pipe_invalid_arg : Error<
8352   "invalid argument type to function %0 (expecting %1 having %2)">;
8353 def err_opencl_builtin_pipe_invalid_access_modifier : Error<
8354   "invalid pipe access modifier (expecting %0)">;
8355
8356 // OpenCL access qualifier
8357 def err_opencl_invalid_access_qualifier : Error<
8358   "access qualifier can only be used for pipe and image type">;
8359 def err_opencl_invalid_read_write : Error<
8360   "access qualifier %0 can not be used for %1 %select{|prior to OpenCL version 2.0}2">;
8361 def err_opencl_multiple_access_qualifiers : Error<
8362   "multiple access qualifiers">;
8363 def note_opencl_typedef_access_qualifier : Note<
8364   "previously declared '%0' here">;
8365
8366 // OpenCL Section 6.8.g
8367 def err_opencl_unknown_type_specifier : Error<
8368   "OpenCL version %0 does not support the '%1' %select{type qualifier|storage class specifier}2">;
8369
8370 // OpenCL v2.0 s6.12.5 Blocks restrictions
8371 def err_opencl_block_storage_type : Error<
8372   "the __block storage type is not permitted">;
8373 def err_opencl_invalid_block_declaration : Error<
8374   "invalid block variable declaration - must be %select{const qualified|initialized}0">;
8375 def err_opencl_extern_block_declaration : Error<
8376   "invalid block variable declaration - using 'extern' storage class is disallowed">;
8377 def err_opencl_block_ref_block : Error<
8378   "cannot refer to a block inside block">;
8379
8380 // OpenCL v2.0 s6.13.9 - Address space qualifier functions. 
8381 def err_opencl_builtin_to_addr_arg_num : Error<
8382   "invalid number of arguments to function: %0">;
8383 def err_opencl_builtin_to_addr_invalid_arg : Error<
8384   "invalid argument %0 to function: %1, expecting a generic pointer argument">;
8385
8386 // OpenCL v2.0 s6.13.17 Enqueue kernel restrictions.
8387 def err_opencl_enqueue_kernel_incorrect_args : Error<
8388   "illegal call to enqueue_kernel, incorrect argument types">;
8389 def err_opencl_enqueue_kernel_expected_type : Error<
8390   "illegal call to enqueue_kernel, expected %0 argument type">;
8391 def err_opencl_enqueue_kernel_local_size_args : Error<
8392   "mismatch in number of block parameters and local size arguments passed">;
8393 def err_opencl_enqueue_kernel_invalid_local_size_type : Error<
8394   "illegal call to enqueue_kernel, parameter needs to be specified as integer type">;
8395 def err_opencl_enqueue_kernel_blocks_non_local_void_args : Error<
8396   "blocks used in enqueue_kernel call are expected to have parameters of type 'local void*'">;
8397 def err_opencl_enqueue_kernel_blocks_no_args : Error<
8398   "blocks with parameters are not accepted in this prototype of enqueue_kernel call">;
8399
8400 // OpenCL v2.2 s2.1.2.3 - Vector Component Access
8401 def ext_opencl_ext_vector_type_rgba_selector: ExtWarn<
8402   "vector component name '%0' is an OpenCL version 2.2 feature">,
8403   InGroup<OpenCLUnsupportedRGBA>;
8404 } // end of sema category
8405
8406 let CategoryName = "OpenMP Issue" in {
8407 // OpenMP support.
8408 def err_omp_expected_var_arg : Error<
8409   "%0 is not a global variable, static local variable or static data member">;
8410 def err_omp_expected_var_arg_suggest : Error<
8411   "%0 is not a global variable, static local variable or static data member; "
8412   "did you mean %1">;
8413 def err_omp_global_var_arg : Error<
8414   "arguments of '#pragma omp %0' must have %select{global storage|static storage duration}1">;
8415 def err_omp_ref_type_arg : Error<
8416   "arguments of '#pragma omp %0' cannot be of reference type %1">;
8417 def err_omp_region_not_file_context : Error<
8418   "directive must be at file or namespace scope">;
8419 def err_omp_var_scope : Error<
8420   "'#pragma omp %0' must appear in the scope of the %q1 variable declaration">;
8421 def err_omp_var_used : Error<
8422   "'#pragma omp %0' must precede all references to variable %q1">;
8423 def err_omp_var_thread_local : Error<
8424   "variable %0 cannot be threadprivate because it is %select{thread-local|a global named register variable}1">;
8425 def err_omp_private_incomplete_type : Error<
8426   "a private variable with incomplete type %0">;
8427 def err_omp_firstprivate_incomplete_type : Error<
8428   "a firstprivate variable with incomplete type %0">;
8429 def err_omp_lastprivate_incomplete_type : Error<
8430   "a lastprivate variable with incomplete type %0">;
8431 def err_omp_reduction_incomplete_type : Error<
8432   "a reduction list item with incomplete type %0">;
8433 def err_omp_unexpected_clause_value : Error<
8434   "expected %0 in OpenMP clause '%1'">;
8435 def err_omp_expected_var_name_member_expr : Error<
8436   "expected variable name%select{| or data member of current class}0">;
8437 def err_omp_expected_var_name_member_expr_or_array_item : Error<
8438   "expected variable name%select{|, data member of current class}0, array element or array section">;
8439 def err_omp_expected_named_var_member_or_array_expression: Error<
8440   "expected expression containing only member accesses and/or array sections based on named variables">;
8441 def err_omp_bit_fields_forbidden_in_clause : Error<
8442   "bit fields cannot be used to specify storage in a '%0' clause">;
8443 def err_array_section_does_not_specify_contiguous_storage : Error<
8444   "array section does not specify contiguous storage">;
8445 def err_omp_union_type_not_allowed : Error<
8446   "mapped storage cannot be derived from a union">;
8447 def err_omp_expected_access_to_data_field : Error<
8448   "expected access to data field">;
8449 def err_omp_multiple_array_items_in_map_clause : Error<
8450   "multiple array elements associated with the same variable are not allowed in map clauses of the same construct">;
8451 def err_omp_pointer_mapped_along_with_derived_section : Error<
8452   "pointer cannot be mapped along with a section derived from itself">;
8453 def err_omp_original_storage_is_shared_and_does_not_contain : Error<
8454   "original storage of expression in data environment is shared but data environment do not fully contain mapped expression storage">;
8455 def err_omp_same_pointer_derreferenced : Error<
8456   "same pointer derreferenced in multiple different ways in map clause expressions">;
8457 def note_omp_task_predetermined_firstprivate_here : Note<
8458   "predetermined as a firstprivate in a task construct here">;
8459 def err_omp_threadprivate_incomplete_type : Error<
8460   "threadprivate variable with incomplete type %0">;
8461 def err_omp_no_dsa_for_variable : Error<
8462   "variable %0 must have explicitly specified data sharing attributes">;
8463 def err_omp_wrong_dsa : Error<
8464   "%0 variable cannot be %1">;
8465 def err_omp_variably_modified_type_not_supported : Error<
8466   "arguments of OpenMP clause '%0' in '#pragma omp %2' directive cannot be of variably-modified type %1">;
8467 def note_omp_explicit_dsa : Note<
8468   "defined as %0">;
8469 def note_omp_predetermined_dsa : Note<
8470   "%select{static data member is predetermined as shared|"
8471   "variable with static storage duration is predetermined as shared|"
8472   "loop iteration variable is predetermined as private|"
8473   "loop iteration variable is predetermined as linear|"
8474   "loop iteration variable is predetermined as lastprivate|"
8475   "constant variable is predetermined as shared|"
8476   "global variable is predetermined as shared|"
8477   "non-shared variable in a task construct is predetermined as firstprivate|"
8478   "variable with automatic storage duration is predetermined as private}0"
8479   "%select{|; perhaps you forget to enclose 'omp %2' directive into a parallel or another task region?}1">;
8480 def note_omp_implicit_dsa : Note<
8481   "implicitly determined as %0">;
8482 def err_omp_loop_var_dsa : Error<
8483   "loop iteration variable in the associated loop of 'omp %1' directive may not be %0, predetermined as %2">;
8484 def err_omp_not_for : Error<
8485   "%select{statement after '#pragma omp %1' must be a for loop|"
8486   "expected %2 for loops after '#pragma omp %1'%select{|, but found only %4}3}0">;
8487 def note_omp_collapse_ordered_expr : Note<
8488   "as specified in %select{'collapse'|'ordered'|'collapse' and 'ordered'}0 clause%select{||s}0">;
8489 def err_omp_negative_expression_in_clause : Error<
8490   "argument to '%0' clause must be a %select{non-negative|strictly positive}1 integer value">;
8491 def err_omp_not_integral : Error<
8492   "expression must have integral or unscoped enumeration "
8493   "type, not %0">;
8494 def err_omp_threadprivate_in_target : Error<
8495   "threadprivate variables cannot be used in target constructs">;
8496 def err_omp_incomplete_type : Error<
8497   "expression has incomplete class type %0">;
8498 def err_omp_explicit_conversion : Error<
8499   "expression requires explicit conversion from %0 to %1">;
8500 def note_omp_conversion_here : Note<
8501   "conversion to %select{integral|enumeration}0 type %1 declared here">;
8502 def err_omp_ambiguous_conversion : Error<
8503   "ambiguous conversion from type %0 to an integral or unscoped "
8504   "enumeration type">;
8505 def err_omp_required_access : Error<
8506   "%0 variable must be %1">;
8507 def err_omp_const_variable : Error<
8508   "const-qualified variable cannot be %0">;
8509 def err_omp_const_reduction_list_item : Error<
8510   "const-qualified list item cannot be reduction">;
8511 def err_omp_linear_incomplete_type : Error<
8512   "a linear variable with incomplete type %0">;
8513 def err_omp_linear_expected_int_or_ptr : Error<
8514   "argument of a linear clause should be of integral or pointer "
8515   "type, not %0">;
8516 def warn_omp_linear_step_zero : Warning<
8517   "zero linear step (%0 %select{|and other variables in clause }1should probably be const)">,
8518   InGroup<OpenMPClauses>;
8519 def warn_omp_alignment_not_power_of_two : Warning<
8520   "aligned clause will be ignored because the requested alignment is not a power of 2">,
8521   InGroup<OpenMPClauses>;
8522 def err_omp_enclosed_declare_target : Error<
8523   "declare target region may not be enclosed within another declare target region">;
8524 def err_omp_invalid_target_decl : Error<
8525   "%0 used in declare target directive is not a variable or a function name">;
8526 def err_omp_declare_target_multiple : Error<
8527   "%0 appears multiple times in clauses on the same declare target directive">;
8528 def err_omp_declare_target_to_and_link : Error<
8529   "%0 must not appear in both clauses 'to' and 'link'">;
8530 def warn_omp_not_in_target_context : Warning<
8531   "declaration is not declared in any declare target region">,
8532   InGroup<OpenMPTarget>;
8533 def err_omp_aligned_expected_array_or_ptr : Error<
8534   "argument of aligned clause should be array"
8535   "%select{ or pointer|, pointer, reference to array or reference to pointer}1"
8536   ", not %0">;
8537 def err_omp_aligned_twice : Error<
8538   "%select{a variable|a parameter|'this'}0 cannot appear in more than one aligned clause">;
8539 def err_omp_local_var_in_threadprivate_init : Error<
8540   "variable with local storage in initial value of threadprivate variable">;
8541 def err_omp_loop_not_canonical_init : Error<
8542   "initialization clause of OpenMP for loop is not in canonical form "
8543   "('var = init' or 'T var = init')">;
8544 def ext_omp_loop_not_canonical_init : ExtWarn<
8545   "initialization clause of OpenMP for loop is not in canonical form "
8546   "('var = init' or 'T var = init')">, InGroup<OpenMPLoopForm>;
8547 def err_omp_loop_not_canonical_cond : Error<
8548   "condition of OpenMP for loop must be a relational comparison "
8549   "('<', '<=', '>', or '>=') of loop variable %0">;
8550 def err_omp_loop_not_canonical_incr : Error<
8551   "increment clause of OpenMP for loop must perform simple addition "
8552   "or subtraction on loop variable %0">;
8553 def err_omp_loop_variable_type : Error<
8554   "variable must be of integer or %select{pointer|random access iterator}0 type">;
8555 def err_omp_loop_incr_not_compatible : Error<
8556   "increment expression must cause %0 to %select{decrease|increase}1 "
8557   "on each iteration of OpenMP for loop">;
8558 def note_omp_loop_cond_requres_compatible_incr : Note<
8559   "loop step is expected to be %select{negative|positive}0 due to this condition">;
8560 def err_omp_loop_diff_cxx : Error<
8561   "could not calculate number of iterations calling 'operator-' with "
8562   "upper and lower loop bounds">;
8563 def err_omp_loop_cannot_use_stmt : Error<
8564   "'%0' statement cannot be used in OpenMP for loop">;
8565 def err_omp_simd_region_cannot_use_stmt : Error<
8566   "'%0' statement cannot be used in OpenMP simd region">;
8567 def warn_omp_loop_64_bit_var : Warning<
8568   "OpenMP loop iteration variable cannot have more than 64 bits size and will be narrowed">,
8569   InGroup<OpenMPLoopForm>;
8570 def err_omp_unknown_reduction_identifier : Error<
8571   "incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', "
8572   "'&&', '||', 'min' or 'max' or declare reduction for type %0">;
8573 def err_omp_not_resolved_reduction_identifier : Error<
8574   "unable to resolve declare reduction construct for type %0">;
8575 def err_omp_reduction_ref_type_arg : Error<
8576   "argument of OpenMP clause 'reduction' must reference the same object in all threads">;
8577 def err_omp_clause_not_arithmetic_type_arg : Error<
8578   "arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of %select{scalar|arithmetic}0 type">;
8579 def err_omp_clause_floating_type_arg : Error<
8580   "arguments of OpenMP clause 'reduction' with bitwise operators cannot be of floating type">;
8581 def err_omp_once_referenced : Error<
8582   "variable can appear only once in OpenMP '%0' clause">;
8583 def err_omp_once_referenced_in_target_update : Error<
8584   "variable can appear only once in OpenMP 'target update' construct">;
8585 def note_omp_referenced : Note<
8586   "previously referenced here">;
8587 def err_omp_reduction_in_task : Error<
8588   "reduction variables may not be accessed in an explicit task">;
8589 def err_omp_reduction_id_not_compatible : Error<
8590   "list item of type %0 is not valid for specified reduction operation: unable to provide default initialization value">;
8591 def err_omp_prohibited_region : Error<
8592   "region cannot be%select{| closely}0 nested inside '%1' region"
8593   "%select{|; perhaps you forget to enclose 'omp %3' directive into a parallel region?|"
8594   "; perhaps you forget to enclose 'omp %3' directive into a for or a parallel for region with 'ordered' clause?|"
8595   "; perhaps you forget to enclose 'omp %3' directive into a target region?|"
8596   "; perhaps you forget to enclose 'omp %3' directive into a teams region?}2">;
8597 def err_omp_prohibited_region_simd : Error<
8598   "OpenMP constructs may not be nested inside a simd region">;
8599 def err_omp_prohibited_region_atomic : Error<
8600   "OpenMP constructs may not be nested inside an atomic region">;
8601 def err_omp_prohibited_region_critical_same_name : Error<
8602   "cannot nest 'critical' regions having the same name %0">;
8603 def note_omp_previous_critical_region : Note<
8604   "previous 'critical' region starts here">;
8605 def err_omp_sections_not_compound_stmt : Error<
8606   "the statement for '#pragma omp sections' must be a compound statement">;
8607 def err_omp_parallel_sections_not_compound_stmt : Error<
8608   "the statement for '#pragma omp parallel sections' must be a compound statement">;
8609 def err_omp_orphaned_section_directive : Error<
8610   "%select{orphaned 'omp section' directives are prohibited, it|'omp section' directive}0"
8611   " must be closely nested to a sections region%select{|, not a %1 region}0">;
8612 def err_omp_sections_substmt_not_section : Error<
8613   "statement in 'omp sections' directive must be enclosed into a section region">;
8614 def err_omp_parallel_sections_substmt_not_section : Error<
8615   "statement in 'omp parallel sections' directive must be enclosed into a section region">;
8616 def err_omp_parallel_reduction_in_task_firstprivate : Error<
8617   "argument of a reduction clause of a %0 construct must not appear in a firstprivate clause on a task construct">;
8618 def err_omp_atomic_read_not_expression_statement : Error<
8619   "the statement for 'atomic read' must be an expression statement of form 'v = x;',"
8620   " where v and x are both lvalue expressions with scalar type">;
8621 def note_omp_atomic_read_write: Note<
8622   "%select{expected an expression statement|expected built-in assignment operator|expected expression of scalar type|expected lvalue expression}0">;
8623 def err_omp_atomic_write_not_expression_statement : Error<
8624   "the statement for 'atomic write' must be an expression statement of form 'x = expr;',"
8625   " where x is a lvalue expression with scalar type">;
8626 def err_omp_atomic_update_not_expression_statement : Error<
8627   "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',"
8628   " where x is an l-value expression with scalar type">;
8629 def err_omp_atomic_not_expression_statement : Error<
8630   "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',"
8631   " where x is an l-value expression with scalar type">;
8632 def note_omp_atomic_update: Note<
8633   "%select{expected an expression statement|expected built-in binary or unary operator|expected unary decrement/increment operation|"
8634   "expected expression of scalar type|expected assignment expression|expected built-in binary operator|"
8635   "expected one of '+', '*', '-', '/', '&', '^', '%|', '<<', or '>>' built-in operations|expected in right hand side of expression}0">;
8636 def err_omp_atomic_capture_not_expression_statement : Error<
8637   "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',"
8638   " where x and v are both l-value expressions with scalar type">;
8639 def err_omp_atomic_capture_not_compound_statement : Error<
8640   "the statement for 'atomic capture' must be a compound statement of form '{v = x; x binop= expr;}', '{x binop= expr; v = x;}',"
8641   " '{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;}',"
8642   " '{v = x; x++;}', '{v = x; ++x;}', '{++x; v = x;}', '{x++; v = x;}', '{v = x; x--;}', '{v = x; --x;}', '{--x; v = x;}', '{x--; v = x;}'"
8643   " where x is an l-value expression with scalar type">;
8644 def note_omp_atomic_capture: Note<
8645   "%select{expected assignment expression|expected compound statement|expected exactly two expression statements|expected in right hand side of the first expression}0">;
8646 def err_omp_atomic_several_clauses : Error<
8647   "directive '#pragma omp atomic' cannot contain more than one 'read', 'write', 'update' or 'capture' clause">;
8648 def note_omp_atomic_previous_clause : Note<
8649   "'%0' clause used here">;
8650 def err_omp_target_contains_not_only_teams : Error<
8651   "target construct with nested teams region contains statements outside of the teams construct">;
8652 def note_omp_nested_teams_construct_here : Note<
8653   "nested teams construct here">;
8654 def note_omp_nested_statement_here : Note<
8655   "%select{statement|directive}0 outside teams construct here">;
8656 def err_omp_single_copyprivate_with_nowait : Error<
8657   "the 'copyprivate' clause must not be used with the 'nowait' clause">;
8658 def note_omp_nowait_clause_here : Note<
8659   "'nowait' clause is here">;
8660 def err_omp_single_decl_in_declare_simd : Error<
8661   "single declaration is expected after 'declare simd' directive">;
8662 def err_omp_function_expected : Error<
8663   "'#pragma omp declare simd' can only be applied to functions">;
8664 def err_omp_wrong_cancel_region : Error<
8665   "one of 'for', 'parallel', 'sections' or 'taskgroup' is expected">;
8666 def err_omp_parent_cancel_region_nowait : Error<
8667   "parent region for 'omp %select{cancellation point/cancel}0' construct cannot be nowait">;
8668 def err_omp_parent_cancel_region_ordered : Error<
8669   "parent region for 'omp %select{cancellation point/cancel}0' construct cannot be ordered">;
8670 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">;
8671 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">;
8672 def err_omp_declare_reduction_redefinition : Error<"redefinition of user-defined reduction for type %0">;
8673 def err_omp_array_section_use : Error<"OpenMP array section is not allowed here">;
8674 def err_omp_typecheck_section_value : Error<
8675   "subscripted value is not an array or pointer">;
8676 def err_omp_typecheck_section_not_integer : Error<
8677   "array section %select{lower bound|length}0 is not an integer">;
8678 def err_omp_section_function_type : Error<
8679   "section of pointer to function type %0">;
8680 def warn_omp_section_is_char : Warning<"array section %select{lower bound|length}0 is of type 'char'">,
8681   InGroup<CharSubscript>, DefaultIgnore;
8682 def err_omp_section_incomplete_type : Error<
8683   "section of pointer to incomplete type %0">;
8684 def err_omp_section_not_subset_of_array : Error<
8685   "array section must be a subset of the original array">;
8686 def err_omp_section_length_negative : Error<
8687   "section length is evaluated to a negative value %0">;
8688 def err_omp_section_length_undefined : Error<
8689   "section length is unspecified and cannot be inferred because subscripted value is %select{not an array|an array of unknown bound}0">;
8690 def err_omp_wrong_linear_modifier : Error<
8691   "expected %select{'val' modifier|one of 'ref', val' or 'uval' modifiers}0">;
8692 def err_omp_wrong_linear_modifier_non_reference : Error<
8693   "variable of non-reference type %0 can be used only with 'val' modifier, but used with '%1'">;
8694 def err_omp_wrong_simdlen_safelen_values : Error<
8695   "the value of 'simdlen' parameter must be less than or equal to the value of the 'safelen' parameter">;
8696 def err_omp_wrong_if_directive_name_modifier : Error<
8697   "directive name modifier '%0' is not allowed for '#pragma omp %1'">;
8698 def err_omp_no_more_if_clause : Error<
8699   "no more 'if' clause is allowed">;
8700 def err_omp_unnamed_if_clause : Error<
8701   "expected %select{|one of}0 %1 directive name modifier%select{|s}0">;
8702 def note_omp_previous_named_if_clause : Note<
8703   "previous clause with directive name modifier specified here">;
8704 def err_omp_ordered_directive_with_param : Error<
8705   "'ordered' directive %select{without any clauses|with 'threads' clause}0 cannot be closely nested inside ordered region with specified parameter">;
8706 def err_omp_ordered_directive_without_param : Error<
8707   "'ordered' directive with 'depend' clause cannot be closely nested inside ordered region without specified parameter">;
8708 def note_omp_ordered_param : Note<
8709   "'ordered' clause with specified parameter">;
8710 def err_omp_expected_base_var_name : Error<
8711   "expected variable name as a base of the array %select{subscript|section}0">;
8712 def err_omp_map_shared_storage : Error<
8713   "variable already marked as mapped in current construct">;
8714 def err_omp_not_mappable_type : Error<
8715   "type %0 is not mappable to target">;
8716 def err_omp_invalid_map_type_for_directive : Error<
8717   "%select{map type '%1' is not allowed|map type must be specified}0 for '#pragma omp %2'">;
8718 def err_omp_no_map_for_directive : Error<
8719   "expected at least one map clause for '#pragma omp %0'">;
8720 def note_omp_polymorphic_in_target : Note<
8721   "mappable type cannot be polymorphic">;
8722 def note_omp_static_member_in_target : Note<
8723   "mappable type cannot contain static members">;
8724 def err_omp_threadprivate_in_clause : Error<
8725   "threadprivate variables are not allowed in '%0' clause">;
8726 def err_omp_wrong_ordered_loop_count : Error<
8727   "the parameter of the 'ordered' clause must be greater than or equal to the parameter of the 'collapse' clause">;
8728 def note_collapse_loop_count : Note<
8729   "parameter of the 'collapse' clause">;
8730 def err_omp_grainsize_num_tasks_mutually_exclusive : Error<
8731   "'%0' and '%1' clause are mutually exclusive and may not appear on the same directive">;
8732 def note_omp_previous_grainsize_num_tasks : Note<
8733   "'%0' clause is specified here">;
8734 def err_omp_hint_clause_no_name : Error<
8735   "the name of the construct must be specified in presence of 'hint' clause">;
8736 def err_omp_critical_with_hint : Error<
8737   "constructs with the same name must have a 'hint' clause with the same value">;
8738 def note_omp_critical_hint_here : Note<
8739   "%select{|previous }0'hint' clause with value '%1'">;
8740 def note_omp_critical_no_hint : Note<
8741   "%select{|previous }0directive with no 'hint' clause specified">;
8742 def err_omp_firstprivate_distribute_private_teams : Error<
8743   "private variable in '#pragma omp teams' cannot be firstprivate in '#pragma omp distribute'">;
8744 def err_omp_firstprivate_and_lastprivate_in_distribute : Error<
8745   "lastprivate variable cannot be firstprivate in '#pragma omp distribute'">;
8746 def err_omp_firstprivate_distribute_in_teams_reduction : Error<
8747   "reduction variable in '#pragma omp teams' cannot be firstprivate in '#pragma omp distribute'">;
8748 def err_omp_depend_clause_thread_simd : Error<
8749   "'depend' clauses cannot be mixed with '%0' clause">;
8750 def err_omp_depend_sink_expected_loop_iteration : Error<
8751   "expected %0 loop iteration variable">;
8752 def err_omp_depend_sink_unexpected_expr : Error<
8753   "unexpected expression: number of expressions is larger than the number of associated loops">;
8754 def err_omp_depend_sink_expected_plus_minus : Error<
8755   "expected '+' or '-' operation">;
8756 def err_omp_depend_sink_source_not_allowed : Error<
8757   "'depend(%select{source|sink:vec}0)' clause%select{|s}0 cannot be mixed with 'depend(%select{sink:vec|source}0)' clause%select{s|}0">;
8758 def err_omp_linear_ordered : Error<
8759   "'linear' clause cannot be specified along with 'ordered' clause with a parameter">;
8760 def err_omp_unexpected_schedule_modifier : Error<
8761   "modifier '%0' cannot be used along with modifier '%1'">;
8762 def err_omp_schedule_nonmonotonic_static : Error<
8763   "'nonmonotonic' modifier can only be specified with 'dynamic' or 'guided' schedule kind">;
8764 def err_omp_schedule_nonmonotonic_ordered : Error<
8765   "'schedule' clause with 'nonmonotonic' modifier cannot be specified if an 'ordered' clause is specified">;
8766 def err_omp_ordered_simd : Error<
8767   "'ordered' clause with a parameter can not be specified in '#pragma omp %0' directive">;
8768 def err_omp_variable_in_given_clause_and_dsa : Error<
8769   "%0 variable cannot be in a %1 clause in '#pragma omp %2' directive">;
8770 def err_omp_param_or_this_in_clause : Error<
8771   "expected reference to one of the parameters of function %0%select{| or 'this'}1">;
8772 def err_omp_expected_uniform_param : Error<
8773   "expected a reference to a parameter specified in a 'uniform' clause">;
8774 def err_omp_expected_int_param : Error<
8775   "expected a reference to an integer-typed parameter">;
8776 def err_omp_at_least_one_motion_clause_required : Error<
8777   "expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'">;
8778 def err_omp_usedeviceptr_not_a_pointer : Error<
8779   "expected pointer or reference to pointer in 'use_device_ptr' clause">;
8780 def err_omp_argument_type_isdeviceptr : Error <
8781   "expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'">;
8782 def warn_omp_nesting_simd : Warning<
8783   "OpenMP only allows an ordered construct with the simd clause nested in a simd construct">,
8784   InGroup<SourceUsesOpenMP>;
8785 def err_omp_orphaned_device_directive : Error<
8786   "orphaned 'omp %0' directives are prohibited"
8787   "; perhaps you forget to enclose the directive into a %select{|||target |teams }1region?">;
8788 } // end of OpenMP category
8789
8790 let CategoryName = "Related Result Type Issue" in {
8791 // Objective-C related result type compatibility
8792 def warn_related_result_type_compatibility_class : Warning<
8793   "method is expected to return an instance of its class type "
8794   "%diff{$, but is declared to return $|"
8795   ", but is declared to return different type}0,1">;
8796 def warn_related_result_type_compatibility_protocol : Warning<
8797   "protocol method is expected to return an instance of the implementing "
8798   "class, but is declared to return %0">;
8799 def note_related_result_type_family : Note<
8800   "%select{overridden|current}0 method is part of the '%select{|alloc|copy|init|"
8801   "mutableCopy|new|autorelease|dealloc|finalize|release|retain|retainCount|"
8802   "self}1' method family%select{| and is expected to return an instance of its "
8803   "class type}0">;
8804 def note_related_result_type_overridden : Note<
8805   "overridden method returns an instance of its class type">;
8806 def note_related_result_type_inferred : Note<
8807   "%select{class|instance}0 method %1 is assumed to return an instance of "
8808   "its receiver type (%2)">;
8809 def note_related_result_type_explicit : Note<
8810   "%select{overridden|current}0 method is explicitly declared 'instancetype'"
8811   "%select{| and is expected to return an instance of its class type}0">;
8812 def err_invalid_type_for_program_scope_var : Error<
8813   "the %0 type cannot be used to declare a program scope variable">;
8814
8815 }
8816
8817 let CategoryName = "Modules Issue" in {
8818 def err_module_decl_in_module_map_module : Error<
8819   "'module' declaration found while building module from module map">;
8820 def err_module_interface_implementation_mismatch : Error<
8821   "missing 'export' specifier in module declaration while "
8822   "building module interface">;
8823 def err_current_module_name_mismatch : Error<
8824   "module name '%0' specified on command line does not match name of module">;
8825 def err_module_redefinition : Error<
8826   "redefinition of module '%0'">;
8827 def note_prev_module_definition : Note<"previously defined here">;
8828 def note_prev_module_definition_from_ast_file : Note<"module loaded from '%0'">;
8829 def err_module_private_specialization : Error<
8830   "%select{template|partial|member}0 specialization cannot be "
8831   "declared __module_private__">;
8832 def err_module_private_local : Error<
8833   "%select{local variable|parameter|typedef}0 %1 cannot be declared "
8834   "__module_private__">;
8835 def err_module_private_local_class : Error<
8836   "local %select{struct|interface|union|class|enum}0 cannot be declared "
8837   "__module_private__">;
8838 def err_module_unimported_use : Error<
8839   "%select{declaration|definition|default argument|"
8840   "explicit specialization|partial specialization}0 of %1 must be imported "
8841   "from module '%2' before it is required">;
8842 def err_module_unimported_use_header : Error<
8843   "missing '#include %3'; "
8844   "%select{declaration|definition|default argument|"
8845   "explicit specialization|partial specialization}0 of %1 must be imported "
8846   "from module '%2' before it is required">;
8847 def err_module_unimported_use_multiple : Error<
8848   "%select{declaration|definition|default argument|"
8849   "explicit specialization|partial specialization}0 of %1 must be imported "
8850   "from one of the following modules before it is required:%2">;
8851 def ext_module_import_in_extern_c : ExtWarn<
8852   "import of C++ module '%0' appears within extern \"C\" language linkage "
8853   "specification">, DefaultError,
8854   InGroup<DiagGroup<"module-import-in-extern-c">>;
8855 def err_module_import_not_at_top_level_fatal : Error<
8856   "import of module '%0' appears within %1">, DefaultFatal;
8857 def ext_module_import_not_at_top_level_noop : ExtWarn<
8858   "redundant #include of module '%0' appears within %1">, DefaultError,
8859   InGroup<DiagGroup<"modules-import-nested-redundant">>;
8860 def note_module_import_not_at_top_level : Note<"%0 begins here">;
8861 def err_module_self_import : Error<
8862   "import of module '%0' appears within same top-level module '%1'">;
8863 def err_module_import_in_implementation : Error<
8864   "@import of module '%0' in implementation of '%1'; use #import">;
8865
8866 // C++ Modules TS
8867 def err_export_within_export : Error<
8868   "export declaration appears within another export declaration">;
8869 def err_export_not_in_module_interface : Error<
8870   "export declaration can only be used within a module interface unit after "
8871   "the module declaration">;
8872
8873 def ext_equivalent_internal_linkage_decl_in_modules : ExtWarn<
8874   "ambiguous use of internal linkage declaration %0 defined in multiple modules">,
8875   InGroup<DiagGroup<"modules-ambiguous-internal-linkage">>;
8876 def note_equivalent_internal_linkage_decl : Note<
8877   "declared here%select{ in module '%1'|}0">;
8878 }
8879
8880 let CategoryName = "Coroutines Issue" in {
8881 def err_return_in_coroutine : Error<
8882   "return statement not allowed in coroutine; did you mean 'co_return'?">;
8883 def note_declared_coroutine_here : Note<
8884   "function is a coroutine due to use of '%0' here">;
8885 def err_coroutine_objc_method : Error<
8886   "Objective-C methods as coroutines are not yet supported">;
8887 def err_coroutine_unevaluated_context : Error<
8888   "'%0' cannot be used in an unevaluated context">;
8889 def err_coroutine_outside_function : Error<
8890   "'%0' cannot be used outside a function">;
8891 def err_coroutine_invalid_func_context : Error<
8892   "'%1' cannot be used in %select{a constructor|a destructor"
8893   "|a copy assignment operator|a move assignment operator|the 'main' function"
8894   "|a constexpr function|a function with a deduced return type"
8895   "|a varargs function}0">;
8896 def err_implied_coroutine_type_not_found : Error<
8897   "%0 type was not found; include <experimental/coroutine> before defining "
8898   "a coroutine">;
8899 def err_implicit_coroutine_std_nothrow_type_not_found : Error<
8900   "std::nothrow was not found; include <new> before defining a coroutine which "
8901   "uses get_return_object_on_allocation_failure()">;
8902 def err_malformed_std_nothrow : Error<
8903   "std::nothrow must be a valid variable declaration">;
8904 def err_malformed_std_coroutine_handle : Error<
8905   "std::experimental::coroutine_handle must be a class template">;
8906 def err_coroutine_handle_missing_member : Error<
8907   "std::experimental::coroutine_handle missing a member named '%0'">;
8908 def err_malformed_std_coroutine_traits : Error<
8909   "'std::experimental::coroutine_traits' must be a class template">;
8910 def err_implied_std_coroutine_traits_promise_type_not_found : Error<
8911   "this function cannot be a coroutine: %q0 has no member named 'promise_type'">;
8912 def err_implied_std_coroutine_traits_promise_type_not_class : Error<
8913   "this function cannot be a coroutine: %0 is not a class">;
8914 def err_coroutine_promise_type_incomplete : Error<
8915   "this function cannot be a coroutine: %0 is an incomplete type">;
8916 def err_coroutine_type_missing_specialization : Error<
8917   "this function cannot be a coroutine: missing definition of "
8918   "specialization %q0">;
8919 def err_coroutine_promise_return_ill_formed : Error<
8920   "%0 declares both 'return_value' and 'return_void'">;
8921 def note_coroutine_promise_implicit_await_transform_required_here : Note<
8922   "call to 'await_transform' implicitly required by 'co_await' here">;
8923 def note_coroutine_promise_suspend_implicitly_required : Note<
8924   "call to '%select{initial_suspend|final_suspend}0' implicitly "
8925   "required by the %select{initial suspend point|final suspend point}0">;
8926 def err_coroutine_promise_unhandled_exception_required : Error<
8927   "%0 is required to declare the member 'unhandled_exception()'">;
8928 def warn_coroutine_promise_unhandled_exception_required_with_exceptions : Warning<
8929   "%0 is required to declare the member 'unhandled_exception()' when exceptions are enabled">,
8930   InGroup<CoroutineMissingUnhandledException>;
8931 def err_coroutine_promise_get_return_object_on_allocation_failure : Error<
8932   "%0: 'get_return_object_on_allocation_failure()' must be a static member function">;
8933 def err_coroutine_promise_new_requires_nothrow : Error<
8934   "%0 is required to have a non-throwing noexcept specification when the promise "
8935    "type declares 'get_return_object_on_allocation_failure()'">;
8936 def note_coroutine_promise_call_implicitly_required : Note<
8937   "call to %0 implicitly required by coroutine function here">;
8938 }
8939
8940 let CategoryName = "Documentation Issue" in {
8941 def warn_not_a_doxygen_trailing_member_comment : Warning<
8942   "not a Doxygen trailing comment">, InGroup<Documentation>, DefaultIgnore;
8943 } // end of documentation issue category
8944
8945 let CategoryName = "Instrumentation Issue" in {
8946 def warn_profile_data_out_of_date : Warning<
8947   "profile data may be out of date: of %0 function%s0, %1 %plural{1:has|:have}1"
8948   " mismatched data that will be ignored">,
8949   InGroup<ProfileInstrOutOfDate>;
8950 def warn_profile_data_missing : Warning<
8951   "profile data may be incomplete: of %0 function%s0, %1 %plural{1:has|:have}1"
8952   " no data">,
8953   InGroup<ProfileInstrMissing>,
8954   DefaultIgnore;
8955 def warn_profile_data_unprofiled : Warning<
8956   "no profile data available for file \"%0\"">,
8957   InGroup<ProfileInstrUnprofiled>;
8958
8959 } // end of instrumentation issue category
8960
8961 let CategoryName = "Nullability Issue" in {
8962
8963 def warn_mismatched_nullability_attr : Warning<
8964   "nullability specifier %0 conflicts with existing specifier %1">,
8965   InGroup<Nullability>;
8966
8967 def warn_nullability_declspec : Warning<
8968   "nullability specifier %0 cannot be applied "
8969   "to non-pointer type %1; did you mean to apply the specifier to the "
8970   "%select{pointer|block pointer|member pointer|function pointer|"
8971   "member function pointer}2?">,
8972   InGroup<NullabilityDeclSpec>,
8973   DefaultError;
8974
8975 def note_nullability_here : Note<"%0 specified here">;
8976
8977 def err_nullability_nonpointer : Error<
8978   "nullability specifier %0 cannot be applied to non-pointer type %1">;
8979
8980 def warn_nullability_lost : Warning<
8981   "implicit conversion from nullable pointer %0 to non-nullable pointer "
8982   "type %1">,
8983   InGroup<NullableToNonNullConversion>, DefaultIgnore;
8984 def warn_zero_as_null_pointer_constant : Warning<
8985   "zero as null pointer constant">,
8986   InGroup<DiagGroup<"zero-as-null-pointer-constant">>, DefaultIgnore;
8987
8988 def err_nullability_cs_multilevel : Error<
8989   "nullability keyword %0 cannot be applied to multi-level pointer type %1">;
8990 def note_nullability_type_specifier : Note<
8991   "use nullability type specifier %0 to affect the innermost "
8992   "pointer type of %1">;
8993
8994 def warn_null_resettable_setter : Warning<
8995   "synthesized setter %0 for null_resettable property %1 does not handle nil">,
8996   InGroup<Nullability>;
8997
8998 def warn_nullability_missing : Warning<
8999   "%select{pointer|block pointer|member pointer}0 is missing a nullability "
9000   "type specifier (_Nonnull, _Nullable, or _Null_unspecified)">,
9001   InGroup<NullabilityCompleteness>;
9002 def warn_nullability_missing_array : Warning<
9003   "array parameter is missing a nullability type specifier (_Nonnull, "
9004   "_Nullable, or _Null_unspecified)">,
9005   InGroup<NullabilityCompletenessOnArrays>;
9006 def note_nullability_fix_it : Note<
9007   "insert '%select{_Nonnull|_Nullable|_Null_unspecified}0' if the "
9008   "%select{pointer|block pointer|member pointer|array parameter}1 "
9009   "%select{should never be null|may be null|should not declare nullability}0">;
9010
9011 def warn_nullability_inferred_on_nested_type : Warning<
9012   "inferring '_Nonnull' for pointer type within %select{array|reference}0 is "
9013   "deprecated">,
9014   InGroup<NullabilityInferredOnNestedType>;
9015
9016 def err_objc_type_arg_explicit_nullability : Error<
9017   "type argument %0 cannot explicitly specify nullability">;
9018
9019 def err_objc_type_param_bound_explicit_nullability : Error<
9020   "type parameter %0 bound %1 cannot explicitly specify nullability">;
9021
9022 }
9023
9024 let CategoryName = "Generics Issue" in {
9025
9026 def err_objc_type_param_bound_nonobject : Error<
9027   "type bound %0 for type parameter %1 is not an Objective-C pointer type">;
9028
9029 def err_objc_type_param_bound_missing_pointer : Error<
9030   "missing '*' in type bound %0 for type parameter %1">;
9031 def err_objc_type_param_bound_qualified : Error<
9032   "type bound %1 for type parameter %0 cannot be qualified with '%2'">;
9033
9034 def err_objc_type_param_redecl : Error<
9035   "redeclaration of type parameter %0">;
9036
9037 def err_objc_type_param_arity_mismatch : Error<
9038   "%select{forward class declaration|class definition|category|extension}0 has "
9039   "too %select{few|many}1 type parameters (expected %2, have %3)">;
9040
9041 def err_objc_type_param_bound_conflict : Error<
9042   "type bound %0 for type parameter %1 conflicts with "
9043   "%select{implicit|previous}2 bound %3%select{for type parameter %5|}4">;
9044
9045 def err_objc_type_param_variance_conflict : Error<
9046   "%select{in|co|contra}0variant type parameter %1 conflicts with previous "
9047   "%select{in|co|contra}2variant type parameter %3">;
9048
9049 def note_objc_type_param_here : Note<"type parameter %0 declared here">;
9050
9051 def err_objc_type_param_bound_missing : Error<
9052   "missing type bound %0 for type parameter %1 in %select{@interface|@class}2">;
9053
9054 def err_objc_parameterized_category_nonclass : Error<
9055   "%select{extension|category}0 of non-parameterized class %1 cannot have type "
9056   "parameters">;
9057
9058 def err_objc_parameterized_forward_class : Error<
9059   "forward declaration of non-parameterized class %0 cannot have type "
9060   "parameters">;
9061
9062 def err_objc_parameterized_forward_class_first : Error<
9063   "class %0 previously declared with type parameters">;
9064
9065 def err_objc_type_arg_missing_star : Error<
9066   "type argument %0 must be a pointer (requires a '*')">;
9067 def err_objc_type_arg_qualified : Error<
9068   "type argument %0 cannot be qualified with '%1'">;
9069
9070 def err_objc_type_arg_missing : Error<
9071   "no type or protocol named %0">;
9072
9073 def err_objc_type_args_and_protocols : Error<
9074   "angle brackets contain both a %select{type|protocol}0 (%1) and a "
9075   "%select{protocol|type}0 (%2)">;
9076
9077 def err_objc_type_args_non_class : Error<
9078   "type arguments cannot be applied to non-class type %0">;
9079
9080 def err_objc_type_args_non_parameterized_class : Error<
9081   "type arguments cannot be applied to non-parameterized class %0">;
9082
9083 def err_objc_type_args_specialized_class : Error<
9084   "type arguments cannot be applied to already-specialized class type %0">;
9085
9086 def err_objc_type_args_wrong_arity : Error<
9087   "too %select{many|few}0 type arguments for class %1 (have %2, expected %3)">;
9088 }
9089
9090 def err_objc_type_arg_not_id_compatible : Error<
9091   "type argument %0 is neither an Objective-C object nor a block type">;
9092
9093 def err_objc_type_arg_does_not_match_bound : Error<
9094   "type argument %0 does not satisfy the bound (%1) of type parameter %2">;
9095
9096 def warn_objc_redundant_qualified_class_type : Warning<
9097   "parameterized class %0 already conforms to the protocols listed; did you "
9098   "forget a '*'?">, InGroup<ObjCProtocolQualifiers>;
9099
9100 def warn_block_literal_attributes_on_omitted_return_type : Warning<
9101   "attribute %0 ignored, because it cannot be applied to omitted return type">,
9102   InGroup<IgnoredAttributes>;
9103
9104 def warn_block_literal_qualifiers_on_omitted_return_type : Warning<
9105   "'%0' qualifier on omitted return type %1 has no effect">,
9106   InGroup<IgnoredQualifiers>;
9107
9108 def ext_warn_gnu_final : ExtWarn<
9109   "__final is a GNU extension, consider using C++11 final">,
9110   InGroup<GccCompat>;
9111
9112 def warn_shadow_field :
9113   Warning<"non-static data member '%0' of '%1' shadows member inherited from type '%2'">,
9114   InGroup<ShadowField>, DefaultIgnore;
9115 def note_shadow_field : Note<"declared here">;
9116
9117 } // end of sema component.