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

Fix truncation warnings in conjunction/disjunction #4846

Conversation

StephanTLavavej
Copy link
Member

@StephanTLavavej StephanTLavavej commented Jul 20, 2024

Fixes #4845.

I'm testing negation to be comprehensive; it was already correct:

STL/stl/inc/type_traits

Lines 54 to 55 in ecbc1ef

_EXPORT_STD template <class _Trait>
struct negation : bool_constant<!static_cast<bool>(_Trait::value)> {}; // The negated result of _Trait

libcxx's conjunction.compile.pass.cpp and disjunction.compile.pass.cpp now pass for Clang (i.e. we would have noticed this bug if we had analyzed the failures earlier). I've verified that they would pass for MSVC too, except for VSO-2170500 "C1XX's type trait optimization mishandles conjunction/disjunction with non-bool types", so mark them as FAIL for :0 (MSVC plain) and :1 (MSVC ASAN) in the "C1XX COMPILER BUGS" section.

@StephanTLavavej StephanTLavavej added the bug Something isn't working label Jul 20, 2024
@StephanTLavavej StephanTLavavej requested a review from a team as a code owner July 20, 2024 11:31
@StephanTLavavej
Copy link
Member Author

StephanTLavavej commented Jul 22, 2024

⚠️ Note to self:

When mirroring this PR, remove the warning suppression in src/qa/VC/FE/compiler/tests/cxx/comp/regress/vso/2170500.cpp that was added by @xiangfan-ms's MSVC-PR-566459.

@StephanTLavavej
Copy link
Member Author

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej merged commit 4122957 into microsoft:main Aug 8, 2024
39 checks passed
@StephanTLavavej StephanTLavavej deleted the non-bool-logical-operator-traits branch August 8, 2024 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

<type_traits>: Logical operator traits with non-bool_constant arguments emit truncation warnings
2 participants