Clang Project

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