-
Notifications
You must be signed in to change notification settings - Fork 440
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
[BUILD] Introduce CXX 20 CI pipeline for MSVC/Windows #2450
Changes from 12 commits
e72d1cf
ced4145
54c61c6
1a3dd9c
f320936
cf2c445
853090b
0a3662d
8f3bd3e
7a6ead9
3c76965
5e7eee7
d029d19
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,7 +48,7 @@ TEST(VariantTest, Get) | |
EXPECT_EQ(nostd::get<int>(w), 12); | ||
EXPECT_EQ(*nostd::get_if<int>(&v), 12); | ||
EXPECT_EQ(nostd::get_if<float>(&v), nullptr); | ||
#if __EXCEPTIONS | ||
#if __EXCEPTIONS || (defined(OPENTELEMETRY_STL_VERSION) && (OPENTELEMETRY_STL_VERSION >= 2020)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. std::variant is introduced in C++17, not C++20. Please investigate (local CXX 17 MSVC build) if the logic should be Also, somehow the existing code passed in C++14, C++17, C++20 builds in CI with GCC. Not sure which platform and/or which compiler do set __EXCEPTIONS, please clarify if you know the context. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Found out that __EXCEPTIONS is set by GCC and Clang, except when building with -fno-exceptions. This is likely why a GCC build with exceptions passed this test. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for looking into it. Will try MSVC C++ 17 build. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Verified that |
||
EXPECT_THROW(nostd::get<float>(w), nostd::bad_variant_access); | ||
#else | ||
EXPECT_DEATH({ nostd::get<float>(w); }, ""); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect the existing code was incorrect, as std::string_view is introduced in C++17, not C++20.
Please investigate (local CXX 17 MSVC build) if the logic should be
OPENTELEMETRY_STL_VERSION >= 2017
instead.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verified that std::out_of_range exception was thrown out with MSVC/C++17. Thanks for the catch.