Add C++23 to CppStdRevision enum (#21043)

This commit is contained in:
Iain Buclaw 2025-03-21 01:29:14 +01:00 committed by GitHub
parent 8db14cf846
commit 94950cae58
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 15 additions and 1 deletions

View file

@ -0,0 +1,4 @@
The compiler now accepts `-extern-std=c++23`
The compiler now accepts c++23 as a supported standard for `-extern-std=`.
Currently this only changes the value of `__traits(getTargetInfo, "cppStd")`.

View file

@ -359,6 +359,8 @@ dmd -cov -unittest myprog.d
Sets `__traits(getTargetInfo, \"cppStd\")` to `201703`)
$(LI $(I c++20): Use C++20 name mangling,
Sets `__traits(getTargetInfo, \"cppStd\")` to `202002`)
$(LI $(I c++23): Use C++23 name mangling,
Sets `__traits(getTargetInfo, \"cppStd\")` to `202302`)
)",
),
Option("extern-std=[h|help|?]",
@ -1122,6 +1124,7 @@ struct CLIUsage
=c++14 Sets `__traits(getTargetInfo, \"cppStd\")` to `201402`
=c++17 Sets `__traits(getTargetInfo, \"cppStd\")` to `201703`
=c++20 Sets `__traits(getTargetInfo, \"cppStd\")` to `202002`
=c++23 Sets `__traits(getTargetInfo, \"cppStd\")` to `202302`
";
/// Options supported by -HC

View file

@ -6234,6 +6234,7 @@ enum class CppStdRevision : uint32_t
cpp14 = 201402u,
cpp17 = 201703u,
cpp20 = 202002u,
cpp23 = 202302u,
};
enum class CHECKENABLE : uint8_t

View file

@ -62,6 +62,7 @@ enum CppStdRevision : uint
cpp14 = 2014_02,
cpp17 = 2017_03,
cpp20 = 2020_02,
cpp23 = 2023_02,
}
/// Trivalent boolean to represent the state of a `revert`able change

View file

@ -73,7 +73,8 @@ enum CppStdRevision
CppStdRevisionCpp11 = 201103,
CppStdRevisionCpp14 = 201402,
CppStdRevisionCpp17 = 201703,
CppStdRevisionCpp20 = 202002
CppStdRevisionCpp20 = 202002,
CppStdRevisionCpp23 = 202302,
};
/// Trivalent boolean to represent the state of a `revert`able change

View file

@ -1143,6 +1143,9 @@ bool parseCommandLine(const ref Strings arguments, const size_t argc, ref Param
case "c++20":
params.cplusplus = CppStdRevision.cpp20;
break;
case "c++23":
params.cplusplus = CppStdRevision.cpp23;
break;
default:
error("switch `%s` is invalid", p);
params.help.externStd = true;

View file

@ -35,6 +35,7 @@ enum CppStdRevision : uint
cpp14 = 201402,
cpp17 = 201703,
cpp20 = 202002,
cpp23 = 202302,
}
/**