Test updates for LLVM18 by CaseyCarter · Pull Request #4452 · microsoft/STL (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation10 Commits6 Checks0 Files changed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
A few minimal test updates to respond to Clang changes in LLVM 18.1.0 rc4. No product code changes are needed.
By commit for ease of review:
- Add
-Wno-overriding-option
to Clang lines infloating_point_model_matrix
: LLVM-D158137 renamed theoverriding-t-option
warning tooverriding-option
. To support transitioning, let's try to disable both and tell the compiler to ignore unrecognized warning control options. - Fix clang
missing-field-initializer
warnings: Clang has started diagnosing uses of designated initializers that omit initializers for members without default initializers. This change adds default initializers to types we control and avoids using designated initializers for types we do not. This only affects a couple of tests. - Suppress clang warning in
GH_000935_complex_numerical_accuracy
: Clang warns that "use of NaN is undefined behavior due to the currently enabled floating-point options" in some floating-point contract modes. - Don't test
equal_to<void>
with different enumerations: Clang SFINAES away the return type in C++23. I've disabled this case for all compilers with the expectation that other compilers will eventually behave similarly.
…matrix`
LLVM-D158137 renamed the overriding-t-option
warning to overriding-option
. To support transitioning, let's try to disable both and tell the compiler to ignore unrecognized warning options.
Clang 18 has started diagnosing uses of designated initializers that omit initializers for members without default initializers. This change adds default initializers to types we control and avoids using designated initializers for types we do not. This only affects a couple of tests.
Clang warns that "use of NaN is undefined behavior due to the currently enabled floating-point options" in some floating-point contract modes.
Clang 18 SFINAES away the return type in C++23. I've made this compiler-agnostic with the expectation that other compilers will follow suit.
Comment on lines +247 to +251
#if !_HAS_CXX23 |
---|
// The return type of equal_to::operator()(T, U) SFINAEs |
// when T and U are different enumeration types. |
assert(equal_fn(begin(arr3), end(arr3), begin(arr4), end(arr4), equal_to<>{})); |
#endif // !_HAS_CXX23 |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Built-in comparison between different enumeration types is removed in C++26 via WG21-P2864R2.
It seems that Clang only applies the removal to C++26 mode (Godbolt link). Why is C++23 mode affected?
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibly because we're passing /std:c++latest
and it's being detected as C++26?
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, /std:c++latest
is probably mapped to -std=c++2c
by Clang 18+ so C++26 core features become available (Godbolt link). 😿 There seems an issue that we can't specify C++23 mode because /std:c++23
is not yet available.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really this ought to be // TRANSITION, _HAS_CXX26
but it's not worth resetting testing.
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.
Thanks for scouting ahead and fixing this stuff up! 🛠️ 🏞️ 😻
Labels
Related to test code