Skip to content

Conversation

@eramongodb
Copy link
Contributor

@eramongodb eramongodb commented Aug 20, 2025

Followup to #1412.

Addresses the following annoyingly-aggressive warning emitted by STL <bit> pre-C++20 despite using the __cpp_lib_endian feature test macro correctly (CE):

The contents of <bit> are available only with C++20 or later.

Conditioning on __cplusplus >= 202002L (C++20) is not enough due to /Zc:__cplusplus issues somehow resulting in an even worse outcome (CE):

error C3083: 'endian': the symbol to the left of a '::' must be a type
error C2039: 'native': is not a member of 'std'

Therefore, _MSVC_LANG >= 202002L is used instead, but only when defined(_MSVC_LANG) is also true, since this is an MSVC-specific issue which is not applicable to other compilers (CE).

@eramongodb eramongodb requested a review from kevinAlbs August 20, 2025 20:48
@eramongodb eramongodb self-assigned this Aug 20, 2025
@eramongodb eramongodb requested a review from a team as a code owner August 20, 2025 20:48
@eramongodb eramongodb merged commit 0acb422 into mongodb:master Aug 21, 2025
22 checks passed
@eramongodb eramongodb deleted the cxx-warnings-msvc branch August 21, 2025 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants