1 //==--- DiagnosticCommonKinds.td - common diagnostics ---------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 //===----------------------------------------------------------------------===//
11 //===----------------------------------------------------------------------===//
13 let Component = "Common" in {
17 def select_constexpr_spec_kind : TextSubstitution<
18 "%select{<ERROR>|constexpr|consteval|constinit}0">;
22 def fatal_too_many_errors
23 : Error<"too many errors emitted, stopping now">, DefaultFatal;
25 def warn_stack_exhausted : Warning<
26 "stack nearly exhausted; compilation time may suffer, and "
27 "crashes due to stack overflow are likely">,
28 InGroup<DiagGroup<"stack-exhausted">>, NoSFINAE;
30 def note_declared_at : Note<"declared here">;
31 def note_previous_definition : Note<"previous definition is here">;
32 def note_previous_declaration : Note<"previous declaration is here">;
33 def note_previous_implicit_declaration : Note<
34 "previous implicit declaration is here">;
35 def note_previous_use : Note<"previous use is here">;
36 def note_duplicate_case_prev : Note<"previous case defined here">;
37 def note_forward_declaration : Note<"forward declaration of %0">;
38 def note_type_being_defined : Note<
39 "definition of %0 is not complete until the closing '}'">;
40 /// note_matching - this is used as a continuation of a previous diagnostic,
41 /// e.g. to specify the '(' when we expected a ')'.
42 def note_matching : Note<"to match this %0">;
44 def note_using : Note<"using">;
45 def note_possibility : Note<"one possibility">;
46 def note_also_found : Note<"also found">;
50 let CategoryName = "Lexical or Preprocessor Issue" in {
52 def err_expected_colon_after_setter_name : Error<
53 "method name referenced in property setter attribute "
55 def err_expected_string_literal : Error<"expected string literal "
56 "%select{in %1|for diagnostic message in static_assert|"
57 "for optional message in 'availability' attribute|"
58 "for %select{language|source container}1 name in "
59 "'external_source_symbol' attribute}0">;
60 def err_invalid_string_udl : Error<
61 "string literal with user-defined suffix cannot be used here">;
62 def err_invalid_character_udl : Error<
63 "character literal with user-defined suffix cannot be used here">;
64 def err_invalid_numeric_udl : Error<
65 "numeric literal with user-defined suffix cannot be used here">;
71 let CategoryName = "Parse Issue" in {
73 def err_expected : Error<"expected %0">;
74 def err_expected_either : Error<"expected %0 or %1">;
75 def err_expected_after : Error<"expected %1 after %0">;
77 def err_param_redefinition : Error<"redefinition of parameter %0">;
78 def warn_method_param_redefinition : Warning<"redefinition of method parameter %0">;
79 def warn_method_param_declaration : Warning<"redeclaration of method parameter %0">,
80 InGroup<DuplicateArgDecl>, DefaultIgnore;
81 def err_invalid_storage_class_in_func_decl : Error<
82 "invalid storage class specifier in function declarator">;
83 def err_expected_namespace_name : Error<"expected namespace name">;
84 def ext_variadic_templates : ExtWarn<
85 "variadic templates are a C++11 extension">, InGroup<CXX11>;
86 def warn_cxx98_compat_variadic_templates :
87 Warning<"variadic templates are incompatible with C++98">,
88 InGroup<CXX98Compat>, DefaultIgnore;
89 def err_default_special_members : Error<
90 "only special member functions %select{|and comparison operators }0"
92 def err_deleted_non_function : Error<
93 "only functions can have deleted definitions">;
94 def err_module_not_found : Error<"module '%0' not found">, DefaultFatal;
95 def err_module_not_built : Error<"could not build module '%0'">, DefaultFatal;
96 def err_module_build_disabled: Error<
97 "module '%0' is needed but has not been provided, and implicit use of module "
98 "files is disabled">, DefaultFatal;
99 def err_module_unavailable : Error<
100 "module '%0' %select{is incompatible with|requires}1 feature '%2'">;
101 def err_module_header_missing : Error<
102 "%select{|umbrella }0header '%1' not found">;
103 def remark_module_lock_failure : Remark<
104 "could not acquire lock file for module '%0': %1">, InGroup<ModuleBuild>;
105 def remark_module_lock_timeout : Remark<
106 "timed out waiting to acquire lock file for module '%0'">, InGroup<ModuleBuild>;
107 def err_module_shadowed : Error<"import of shadowed module '%0'">, DefaultFatal;
108 def err_module_build_shadowed_submodule : Error<
109 "build a shadowed submodule '%0'">, DefaultFatal;
110 def err_module_cycle : Error<"cyclic dependency in module '%0': %1">,
112 def err_module_prebuilt : Error<
113 "error in loading module '%0' from prebuilt module path">, DefaultFatal;
114 def note_pragma_entered_here : Note<"#pragma entered here">;
115 def note_decl_hiding_tag_type : Note<
116 "%1 %0 is hidden by a non-type declaration of %0 here">;
117 def err_attribute_not_type_attr : Error<
118 "%0 attribute cannot be applied to types">;
119 def err_enum_template : Error<"enumeration cannot be a template">;
121 def warn_cxx20_compat_consteval : Warning<
122 "'consteval' specifier is incompatible with C++ standards before C++20">,
123 InGroup<CXX20Compat>, DefaultIgnore;
127 let CategoryName = "Nullability Issue" in {
129 def warn_nullability_duplicate : Warning<
130 "duplicate nullability specifier %0">,
131 InGroup<Nullability>;
133 def warn_conflicting_nullability_attr_overriding_ret_types : Warning<
134 "conflicting nullability specifier on return types, %0 "
135 "conflicts with existing specifier %1">,
136 InGroup<Nullability>;
138 def warn_conflicting_nullability_attr_overriding_param_types : Warning<
139 "conflicting nullability specifier on parameter types, %0 "
140 "conflicts with existing specifier %1">,
141 InGroup<Nullability>;
143 def err_nullability_conflicting : Error<
144 "nullability specifier %0 conflicts with existing specifier %1">;
148 // OpenCL Section 6.8.g
149 def err_opencl_unknown_type_specifier : Error<
150 "%select{OpenCL C|C++ for OpenCL}0 version %1 does not support the "
151 "'%2' %select{type qualifier|storage class specifier}3">;
153 def warn_unknown_attribute_ignored : Warning<
154 "unknown attribute %0 ignored">, InGroup<UnknownAttributes>;
155 def err_use_of_tag_name_without_tag : Error<
156 "must use '%1' tag to refer to type %0%select{| in this scope}2">;
158 def duplicate_declspec : TextSubstitution<
159 "duplicate '%0' declaration specifier">;
161 def ext_duplicate_declspec : Extension<"%sub{duplicate_declspec}0">,
162 InGroup<DuplicateDeclSpecifier>;
163 def ext_warn_duplicate_declspec : ExtWarn<"%sub{duplicate_declspec}0">,
164 InGroup<DuplicateDeclSpecifier>;
165 def warn_duplicate_declspec : Warning<"%sub{duplicate_declspec}0">,
166 InGroup<DuplicateDeclSpecifier>;
168 def err_duplicate_declspec : Error<"%sub{duplicate_declspec}0">;
170 def err_friend_decl_spec : Error<"'%0' is invalid in friend declarations">;
172 def err_invalid_member_in_interface : Error<
173 "%select{data member |non-public member function |static member function |"
174 "user-declared constructor|user-declared destructor|operator |"
175 "nested class }0%1 is not permitted within an interface type">;
177 def err_attribute_uuid_malformed_guid : Error<
178 "uuid attribute contains a malformed GUID">;
181 def ext_c99_longlong : Extension<
182 "'long long' is an extension when C99 mode is not enabled">,
184 def ext_cxx11_longlong : Extension<
185 "'long long' is a C++11 extension">,
186 InGroup<CXX11LongLong>;
187 def warn_cxx98_compat_longlong : Warning<
188 "'long long' is incompatible with C++98">,
189 InGroup<CXX98CompatPedantic>, DefaultIgnore;
190 def err_integer_literal_too_large : Error<
191 "integer literal is too large to be represented in any %select{signed |}0"
193 def ext_integer_literal_too_large_for_signed : ExtWarn<
194 "integer literal is too large to be represented in a signed integer type, "
195 "interpreting as unsigned">,
196 InGroup<ImplicitlyUnsignedLiteral>;
197 def warn_old_implicitly_unsigned_long : Warning<
198 "integer literal is too large to be represented in type 'long', "
199 "interpreting as 'unsigned long' per C89; this literal will "
200 "%select{have type 'long long'|be ill-formed}0 in C99 onwards">,
202 def warn_old_implicitly_unsigned_long_cxx : Warning<
203 "integer literal is too large to be represented in type 'long', "
204 "interpreting as 'unsigned long' per C++98; this literal will "
205 "%select{have type 'long long'|be ill-formed}0 in C++11 onwards">,
206 InGroup<CXX11Compat>;
207 def ext_old_implicitly_unsigned_long_cxx : ExtWarn<
208 "integer literal is too large to be represented in type 'long' and is "
209 "subject to undefined behavior under C++98, interpreting as 'unsigned long'; "
210 "this literal will %select{have type 'long long'|be ill-formed}0 "
212 InGroup<CXX11Compat>;
213 def ext_clang_enable_if : Extension<"'enable_if' is a clang extension">,
215 def ext_clang_diagnose_if : Extension<"'diagnose_if' is a clang extension">,
217 def err_too_large_for_fixed_point : Error<
218 "this value is too large for this fixed point type">;
219 def err_fixed_point_not_enabled : Error<"compile with "
220 "'-ffixed-point' to enable fixed point types">;
221 def err_unimplemented_conversion_with_fixed_point_type : Error<
222 "conversion between fixed point and %0 is not yet supported">;
225 def err_seh_expected_handler : Error<
226 "expected '__except' or '__finally' block">;
227 def err_seh___except_block : Error<
228 "%0 only allowed in __except block or filter expression">;
229 def err_seh___except_filter : Error<
230 "%0 only allowed in __except filter expression">;
231 def err_seh___finally_block : Error<
232 "%0 only allowed in __finally block">;
235 def note_invalid_subexpr_in_const_expr : Note<
236 "subexpression not valid in a constant expression">;
239 let CategoryName = "Inline Assembly Issue" in {
240 def err_asm_invalid_type_in_input : Error<
241 "invalid type %0 in asm input for constraint '%1'">;
244 // Sema && Serialization
245 def warn_dup_category_def : Warning<
246 "duplicate definition of category %1 on interface %0">;
250 def err_target_unknown_triple : Error<
251 "unknown target triple '%0', please use -triple or -arch">;
252 def err_target_unknown_cpu : Error<"unknown target CPU '%0'">;
253 def note_valid_options : Note<"valid target CPU values are: %0">;
254 def err_target_unsupported_cpu_for_micromips : Error<
255 "micromips is not supported for target CPU '%0'">;
256 def err_target_unknown_abi : Error<"unknown target ABI '%0'">;
257 def err_target_unsupported_abi : Error<"ABI '%0' is not supported on CPU '%1'">;
258 def err_target_unsupported_abi_for_triple : Error<
259 "ABI '%0' is not supported for '%1'">;
260 def err_unsupported_abi_for_opt : Error<"'%0' can only be used with the '%1' ABI">;
261 def err_mips_fp64_req : Error<
262 "'%0' can only be used if the target supports the mfhc1 and mthc1 instructions">;
263 def err_target_unknown_fpmath : Error<"unknown FP unit '%0'">;
264 def err_target_unsupported_fpmath : Error<
265 "the '%0' unit is not supported with this instruction set">;
266 def err_target_unsupported_unaligned : Error<
267 "the %0 sub-architecture does not support unaligned accesses">;
268 def err_target_unsupported_execute_only : Error<
269 "execute only is not supported for the %0 sub-architecture">;
270 def err_target_unsupported_mcmse : Error<
271 "-mcmse is not supported for %0">;
272 def err_opt_not_valid_with_opt : Error<
273 "option '%0' cannot be specified with '%1'">;
274 def err_opt_not_valid_without_opt : Error<
275 "option '%0' cannot be specified without '%1'">;
276 def err_opt_not_valid_on_target : Error<
277 "option '%0' cannot be specified on this target">;
280 def err_cannot_open_file : Error<"cannot open file '%0': %1">, DefaultFatal;
281 def err_file_modified : Error<
282 "file '%0' modified since it was first processed">, DefaultFatal;
283 def err_file_too_large : Error<
284 "sorry, unsupported: file '%0' is too large for Clang to process">;
285 def err_unsupported_bom : Error<"%0 byte order mark detected in '%1', but "
286 "encoding is not supported">, DefaultFatal;
287 def err_unable_to_rename_temp : Error<
288 "unable to rename temporary '%0' to output file '%1': '%2'">;
289 def err_unable_to_make_temp : Error<
290 "unable to make temporary file: %0">;
293 def err_module_format_unhandled : Error<
294 "no handler registered for module format '%0'">, DefaultFatal;
297 // TODO: Use a custom category name to distinguish rewriter errors.
298 def err_mt_message : Error<"[rewriter] %0">, SuppressInSystemHeader;
299 def warn_mt_message : Warning<"[rewriter] %0">;
300 def note_mt_message : Note<"[rewriter] %0">;
303 def warn_arcmt_nsalloc_realloc : Warning<"[rewriter] call returns pointer to GC managed memory; it will become unmanaged in ARC">;
304 def err_arcmt_nsinvocation_ownership : Error<"NSInvocation's %0 is not safe to be used with an object with ownership other than __unsafe_unretained">;
307 def err_openclcxx_not_supported : Error<
308 "'%0' is not supported in C++ for OpenCL">;
311 def warn_ignored_hip_only_option : Warning<
312 "'%0' is ignored since it is only supported for HIP">,
316 def err_omp_more_one_clause : Error<
317 "directive '#pragma omp %0' cannot contain more than one '%1' clause%select{| with '%3' name modifier| with 'source' dependence}2">;
319 // Static Analyzer Core
320 def err_unknown_analyzer_checker_or_package : Error<
321 "no analyzer checkers or packages are associated with '%0'">;
322 def note_suggest_disabling_all_checkers : Note<
323 "use -analyzer-disable-all-checks to disable all static analyzer checkers">;
325 // Poison system directories.
326 def warn_poison_system_directories : Warning <
327 "include location '%0' is unsafe for cross-compilation">,
328 InGroup<DiagGroup<"poison-system-directories">>, DefaultIgnore;