]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - contrib/llvm/tools/clang/include/clang/Basic/DiagnosticASTKinds.td
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / contrib / llvm / tools / clang / include / clang / Basic / DiagnosticASTKinds.td
1 //==--- DiagnosticASTKinds.td - libast 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 let Component = "AST" in {
11
12 // Constant expression diagnostics. These (and their users) belong in Sema.
13 def note_expr_divide_by_zero : Note<"division by zero">;
14 def note_constexpr_invalid_cast : Note<
15   "%select{reinterpret_cast|dynamic_cast|cast that performs the conversions of"
16   " a reinterpret_cast|cast from %1}0 is not allowed in a constant expression">;
17 def note_constexpr_invalid_downcast : Note<
18   "cannot cast object of dynamic type %0 to type %1">;
19 def note_constexpr_overflow : Note<
20   "value %0 is outside the range of representable values of type %1">;
21 def note_constexpr_negative_shift : Note<"negative shift count %0">;
22 def note_constexpr_large_shift : Note<
23   "shift count %0 >= width of type %1 (%2 bit%s2)">;
24 def note_constexpr_lshift_of_negative : Note<"left shift of negative value %0">;
25 def note_constexpr_lshift_discards : Note<"signed left shift discards bits">;
26 def note_constexpr_invalid_function : Note<
27   "%select{non-constexpr|undefined}0 %select{function|constructor}1 %2 cannot "
28   "be used in a constant expression">;
29 def note_constexpr_no_return : Note<
30   "control reached end of constexpr function">;
31 def note_constexpr_virtual_call : Note<
32   "cannot evaluate virtual function call in a constant expression">;
33 def note_constexpr_virtual_base : Note<
34   "cannot construct object of type %0 with virtual base class "
35   "in a constant expression">;
36 def note_constexpr_nonliteral : Note<
37   "non-literal type %0 cannot be used in a constant expression">;
38 def note_constexpr_non_global : Note<
39   "%select{pointer|reference}0 to %select{|subobject of }1"
40   "%select{temporary|%3}2 is not a constant expression">;
41 def note_constexpr_array_index : Note<"cannot refer to element %0 of "
42   "%select{array of %2 elements|non-array object}1 in a constant expression">;
43 def note_constexpr_float_arithmetic : Note<
44   "floating point arithmetic produces %select{an infinity|a NaN}0">;
45 def note_constexpr_pointer_subtraction_not_same_array : Note<
46   "subtracted pointers are not elements of the same array">;
47 def note_constexpr_pointer_comparison_base_classes : Note<
48   "comparison of addresses of subobjects of different base classes "
49   "has unspecified value">;
50 def note_constexpr_pointer_comparison_base_field : Note<
51   "comparison of address of base class subobject %0 of class %1 to field %2 "
52   "has unspecified value">;
53 def note_constexpr_pointer_comparison_differing_access : Note<
54   "comparison of address of fields %0 and %2 of %4 with differing access "
55   "specifiers (%1 vs %3) has unspecified value">;
56 def note_constexpr_compare_virtual_mem_ptr : Note<
57   "comparison of pointer to virtual member function %0 has unspecified value">;
58 def note_constexpr_past_end : Note<
59   "dereferenced pointer past the end of %select{|subobject of }0"
60   "%select{temporary|%2}1 is not a constant expression">;
61 def note_constexpr_past_end_subobject : Note<
62   "cannot %select{access base class of|access derived class of|access field of|"
63   "access array element of|ERROR|call member function on|"
64   "access real component of|access imaginary component of}0 "
65   "pointer past the end of object">;
66 def note_constexpr_null_subobject : Note<
67   "cannot %select{access base class of|access derived class of|access field of|"
68   "access array element of|perform pointer arithmetic on|"
69   "call member function on|access real component of|"
70   "access imaginary component of}0 null pointer">;
71 def note_constexpr_var_init_non_constant : Note<
72   "initializer of %0 is not a constant expression">;
73 def note_constexpr_typeid_polymorphic : Note<
74   "typeid applied to expression of polymorphic type %0 is "
75   "not allowed in a constant expression">;
76 def note_constexpr_void_comparison : Note<
77   "comparison between unequal pointers to void has unspecified result">;
78 def note_constexpr_temporary_here : Note<"temporary created here">;
79 def note_constexpr_conditional_never_const : Note<
80   "both arms of conditional operator are unable to produce a "
81   "constant expression">;
82 def note_constexpr_depth_limit_exceeded : Note<
83   "constexpr evaluation exceeded maximum depth of %0 calls">;
84 def note_constexpr_call_limit_exceeded : Note<
85   "constexpr evaluation hit maximum call limit">;
86 def note_constexpr_lifetime_ended : Note<
87   "%select{read of|assignment to|increment of|decrement of}0 "
88   "%select{temporary|variable}1 whose lifetime has ended">;
89 def note_constexpr_access_uninit : Note<
90   "%select{read of|assignment to|increment of|decrement of}0 "
91   "object outside its lifetime is not allowed in a constant expression">;
92 def note_constexpr_modify_const_type : Note<
93   "modification of object of const-qualified type %0 is not allowed "
94   "in a constant expression">;
95 def note_constexpr_access_volatile_type : Note<
96   "%select{read of|assignment to|increment of|decrement of}0 "
97   "volatile-qualified type %1 is not allowed in a constant expression">;
98 def note_constexpr_access_volatile_obj : Note<
99   "%select{read of|assignment to|increment of|decrement of}0 volatile "
100   "%select{temporary|object %2|member %2}1 is not allowed in "
101   "a constant expression">;
102 def note_constexpr_ltor_mutable : Note<
103   "read of mutable member %0 is not allowed in a constant expression">;
104 def note_constexpr_ltor_non_const_int : Note<
105   "read of non-const variable %0 is not allowed in a constant expression">;
106 def note_constexpr_ltor_non_constexpr : Note<
107   "read of non-constexpr variable %0 is not allowed in a constant expression">;
108 def note_constexpr_access_null : Note<
109   "%select{read of|assignment to|increment of|decrement of}0 "
110   "dereferenced null pointer is not allowed in a constant expression">;
111 def note_constexpr_access_past_end : Note<
112   "%select{read of|assignment to|increment of|decrement of}0 "
113   "dereferenced one-past-the-end pointer is not allowed in a constant expression">;
114 def note_constexpr_access_inactive_union_member : Note<
115   "%select{read of|assignment to|increment of|decrement of}0 "
116   "member %1 of union with %select{active member %3|no active member}2 "
117   "is not allowed in a constant expression">;
118 def note_constexpr_modify_global : Note<
119   "a constant expression cannot modify an object that is visible outside "
120   "that expression">;
121 def note_constexpr_calls_suppressed : Note<
122   "(skipping %0 call%s0 in backtrace; use -fconstexpr-backtrace-limit=0 to "
123   "see all)">;
124 def note_constexpr_call_here : Note<"in call to '%0'">;
125 def warn_integer_constant_overflow : Warning<
126   "overflow in expression; result is %0 with type %1">,
127   InGroup<DiagGroup<"integer-overflow">>;
128
129 // inline asm related.
130 let CategoryName = "Inline Assembly Issue" in {
131   def err_asm_invalid_escape : Error<
132     "invalid %% escape in inline assembly string">;
133   def err_asm_unknown_symbolic_operand_name : Error<
134     "unknown symbolic operand name in inline assembly string">;
135
136   def err_asm_unterminated_symbolic_operand_name : Error<
137     "unterminated symbolic operand name in inline assembly string">;
138   def err_asm_empty_symbolic_operand_name : Error<
139     "empty symbolic operand name in inline assembly string">;
140   def err_asm_invalid_operand_number : Error<
141     "invalid operand number in inline asm string">;
142 }
143
144
145 // Importing ASTs
146 def err_odr_variable_type_inconsistent : Error<
147   "external variable %0 declared with incompatible types in different "
148   "translation units (%1 vs. %2)">;
149 def err_odr_variable_multiple_def : Error<
150   "external variable %0 defined in multiple translation units">;
151 def note_odr_value_here : Note<"declared here with type %0">;
152 def note_odr_defined_here : Note<"also defined here">;
153 def err_odr_function_type_inconsistent : Error<
154   "external function %0 declared with incompatible types in different "
155   "translation units (%1 vs. %2)">;
156 def warn_odr_tag_type_inconsistent : Warning<
157   "type %0 has incompatible definitions in different translation units">,
158   InGroup<DiagGroup<"odr">>;
159 def note_odr_tag_kind_here: Note<
160   "%0 is a %select{struct|interface|union|class|enum}1 here">;
161 def note_odr_field : Note<"field %0 has type %1 here">;
162 def note_odr_missing_field : Note<"no corresponding field here">;
163 def note_odr_bit_field : Note<"bit-field %0 with type %1 and length %2 here">;
164 def note_odr_not_bit_field : Note<"field %0 is not a bit-field">;
165 def note_odr_base : Note<"class has base type %0">;
166 def note_odr_virtual_base : Note<
167   "%select{non-virtual|virtual}0 derivation here">;
168 def note_odr_missing_base : Note<"no corresponding base class here">;
169 def note_odr_number_of_bases : Note<
170   "class has %0 base %plural{1:class|:classes}0">;
171 def note_odr_enumerator : Note<"enumerator %0 with value %1 here">;
172 def note_odr_missing_enumerator : Note<"no corresponding enumerator here">;
173
174 def err_odr_field_type_inconsistent : Error<
175   "field %0 declared with incompatible types in different "
176   "translation units (%1 vs. %2)">;
177
178 // Importing Objective-C ASTs
179 def err_odr_ivar_type_inconsistent : Error<
180   "instance variable %0 declared with incompatible types in different "
181   "translation units (%1 vs. %2)">;
182 def err_odr_objc_superclass_inconsistent : Error<
183   "class %0 has incompatible superclasses">;
184 def note_odr_objc_superclass : Note<"inherits from superclass %0 here">;
185 def note_odr_objc_missing_superclass : Note<"no corresponding superclass here">;
186 def err_odr_objc_method_result_type_inconsistent : Error<
187   "%select{class|instance}0 method %1 has incompatible result types in "
188   "different translation units (%2 vs. %3)">;
189 def err_odr_objc_method_num_params_inconsistent : Error<
190   "%select{class|instance}0 method %1 has a different number of parameters in "
191   "different translation units (%2 vs. %3)">;
192 def err_odr_objc_method_param_type_inconsistent : Error<
193   "%select{class|instance}0 method %1 has a parameter with a different types "
194   "in different translation units (%2 vs. %3)">;
195 def err_odr_objc_method_variadic_inconsistent : Error<
196   "%select{class|instance}0 method %1 is variadic in one translation unit "
197   "and not variadic in another">;
198 def note_odr_objc_method_here : Note<
199   "%select{class|instance}0 method %1 also declared here">;
200 def err_odr_objc_property_type_inconsistent : Error<
201   "property %0 declared with incompatible types in different "
202   "translation units (%1 vs. %2)">;
203 def err_odr_objc_property_impl_kind_inconsistent : Error<
204   "property %0 is implemented with %select{@synthesize|@dynamic}1 in one "
205   "translation but %select{@dynamic|@synthesize}1 in another translation unit">;
206 def note_odr_objc_property_impl_kind : Note<
207   "property %0 is implemented with %select{@synthesize|@dynamic}1 here">;
208 def err_odr_objc_synthesize_ivar_inconsistent : Error<
209   "property %0 is synthesized to different ivars in different translation "
210   "units (%1 vs. %2)">;
211 def note_odr_objc_synthesize_ivar_here : Note<
212   "property is synthesized to ivar %0 here">;
213
214 // Importing C++ ASTs
215 def err_odr_different_num_template_parameters : Error<
216   "template parameter lists have a different number of parameters (%0 vs %1)">;
217 def note_odr_template_parameter_list : Note<
218   "template parameter list also declared here">;
219 def err_odr_different_template_parameter_kind : Error<
220   "template parameter has different kinds in different translation units">;
221 def note_odr_template_parameter_here : Note<
222   "template parameter declared here">;
223 def err_odr_parameter_pack_non_pack : Error<
224   "parameter kind mismatch; parameter is %select{not a|a}0 parameter pack">;
225 def note_odr_parameter_pack_non_pack : Note<
226   "%select{parameter|parameter pack}0 declared here">;
227 def err_odr_non_type_parameter_type_inconsistent : Error<
228   "non-type template parameter declared with incompatible types in different "
229   "translation units (%0 vs. %1)">;
230 def err_unsupported_ast_node: Error<"cannot import unsupported AST node %0">;
231 }