]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm-project/clang/include/clang/Basic/DiagnosticSerializationKinds.td
zfs: merge openzfs/zfs@508fff0e4 (zfs-2.1-release) into stable/13
[FreeBSD/FreeBSD.git] / contrib / llvm-project / clang / include / clang / Basic / DiagnosticSerializationKinds.td
1 //==--- DiagnosticSerializationKinds.td - serialization 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 let Component = "Serialization" in {
10 let CategoryName = "AST Deserialization Issue" in {
11
12 def err_fe_unable_to_read_pch_file : Error<
13     "unable to read PCH file %0: '%1'">;
14 def err_fe_not_a_pch_file : Error<
15     "input is not a PCH file: '%0'">;
16 def err_fe_pch_malformed : Error<
17     "malformed or corrupted AST file: '%0'">, DefaultFatal;
18 def err_fe_pch_malformed_block : Error<
19     "malformed block record in PCH file: '%0'">, DefaultFatal;
20 def err_fe_pch_file_modified : Error<
21     "file '%0' has been modified since the precompiled header '%1' was built"
22     ": %select{size|mtime|content}2 changed">,
23     DefaultFatal;
24 def err_fe_module_file_modified : Error<
25     "file '%0' has been modified since the module file '%1' was built"
26     ": %select{size|mtime|content}2 changed">,
27     DefaultFatal;
28 def err_fe_ast_file_modified : Error<
29     "file '%0' has been modified since the AST file '%1' was built"
30     ": %select{size|mtime|content}2 changed">,
31     DefaultFatal;
32 def err_fe_pch_file_overridden : Error<
33     "file '%0' from the precompiled header has been overridden">;
34 def note_pch_required_by : Note<"'%0' required by '%1'">;
35 def note_pch_rebuild_required : Note<"please rebuild precompiled header '%0'">;
36 def note_module_cache_path : Note<
37     "after modifying system headers, please delete the module cache at '%0'">;
38
39 def err_pch_targetopt_mismatch : Error<
40     "PCH file was compiled for the %0 '%1' but the current translation "
41     "unit is being compiled for target '%2'">;
42 def err_pch_targetopt_feature_mismatch : Error<
43     "%select{AST file was|current translation unit is}0 compiled with the target "
44     "feature '%1' but the %select{current translation unit is|AST file was}0 "
45     "not">;
46 def err_pch_langopt_mismatch : Error<"%0 was %select{disabled|enabled}1 in "
47     "PCH file but is currently %select{disabled|enabled}2">;
48 def err_pch_langopt_value_mismatch : Error<
49   "%0 differs in PCH file vs. current file">;
50 def err_pch_diagopt_mismatch : Error<"%0 is currently enabled, but was not in "
51   "the PCH file">;
52 def err_pch_modulecache_mismatch : Error<"PCH was compiled with module cache "
53   "path '%0', but the path is currently '%1'">;
54
55 def err_pch_version_too_old : Error<
56     "PCH file uses an older PCH format that is no longer supported">;
57 def err_pch_version_too_new : Error<
58     "PCH file uses a newer PCH format that cannot be read">;
59 def err_pch_different_branch : Error<
60     "PCH file built from a different branch (%0) than the compiler (%1)">;
61 def err_pch_with_compiler_errors : Error<
62     "PCH file contains compiler errors">;
63
64 def err_module_file_conflict : Error<
65   "module '%0' is defined in both '%1' and '%2'">, DefaultFatal;
66 def err_module_file_not_found : Error<
67   "%select{PCH|module|AST}0 file '%1' not found%select{|: %3}2">, DefaultFatal;
68 def err_module_file_out_of_date : Error<
69   "%select{PCH|module|AST}0 file '%1' is out of date and "
70   "needs to be rebuilt%select{|: %3}2">, DefaultFatal;
71 def err_module_file_invalid : Error<
72   "file '%1' is not a valid precompiled %select{PCH|module|AST}0 file">, DefaultFatal;
73 def note_module_file_imported_by : Note<
74   "imported by %select{|module '%2' in }1'%0'">;
75 def err_module_file_not_module : Error<
76   "AST file '%0' was not built as a module">, DefaultFatal;
77 def err_module_file_missing_top_level_submodule : Error<
78   "module file '%0' is missing its top-level submodule">, DefaultFatal;
79
80 def remark_module_import : Remark<
81   "importing module '%0'%select{| into '%3'}2 from '%1'">,
82   InGroup<ModuleImport>;
83
84 def err_imported_module_not_found : Error<
85     "module '%0' in AST file '%1' %select{(imported by AST file '%2') |}4"
86     "is not defined in any loaded module map file; "
87     "maybe you need to load '%3'?">, DefaultFatal;
88 def note_imported_by_pch_module_not_found : Note<
89     "consider adding '%0' to the header search path">;
90 def err_imported_module_modmap_changed : Error<
91     "module '%0' %select{in|imported by}4 AST file '%1' found in a different module map file"
92     " (%2) than when the importing AST file was built (%3)">, DefaultFatal;
93 def err_imported_module_relocated : Error<
94     "module '%0' was built in directory '%1' but now resides in "
95     "directory '%2'">, DefaultFatal;
96 def err_module_different_modmap : Error<
97     "module '%0' %select{uses|does not use}1 additional module map '%2'"
98     "%select{| not}1 used when the module was built">;
99
100 def err_pch_macro_def_undef : Error<
101     "macro '%0' was %select{defined|undef'd}1 in the precompiled header but "
102     "%select{undef'd|defined}1 on the command line">;
103 def err_pch_macro_def_conflict : Error<
104     "definition of macro '%0' differs between the precompiled header ('%1') "
105     "and the command line ('%2')">;
106 def err_pch_undef : Error<
107     "%select{command line contains|precompiled header was built with}0 "
108     "'-undef' but %select{precompiled header was not built with it|"
109     "it is not present on the command line}0">;
110 def err_pch_pp_detailed_record : Error<
111     "%select{command line contains|precompiled header was built with}0 "
112     "'-detailed-preprocessing-record' but %select{precompiled header was not "
113     "built with it|it is not present on the command line}0">;
114
115 def err_module_odr_violation_missing_decl : Error<
116   "%q0 from module '%1' is not present in definition of %q2"
117   "%select{ in module '%4'| provided earlier}3">, NoSFINAE;
118 def note_module_odr_violation_no_possible_decls : Note<
119   "definition has no member %0">;
120 def note_module_odr_violation_possible_decl : Note<
121   "declaration of %0 does not match">;
122 def err_module_odr_violation_different_definitions : Error<
123   "%q0 has different definitions in different modules; "
124   "%select{definition in module '%2' is here|defined here}1">;
125 def note_first_module_difference : Note<
126   "in first definition, possible difference is here">;
127 def note_module_odr_violation_different_definitions : Note<
128   "definition in module '%0' is here">;
129 def note_second_module_difference : Note<
130   "in second definition, possible difference is here">;
131
132 def err_module_odr_violation_different_instantiations : Error<
133   "instantiation of %q0 is different in different modules">;
134
135 def err_module_odr_violation_definition_data : Error <
136   "%q0 has different definitions in different modules; first difference is "
137   "%select{definition in module '%2'|defined here}1 found "
138   "%select{"
139   "%4 base %plural{1:class|:classes}4|"
140   "%4 virtual base %plural{1:class|:classes}4|"
141   "%ordinal4 base class with type %5|"
142   "%ordinal4 %select{non-virtual|virtual}5 base class %6|"
143   "%ordinal4 base class %5 with "
144   "%select{public|protected|private|no}6 access specifier}3">;
145
146 def note_module_odr_violation_definition_data : Note <
147   "but in '%0' found "
148   "%select{"
149   "%2 base %plural{1:class|:classes}2|"
150   "%2 virtual base %plural{1:class|:classes}2|"
151   "%ordinal2 base class with different type %3|"
152   "%ordinal2 %select{non-virtual|virtual}3 base class %4|"
153   "%ordinal2 base class %3 with "
154   "%select{public|protected|private|no}4 access specifier}1">;
155
156 def err_module_odr_violation_template_parameter : Error <
157   "%q0 has different definitions in different modules; first difference is "
158   "%select{definition in module '%2'|defined here}1 found "
159   "%select{"
160   "unnamed template parameter|"
161   "template parameter %4|"
162   "template parameter with %select{no |}4default argument|"
163   "template parameter with default argument}3">;
164
165
166 def note_module_odr_violation_template_parameter : Note <
167   "but in '%0' found "
168   "%select{"
169   "unnamed template parameter %2|"
170   "template parameter %2|"
171   "template parameter with %select{no |}2default argument|"
172   "template parameter with different default argument}1">;
173
174 def err_module_odr_violation_mismatch_decl : Error<
175   "%q0 has different definitions in different modules; first difference is "
176   "%select{definition in module '%2'|defined here}1 found "
177   "%select{end of class|public access specifier|private access specifier|"
178   "protected access specifier|static assert|field|method|type alias|typedef|"
179   "data member|friend declaration|function template}3">;
180 def note_module_odr_violation_mismatch_decl : Note<"but in '%0' found "
181   "%select{end of class|public access specifier|private access specifier|"
182   "protected access specifier|static assert|field|method|type alias|typedef|"
183   "data member|friend declaration|function template}1">;
184
185 def err_module_odr_violation_mismatch_decl_diff : Error<
186   "%q0 has different definitions in different modules; first difference is "
187   "%select{definition in module '%2'|defined here}1 found "
188   "%select{"
189   "static assert with condition|"
190   "static assert with message|"
191   "static assert with %select{|no }4message|"
192   "field %4|"
193   "field %4 with type %5|"
194   "%select{non-|}5bitfield %4|"
195   "bitfield %4 with one width expression|"
196   "%select{non-|}5mutable field %4|"
197   "field %4 with %select{no|an}5 initalizer|"
198   "field %4 with an initializer|"
199   "%select{method %5|constructor|destructor}4|"
200   "%select{method %5|constructor|destructor}4 "
201     "is %select{not deleted|deleted}6|"
202   "%select{method %5|constructor|destructor}4 "
203     "is %select{not defaulted|defaulted}6|"
204   "%select{method %5|constructor|destructor}4 "
205     "is %select{|pure }6%select{not virtual|virtual}7|"
206   "%select{method %5|constructor|destructor}4 "
207     "is %select{not static|static}6|"
208   "%select{method %5|constructor|destructor}4 "
209     "is %select{not volatile|volatile}6|"
210   "%select{method %5|constructor|destructor}4 "
211     "is %select{not const|const}6|"
212   "%select{method %5|constructor|destructor}4 "
213     "is %select{not inline|inline}6|"
214   "%select{method %5|constructor|destructor}4 "
215     "that has %6 parameter%s6|"
216   "%select{method %5|constructor|destructor}4 "
217     "with %ordinal6 parameter of type %7%select{| decayed from %9}8|"
218   "%select{method %5|constructor|destructor}4 "
219     "with %ordinal6 parameter named %7|"
220   "%select{method %5|constructor|destructor}4 "
221     "with %ordinal6 parameter with%select{out|}7 a default argument|"
222   "%select{method %5|constructor|destructor}4 "
223     "with %ordinal6 parameter with a default argument|"
224   "%select{method %5|constructor|destructor}4 "
225     "with %select{no |}6template arguments|"
226   "%select{method %5|constructor|destructor}4 "
227     "with %6 template argument%s6|"
228   "%select{method %5|constructor|destructor}4 "
229     "with %6 for %ordinal7 template argument|"
230   "%select{method %5|constructor|destructor}4 "
231     "with %select{no body|body}6|"
232   "%select{method %5|constructor|destructor}4 "
233     "with body|"
234   "%select{typedef|type alias}4 name %5|"
235   "%select{typedef|type alias}4 %5 with underlying type %6|"
236   "data member with name %4|"
237   "data member %4 with type %5|"
238   "data member %4 with%select{out|}5 an initializer|"
239   "data member %4 with an initializer|"
240   "data member %4 %select{is constexpr|is not constexpr}5|"
241   "friend %select{class|function}4|"
242   "friend %4|"
243   "friend function %4|"
244   "function template %4 with %5 template parameter%s5|"
245   "function template %4 with %ordinal5 template parameter being a "
246     "%select{type|non-type|template}6 template parameter|"
247   "function template %4 with %ordinal5 template parameter "
248     "%select{with no name|named %7}6|"
249   "function template %4 with %ordinal5 template parameter with "
250     "%select{no |}6default argument|"
251   "function template %4 with %ordinal5 template parameter with "
252     "default argument %6|"
253   "function template %4 with %ordinal5 template parameter with one type|"
254   "function template %4 with %ordinal5 template parameter %select{not |}6"
255     "being a template parameter pack|"
256   "}3">;
257
258 def note_module_odr_violation_mismatch_decl_diff : Note<"but in '%0' found "
259   "%select{"
260   "static assert with different condition|"
261   "static assert with different message|"
262   "static assert with %select{|no }2message|"
263   "field %2|"
264   "field %2 with type %3|"
265   "%select{non-|}3bitfield %2|"
266   "bitfield %2 with different width expression|"
267   "%select{non-|}3mutable field %2|"
268   "field %2 with %select{no|an}3 initializer|"
269   "field %2 with a different initializer|"
270   "%select{method %3|constructor|destructor}2|"
271   "%select{method %3|constructor|destructor}2 "
272     "is %select{not deleted|deleted}4|"
273   "%select{method %3|constructor|destructor}2 "
274     "is %select{not defaulted|defaulted}4|"
275   "%select{method %3|constructor|destructor}2 "
276     "is %select{|pure }4%select{not virtual|virtual}5|"
277   "%select{method %3|constructor|destructor}2 "
278     "is %select{not static|static}4|"
279   "%select{method %3|constructor|destructor}2 "
280     "is %select{not volatile|volatile}4|"
281   "%select{method %3|constructor|destructor}2 "
282     "is %select{not const|const}4|"
283   "%select{method %3|constructor|destructor}2 "
284     "is %select{not inline|inline}4|"
285   "%select{method %3|constructor|destructor}2 "
286     "that has %4 parameter%s4|"
287   "%select{method %3|constructor|destructor}2 "
288     "with %ordinal4 parameter of type %5%select{| decayed from %7}6|"
289   "%select{method %3|constructor|destructor}2 "
290     "with %ordinal4 parameter named %5|"
291   "%select{method %3|constructor|destructor}2 "
292     "with %ordinal4 parameter with%select{out|}5 a default argument|"
293   "%select{method %3|constructor|destructor}2 "
294     "with %ordinal4 parameter with a different default argument|"
295   "%select{method %3|constructor|destructor}2 "
296     "with %select{no |}4template arguments|"
297   "%select{method %3|constructor|destructor}2 "
298     "with %4 template argument%s4|"
299   "%select{method %3|constructor|destructor}2 "
300     "with %4 for %ordinal5 template argument|"
301   "%select{method %3|constructor|destructor}2 "
302     "with %select{no body|body}4|"
303   "%select{method %3|constructor|destructor}2 "
304     "with different body|"
305   "%select{typedef|type alias}2 name %3|"
306   "%select{typedef|type alias}2 %3 with different underlying type %4|"
307   "data member with name %2|"
308   "data member %2 with different type %3|"
309   "data member %2 with%select{out|}3 an initializer|"
310   "data member %2 with a different initializer|"
311   "data member %2 %select{is constexpr|is not constexpr}3|"
312   "friend %select{class|function}2|"
313   "friend %2|"
314   "friend function %2|"
315   "function template %2 with %3 template parameter%s3|"
316   "function template %2 with %ordinal3 template paramter being a "
317     "%select{type|non-type|template}4 template parameter|"
318   "function template %2 with %ordinal3 template parameter "
319     "%select{with no name|named %5}4|"
320   "function template %2 with %ordinal3 template parameter with "
321     "%select{no |}4default argument|"
322   "function template %2 with %ordinal3 template parameter with "
323     "default argument %4|"
324   "function template %2 with %ordinal3 template parameter with different type|"
325   "function template %2 with %ordinal3 template parameter %select{not |}4"
326     "being a template parameter pack|"
327   "}1">;
328
329 def err_module_odr_violation_function : Error<
330   "%q0 has different definitions in different modules; "
331   "%select{definition in module '%2'|defined here}1 "
332   "first difference is "
333   "%select{"
334   "return type is %4|"
335   "%ordinal4 parameter with name %5|"
336   "%ordinal4 parameter with type %5%select{| decayed from %7}6|"
337   "%ordinal4 parameter with%select{out|}5 a default argument|"
338   "%ordinal4 parameter with a default argument|"
339   "function body"
340   "}3">;
341
342 def note_module_odr_violation_function : Note<"but in '%0' found "
343   "%select{"
344   "different return type %2|"
345   "%ordinal2 parameter with name %3|"
346   "%ordinal2 parameter with type %3%select{| decayed from %5}4|"
347   "%ordinal2 parameter with%select{out|}3 a default argument|"
348   "%ordinal2 parameter with a different default argument|"
349   "a different body"
350   "}1">;
351
352 def err_module_odr_violation_enum : Error<
353   "%q0 has different definitions in different modules; "
354   "%select{definition in module '%2'|defined here}1 "
355   "first difference is "
356   "%select{"
357   "enum that is %select{not scoped|scoped}4|"
358   "enum scoped with keyword %select{struct|class}4|"
359   "enum %select{without|with}4 specified type|"
360   "enum with specified type %4|"
361   "enum with %4 element%s4|"
362   "%ordinal4 element has name %5|"
363   "%ordinal4 element %5 %select{has|does not have}6 an initilizer|"
364   "%ordinal4 element %5 has an initializer|"
365   "}3">;
366
367 def note_module_odr_violation_enum : Note<"but in '%0' found "
368   "%select{"
369   "enum that is %select{not scoped|scoped}2|"
370   "enum scoped with keyword %select{struct|class}2|"
371   "enum %select{without|with}2 specified type|"
372   "enum with specified type %2|"
373   "enum with %2 element%s2|"
374   "%ordinal2 element has name %3|"
375   "%ordinal2 element %3 %select{has|does not have}4 an initializer|"
376   "%ordinal2 element %3 has different initializer|"
377   "}1">;
378
379 def err_module_odr_violation_mismatch_decl_unknown : Error<
380   "%q0 %select{with definition in module '%2'|defined here}1 has different "
381   "definitions in different modules; first difference is this "
382   "%select{||||static assert|field|method|type alias|typedef|data member|"
383   "friend declaration|unexpected decl}3">;
384 def note_module_odr_violation_mismatch_decl_unknown : Note<
385   "but in '%0' found "
386   "%select{||||different static assert|different field|different method|"
387   "different type alias|different typedef|different data member|"
388   "different friend declaration|another unexpected decl}1">;
389
390 def warn_duplicate_module_file_extension : Warning<
391   "duplicate module file extension block name '%0'">,
392   InGroup<ModuleFileExtension>;
393
394 def warn_module_system_bit_conflict : Warning<
395   "module file '%0' was validated as a system module and is now being imported "
396   "as a non-system module; any difference in diagnostic options will be ignored">,
397   InGroup<ModuleConflict>;
398 } // let CategoryName
399
400 let CategoryName = "AST Serialization Issue" in {
401 def warn_module_uses_date_time : Warning<
402   "%select{precompiled header|module}0 uses __DATE__ or __TIME__">,
403   InGroup<DiagGroup<"pch-date-time">>;
404 def err_module_no_size_mtime_for_header : Error<
405   "cannot emit module %0: %select{size|mtime}1 must be explicitly specified "
406   "for missing header file \"%2\"">;
407 def err_module_unable_to_hash_content : Error<
408   "failed to hash content for '%0' because memory buffer cannot be retrieved">;
409 } // let CategoryName
410 } // let Component
411