1234287Sdim//==--- DiagnosticSerializationKinds.td - serialization diagnostics -------===// 2234287Sdim// 3353358Sdim// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4353358Sdim// See https://llvm.org/LICENSE.txt for license information. 5353358Sdim// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6234287Sdim// 7234287Sdim//===----------------------------------------------------------------------===// 8234287Sdim 9234287Sdimlet Component = "Serialization" in { 10276479Sdimlet CategoryName = "AST Deserialization Issue" in { 11234287Sdim 12234287Sdimdef err_fe_unable_to_read_pch_file : Error< 13239462Sdim "unable to read PCH file %0: '%1'">; 14234287Sdimdef err_fe_not_a_pch_file : Error< 15234287Sdim "input is not a PCH file: '%0'">; 16234287Sdimdef err_fe_pch_malformed : Error< 17261991Sdim "malformed or corrupted AST file: '%0'">, DefaultFatal; 18234287Sdimdef err_fe_pch_malformed_block : Error< 19234287Sdim "malformed block record in PCH file: '%0'">, DefaultFatal; 20234287Sdimdef err_fe_pch_file_modified : Error< 21360784Sdim "file '%0' has been modified since the precompiled header '%1' was built" 22360784Sdim ": %select{size|mtime|content}2 changed">, 23234287Sdim DefaultFatal; 24314564Sdimdef err_fe_module_file_modified : Error< 25360784Sdim "file '%0' has been modified since the module file '%1' was built" 26360784Sdim ": %select{size|mtime|content}2 changed">, 27314564Sdim DefaultFatal; 28314564Sdimdef err_fe_ast_file_modified : Error< 29360784Sdim "file '%0' has been modified since the AST file '%1' was built" 30360784Sdim ": %select{size|mtime|content}2 changed">, 31314564Sdim DefaultFatal; 32239462Sdimdef err_fe_pch_file_overridden : Error< 33239462Sdim "file '%0' from the precompiled header has been overridden">; 34276479Sdimdef note_pch_required_by : Note<"'%0' required by '%1'">; 35276479Sdimdef note_pch_rebuild_required : Note<"please rebuild precompiled header '%0'">; 36261991Sdimdef note_module_cache_path : Note< 37261991Sdim "after modifying system headers, please delete the module cache at '%0'">; 38234287Sdim 39243830Sdimdef err_pch_targetopt_mismatch : Error< 40243830Sdim "PCH file was compiled for the %0 '%1' but the current translation " 41243830Sdim "unit is being compiled for target '%2'">; 42243830Sdimdef err_pch_targetopt_feature_mismatch : Error< 43341825Sdim "%select{AST file was|current translation unit is}0 compiled with the target " 44341825Sdim "feature '%1' but the %select{current translation unit is|AST file was}0 " 45243830Sdim "not">; 46234287Sdimdef err_pch_langopt_mismatch : Error<"%0 was %select{disabled|enabled}1 in " 47234287Sdim "PCH file but is currently %select{disabled|enabled}2">; 48234287Sdimdef err_pch_langopt_value_mismatch : Error< 49234287Sdim "%0 differs in PCH file vs. current file">; 50276479Sdimdef err_pch_diagopt_mismatch : Error<"%0 is currently enabled, but was not in " 51276479Sdim "the PCH file">; 52288943Sdimdef err_pch_modulecache_mismatch : Error<"PCH was compiled with module cache " 53288943Sdim "path '%0', but the path is currently '%1'">; 54341825Sdim 55276479Sdimdef err_pch_version_too_old : Error< 56234287Sdim "PCH file uses an older PCH format that is no longer supported">; 57276479Sdimdef err_pch_version_too_new : Error< 58234287Sdim "PCH file uses a newer PCH format that cannot be read">; 59276479Sdimdef err_pch_different_branch : Error< 60234287Sdim "PCH file built from a different branch (%0) than the compiler (%1)">; 61234287Sdimdef err_pch_with_compiler_errors : Error< 62234287Sdim "PCH file contains compiler errors">; 63276479Sdim 64296417Sdimdef err_module_file_conflict : Error< 65296417Sdim "module '%0' is defined in both '%1' and '%2'">, DefaultFatal; 66296417Sdimdef err_module_file_not_found : Error< 67296417Sdim "%select{PCH|module|AST}0 file '%1' not found%select{|: %3}2">, DefaultFatal; 68296417Sdimdef err_module_file_out_of_date : Error< 69296417Sdim "%select{PCH|module|AST}0 file '%1' is out of date and " 70296417Sdim "needs to be rebuilt%select{|: %3}2">, DefaultFatal; 71296417Sdimdef err_module_file_invalid : Error< 72296417Sdim "file '%1' is not a valid precompiled %select{PCH|module|AST}0 file">, DefaultFatal; 73296417Sdimdef note_module_file_imported_by : Note< 74296417Sdim "imported by %select{|module '%2' in }1'%0'">; 75296417Sdimdef err_module_file_not_module : Error< 76296417Sdim "AST file '%0' was not built as a module">, DefaultFatal; 77360784Sdimdef err_module_file_missing_top_level_submodule : Error< 78360784Sdim "module file '%0' is missing its top-level submodule">, DefaultFatal; 79296417Sdim 80353358Sdimdef remark_module_import : Remark< 81353358Sdim "importing module '%0'%select{| into '%3'}2 from '%1'">, 82353358Sdim InGroup<ModuleImport>; 83353358Sdim 84276479Sdimdef err_imported_module_not_found : Error< 85360784Sdim "module '%0' in AST file '%1' %select{(imported by AST file '%2') |}4" 86280031Sdim "is not defined in any loaded module map file; " 87280031Sdim "maybe you need to load '%3'?">, DefaultFatal; 88327952Sdimdef note_imported_by_pch_module_not_found : Note< 89327952Sdim "consider adding '%0' to the header search path">; 90276479Sdimdef err_imported_module_modmap_changed : Error< 91360784Sdim "module '%0' %select{in|imported by}4 AST file '%1' found in a different module map file" 92276479Sdim " (%2) than when the importing AST file was built (%3)">, DefaultFatal; 93280031Sdimdef err_imported_module_relocated : Error< 94280031Sdim "module '%0' was built in directory '%1' but now resides in " 95280031Sdim "directory '%2'">, DefaultFatal; 96280031Sdimdef err_module_different_modmap : Error< 97280031Sdim "module '%0' %select{uses|does not use}1 additional module map '%2'" 98280031Sdim "%select{| not}1 used when the module was built">; 99249423Sdim 100243830Sdimdef err_pch_macro_def_undef : Error< 101243830Sdim "macro '%0' was %select{defined|undef'd}1 in the precompiled header but " 102243830Sdim "%select{undef'd|defined}1 on the command line">; 103243830Sdimdef err_pch_macro_def_conflict : Error< 104243830Sdim "definition of macro '%0' differs between the precompiled header ('%1') " 105243830Sdim "and the command line ('%2')">; 106243830Sdimdef err_pch_undef : Error< 107243830Sdim "%select{command line contains|precompiled header was built with}0 " 108243830Sdim "'-undef' but %select{precompiled header was not built with it|" 109243830Sdim "it is not present on the command line}0">; 110251662Sdimdef err_pch_pp_detailed_record : Error< 111251662Sdim "%select{command line contains|precompiled header was built with}0 " 112251662Sdim "'-detailed-preprocessing-record' but %select{precompiled header was not " 113251662Sdim "built with it|it is not present on the command line}0">; 114234287Sdim 115261991Sdimdef err_module_odr_violation_missing_decl : Error< 116261991Sdim "%q0 from module '%1' is not present in definition of %q2" 117261991Sdim "%select{ in module '%4'| provided earlier}3">, NoSFINAE; 118261991Sdimdef note_module_odr_violation_no_possible_decls : Note< 119261991Sdim "definition has no member %0">; 120261991Sdimdef note_module_odr_violation_possible_decl : Note< 121261991Sdim "declaration of %0 does not match">; 122276479Sdimdef err_module_odr_violation_different_definitions : Error< 123276479Sdim "%q0 has different definitions in different modules; " 124276479Sdim "%select{definition in module '%2' is here|defined here}1">; 125321369Sdimdef note_first_module_difference : Note< 126321369Sdim "in first definition, possible difference is here">; 127276479Sdimdef note_module_odr_violation_different_definitions : Note< 128276479Sdim "definition in module '%0' is here">; 129321369Sdimdef note_second_module_difference : Note< 130321369Sdim "in second definition, possible difference is here">; 131321369Sdim 132276479Sdimdef err_module_odr_violation_different_instantiations : Error< 133276479Sdim "instantiation of %q0 is different in different modules">; 134261991Sdim 135327952Sdimdef err_module_odr_violation_definition_data : Error < 136327952Sdim "%q0 has different definitions in different modules; first difference is " 137327952Sdim "%select{definition in module '%2'|defined here}1 found " 138327952Sdim "%select{" 139327952Sdim "%4 base %plural{1:class|:classes}4|" 140327952Sdim "%4 virtual base %plural{1:class|:classes}4|" 141327952Sdim "%ordinal4 base class with type %5|" 142327952Sdim "%ordinal4 %select{non-virtual|virtual}5 base class %6|" 143327952Sdim "%ordinal4 base class %5 with " 144327952Sdim "%select{public|protected|private|no}6 access specifier}3">; 145327952Sdim 146327952Sdimdef note_module_odr_violation_definition_data : Note < 147327952Sdim "but in '%0' found " 148327952Sdim "%select{" 149327952Sdim "%2 base %plural{1:class|:classes}2|" 150327952Sdim "%2 virtual base %plural{1:class|:classes}2|" 151327952Sdim "%ordinal2 base class with different type %3|" 152327952Sdim "%ordinal2 %select{non-virtual|virtual}3 base class %4|" 153327952Sdim "%ordinal2 base class %3 with " 154327952Sdim "%select{public|protected|private|no}4 access specifier}1">; 155327952Sdim 156327952Sdimdef err_module_odr_violation_template_parameter : Error < 157327952Sdim "%q0 has different definitions in different modules; first difference is " 158327952Sdim "%select{definition in module '%2'|defined here}1 found " 159327952Sdim "%select{" 160327952Sdim "unnamed template parameter|" 161327952Sdim "template parameter %4|" 162327952Sdim "template parameter with %select{no |}4default argument|" 163327952Sdim "template parameter with default argument}3">; 164327952Sdim 165327952Sdim 166327952Sdimdef note_module_odr_violation_template_parameter : Note < 167327952Sdim "but in '%0' found " 168327952Sdim "%select{" 169327952Sdim "unnamed template parameter %2|" 170327952Sdim "template parameter %2|" 171327952Sdim "template parameter with %select{no |}2default argument|" 172327952Sdim "template parameter with different default argument}1">; 173327952Sdim 174321369Sdimdef err_module_odr_violation_mismatch_decl : Error< 175321369Sdim "%q0 has different definitions in different modules; first difference is " 176321369Sdim "%select{definition in module '%2'|defined here}1 found " 177321369Sdim "%select{end of class|public access specifier|private access specifier|" 178321369Sdim "protected access specifier|static assert|field|method|type alias|typedef|" 179341825Sdim "data member|friend declaration|function template}3">; 180321369Sdimdef note_module_odr_violation_mismatch_decl : Note<"but in '%0' found " 181321369Sdim "%select{end of class|public access specifier|private access specifier|" 182321369Sdim "protected access specifier|static assert|field|method|type alias|typedef|" 183341825Sdim "data member|friend declaration|function template}1">; 184296417Sdim 185321369Sdimdef err_module_odr_violation_mismatch_decl_diff : Error< 186321369Sdim "%q0 has different definitions in different modules; first difference is " 187321369Sdim "%select{definition in module '%2'|defined here}1 found " 188321369Sdim "%select{" 189321369Sdim "static assert with condition|" 190321369Sdim "static assert with message|" 191321369Sdim "static assert with %select{|no }4message|" 192321369Sdim "field %4|" 193321369Sdim "field %4 with type %5|" 194321369Sdim "%select{non-|}5bitfield %4|" 195321369Sdim "bitfield %4 with one width expression|" 196321369Sdim "%select{non-|}5mutable field %4|" 197321369Sdim "field %4 with %select{no|an}5 initalizer|" 198321369Sdim "field %4 with an initializer|" 199321369Sdim "%select{method %5|constructor|destructor}4|" 200321369Sdim "%select{method %5|constructor|destructor}4 " 201321369Sdim "is %select{not deleted|deleted}6|" 202321369Sdim "%select{method %5|constructor|destructor}4 " 203341825Sdim "is %select{not defaulted|defaulted}6|" 204341825Sdim "%select{method %5|constructor|destructor}4 " 205321369Sdim "is %select{|pure }6%select{not virtual|virtual}7|" 206321369Sdim "%select{method %5|constructor|destructor}4 " 207321369Sdim "is %select{not static|static}6|" 208321369Sdim "%select{method %5|constructor|destructor}4 " 209321369Sdim "is %select{not volatile|volatile}6|" 210321369Sdim "%select{method %5|constructor|destructor}4 " 211321369Sdim "is %select{not const|const}6|" 212321369Sdim "%select{method %5|constructor|destructor}4 " 213321369Sdim "is %select{not inline|inline}6|" 214321369Sdim "%select{method %5|constructor|destructor}4 " 215321369Sdim "that has %6 parameter%s6|" 216321369Sdim "%select{method %5|constructor|destructor}4 " 217321369Sdim "with %ordinal6 parameter of type %7%select{| decayed from %9}8|" 218321369Sdim "%select{method %5|constructor|destructor}4 " 219321369Sdim "with %ordinal6 parameter named %7|" 220321369Sdim "%select{method %5|constructor|destructor}4 " 221321369Sdim "with %ordinal6 parameter with%select{out|}7 a default argument|" 222321369Sdim "%select{method %5|constructor|destructor}4 " 223321369Sdim "with %ordinal6 parameter with a default argument|" 224341825Sdim "%select{method %5|constructor|destructor}4 " 225341825Sdim "with %select{no |}6template arguments|" 226341825Sdim "%select{method %5|constructor|destructor}4 " 227341825Sdim "with %6 template argument%s6|" 228341825Sdim "%select{method %5|constructor|destructor}4 " 229341825Sdim "with %6 for %ordinal7 template argument|" 230341825Sdim "%select{method %5|constructor|destructor}4 " 231341825Sdim "with %select{no body|body}6|" 232341825Sdim "%select{method %5|constructor|destructor}4 " 233341825Sdim "with body|" 234321369Sdim "%select{typedef|type alias}4 name %5|" 235321369Sdim "%select{typedef|type alias}4 %5 with underlying type %6|" 236321369Sdim "data member with name %4|" 237321369Sdim "data member %4 with type %5|" 238321369Sdim "data member %4 with%select{out|}5 an initializer|" 239321369Sdim "data member %4 with an initializer|" 240321369Sdim "data member %4 %select{is constexpr|is not constexpr}5|" 241321369Sdim "friend %select{class|function}4|" 242321369Sdim "friend %4|" 243321369Sdim "friend function %4|" 244341825Sdim "function template %4 with %5 template parameter%s5|" 245341825Sdim "function template %4 with %ordinal5 template parameter being a " 246341825Sdim "%select{type|non-type|template}6 template parameter|" 247341825Sdim "function template %4 with %ordinal5 template parameter " 248341825Sdim "%select{with no name|named %7}6|" 249341825Sdim "function template %4 with %ordinal5 template parameter with " 250341825Sdim "%select{no |}6default argument|" 251341825Sdim "function template %4 with %ordinal5 template parameter with " 252341825Sdim "default argument %6|" 253341825Sdim "function template %4 with %ordinal5 template parameter with one type|" 254341825Sdim "function template %4 with %ordinal5 template parameter %select{not |}6" 255341825Sdim "being a template parameter pack|" 256321369Sdim "}3">; 257321369Sdim 258321369Sdimdef note_module_odr_violation_mismatch_decl_diff : Note<"but in '%0' found " 259321369Sdim "%select{" 260321369Sdim "static assert with different condition|" 261321369Sdim "static assert with different message|" 262321369Sdim "static assert with %select{|no }2message|" 263321369Sdim "field %2|" 264321369Sdim "field %2 with type %3|" 265321369Sdim "%select{non-|}3bitfield %2|" 266321369Sdim "bitfield %2 with different width expression|" 267321369Sdim "%select{non-|}3mutable field %2|" 268321369Sdim "field %2 with %select{no|an}3 initializer|" 269321369Sdim "field %2 with a different initializer|" 270321369Sdim "%select{method %3|constructor|destructor}2|" 271321369Sdim "%select{method %3|constructor|destructor}2 " 272321369Sdim "is %select{not deleted|deleted}4|" 273321369Sdim "%select{method %3|constructor|destructor}2 " 274341825Sdim "is %select{not defaulted|defaulted}4|" 275341825Sdim "%select{method %3|constructor|destructor}2 " 276321369Sdim "is %select{|pure }4%select{not virtual|virtual}5|" 277321369Sdim "%select{method %3|constructor|destructor}2 " 278321369Sdim "is %select{not static|static}4|" 279321369Sdim "%select{method %3|constructor|destructor}2 " 280321369Sdim "is %select{not volatile|volatile}4|" 281321369Sdim "%select{method %3|constructor|destructor}2 " 282321369Sdim "is %select{not const|const}4|" 283321369Sdim "%select{method %3|constructor|destructor}2 " 284321369Sdim "is %select{not inline|inline}4|" 285321369Sdim "%select{method %3|constructor|destructor}2 " 286321369Sdim "that has %4 parameter%s4|" 287321369Sdim "%select{method %3|constructor|destructor}2 " 288321369Sdim "with %ordinal4 parameter of type %5%select{| decayed from %7}6|" 289321369Sdim "%select{method %3|constructor|destructor}2 " 290321369Sdim "with %ordinal4 parameter named %5|" 291321369Sdim "%select{method %3|constructor|destructor}2 " 292321369Sdim "with %ordinal4 parameter with%select{out|}5 a default argument|" 293321369Sdim "%select{method %3|constructor|destructor}2 " 294321369Sdim "with %ordinal4 parameter with a different default argument|" 295341825Sdim "%select{method %3|constructor|destructor}2 " 296341825Sdim "with %select{no |}4template arguments|" 297341825Sdim "%select{method %3|constructor|destructor}2 " 298341825Sdim "with %4 template argument%s4|" 299341825Sdim "%select{method %3|constructor|destructor}2 " 300341825Sdim "with %4 for %ordinal5 template argument|" 301341825Sdim "%select{method %3|constructor|destructor}2 " 302341825Sdim "with %select{no body|body}4|" 303341825Sdim "%select{method %3|constructor|destructor}2 " 304341825Sdim "with different body|" 305321369Sdim "%select{typedef|type alias}2 name %3|" 306321369Sdim "%select{typedef|type alias}2 %3 with different underlying type %4|" 307321369Sdim "data member with name %2|" 308321369Sdim "data member %2 with different type %3|" 309321369Sdim "data member %2 with%select{out|}3 an initializer|" 310321369Sdim "data member %2 with a different initializer|" 311321369Sdim "data member %2 %select{is constexpr|is not constexpr}3|" 312321369Sdim "friend %select{class|function}2|" 313321369Sdim "friend %2|" 314321369Sdim "friend function %2|" 315341825Sdim "function template %2 with %3 template parameter%s3|" 316341825Sdim "function template %2 with %ordinal3 template paramter being a " 317341825Sdim "%select{type|non-type|template}4 template parameter|" 318341825Sdim "function template %2 with %ordinal3 template parameter " 319341825Sdim "%select{with no name|named %5}4|" 320341825Sdim "function template %2 with %ordinal3 template parameter with " 321341825Sdim "%select{no |}4default argument|" 322341825Sdim "function template %2 with %ordinal3 template parameter with " 323341825Sdim "default argument %4|" 324341825Sdim "function template %2 with %ordinal3 template parameter with different type|" 325341825Sdim "function template %2 with %ordinal3 template parameter %select{not |}4" 326341825Sdim "being a template parameter pack|" 327321369Sdim "}1">; 328321369Sdim 329327952Sdimdef err_module_odr_violation_function : Error< 330327952Sdim "%q0 has different definitions in different modules; " 331327952Sdim "%select{definition in module '%2'|defined here}1 " 332327952Sdim "first difference is " 333327952Sdim "%select{" 334327952Sdim "return type is %4|" 335327952Sdim "%ordinal4 parameter with name %5|" 336327952Sdim "%ordinal4 parameter with type %5%select{| decayed from %7}6|" 337327952Sdim "%ordinal4 parameter with%select{out|}5 a default argument|" 338327952Sdim "%ordinal4 parameter with a default argument|" 339327952Sdim "function body" 340327952Sdim "}3">; 341327952Sdim 342327952Sdimdef note_module_odr_violation_function : Note<"but in '%0' found " 343327952Sdim "%select{" 344327952Sdim "different return type %2|" 345327952Sdim "%ordinal2 parameter with name %3|" 346327952Sdim "%ordinal2 parameter with type %3%select{| decayed from %5}4|" 347327952Sdim "%ordinal2 parameter with%select{out|}3 a default argument|" 348327952Sdim "%ordinal2 parameter with a different default argument|" 349327952Sdim "a different body" 350327952Sdim "}1">; 351327952Sdim 352341825Sdimdef err_module_odr_violation_enum : Error< 353341825Sdim "%q0 has different definitions in different modules; " 354341825Sdim "%select{definition in module '%2'|defined here}1 " 355341825Sdim "first difference is " 356341825Sdim "%select{" 357341825Sdim "enum that is %select{not scoped|scoped}4|" 358341825Sdim "enum scoped with keyword %select{struct|class}4|" 359341825Sdim "enum %select{without|with}4 specified type|" 360341825Sdim "enum with specified type %4|" 361341825Sdim "enum with %4 element%s4|" 362341825Sdim "%ordinal4 element has name %5|" 363341825Sdim "%ordinal4 element %5 %select{has|does not have}6 an initilizer|" 364341825Sdim "%ordinal4 element %5 has an initializer|" 365341825Sdim "}3">; 366341825Sdim 367341825Sdimdef note_module_odr_violation_enum : Note<"but in '%0' found " 368341825Sdim "%select{" 369341825Sdim "enum that is %select{not scoped|scoped}2|" 370341825Sdim "enum scoped with keyword %select{struct|class}2|" 371341825Sdim "enum %select{without|with}2 specified type|" 372341825Sdim "enum with specified type %2|" 373341825Sdim "enum with %2 element%s2|" 374341825Sdim "%ordinal2 element has name %3|" 375341825Sdim "%ordinal2 element %3 %select{has|does not have}4 an initializer|" 376341825Sdim "%ordinal2 element %3 has different initializer|" 377341825Sdim "}1">; 378341825Sdim 379321369Sdimdef err_module_odr_violation_mismatch_decl_unknown : Error< 380321369Sdim "%q0 %select{with definition in module '%2'|defined here}1 has different " 381321369Sdim "definitions in different modules; first difference is this " 382321369Sdim "%select{||||static assert|field|method|type alias|typedef|data member|" 383321369Sdim "friend declaration|unexpected decl}3">; 384321369Sdimdef note_module_odr_violation_mismatch_decl_unknown : Note< 385321369Sdim "but in '%0' found " 386321369Sdim "%select{||||different static assert|different field|different method|" 387321369Sdim "different type alias|different typedef|different data member|" 388321369Sdim "different friend declaration|another unexpected decl}1">; 389321369Sdim 390296417Sdimdef warn_duplicate_module_file_extension : Warning< 391296417Sdim "duplicate module file extension block name '%0'">, 392296417Sdim InGroup<ModuleFileExtension>; 393296417Sdim 394321369Sdimdef warn_module_system_bit_conflict : Warning< 395321369Sdim "module file '%0' was validated as a system module and is now being imported " 396321369Sdim "as a non-system module; any difference in diagnostic options will be ignored">, 397321369Sdim InGroup<ModuleConflict>; 398276479Sdim} // let CategoryName 399321369Sdim 400321369Sdimlet CategoryName = "AST Serialization Issue" in { 401321369Sdimdef warn_module_uses_date_time : Warning< 402321369Sdim "%select{precompiled header|module}0 uses __DATE__ or __TIME__">, 403321369Sdim InGroup<DiagGroup<"pch-date-time">>; 404321369Sdimdef err_module_no_size_mtime_for_header : Error< 405321369Sdim "cannot emit module %0: %select{size|mtime}1 must be explicitly specified " 406321369Sdim "for missing header file \"%2\"">; 407360784Sdimdef err_module_unable_to_hash_content : Error< 408360784Sdim "failed to hash content for '%0' because memory buffer cannot be retrieved">; 409321369Sdim} // let CategoryName 410276479Sdim} // let Component 411276479Sdim 412