Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade module-test to msvc 16.11.5 and 17.0-pre5 #2558

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions test/module-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@ bool oops_detail_namespace_is_visible;
namespace fmt {
bool namespace_detail_invisible() {
#if defined(FMT_HIDE_MODULE_BUGS) && defined(_MSC_FULL_VER) && \
_MSC_FULL_VER <= 192930129
// bug in msvc up to 16.11-pre1:
((_MSC_VER == 1929 && _MSC_FULL_VER <= 192930136) || \
(_MSC_VER == 1930 && _MSC_FULL_VER <= 193030704))
Comment on lines +79 to +80
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why check both _MSC_VER and _MSC_FULL_VER? Also wouldn't it be enough to replace all four checks with _MSC_FULL_VER <= 193030704?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's simple: _MSC_VER == 1929 is VS2019, while 1930 is VS2020. All of them are ABI-compatible, therefore they share the 19 - it's basically ABI 19.
So the check is for 'up to VS2019 Update 11 Fix 5' (a.k.a. msvc 16.11.5) in the VS2019 series and 'up to VS2022 Preview 5' (a.k.a. msvc 17.0-pre5) in the VS2022 series. The gap between the both is for an upcoming (final?) compiler version in the VS2019 series that is supposed to wrap-up VS2019 with some feature/fix backports from VS2022. This one might eventally fix this the non-exported namespace issue.

@cdacamar Cameron: or is this completely out of the picture? In this case we could totally forget about VS2019 from here on.

// bug in msvc up to 16.11.5 / 17.0-pre5:

// the namespace is visible even when it is neither
// implicitly nor explicitly exported
return true;
Expand All @@ -97,8 +99,8 @@ TEST(module_test, detail_namespace) {
// macros must not be imported from a *named* module [cpp.import]/5.1
TEST(module_test, macros) {
#if defined(FMT_HIDE_MODULE_BUGS) && defined(_MSC_FULL_VER) && \
_MSC_FULL_VER <= 192930129
// bug in msvc up to 16.11-pre1:
_MSC_FULL_VER <= 192930130
// bug in msvc up to 16.11-pre2:
// include-guard macros leak from BMI
// and even worse: they cannot be #undef-ined
macro_leaked = false;
Expand Down Expand Up @@ -456,8 +458,7 @@ TEST(module_test, time_duration) {
}

TEST(module_test, weekday) {
EXPECT_EQ("Monday",
std::format(std::locale::classic(), "{:%A}", fmt::weekday(1)));
EXPECT_EQ("Mon", fmt::format(std::locale::classic(), "{}", fmt::weekday(1)));
}

TEST(module_test, to_string_view) {
Expand Down