CXX-3325 address -Wdeprecated-literal-operator warnings #1441
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves CXX-3325.
The
""_bsonuser-defined literal (UDL) was introduced in #724. At the time, it was declared as (ignoring export macros):#1066 attempted to reformat this declaration to address the
-Wdeprecated-literal-operatorwarning observed with newer Clang compilers (per Compiler Explorer, supported since Clang 17 and enabled by default since Clang 20):but this had to be reverted by #1194 to restore compatibility with GCC 4.8 (which does not implement CWG 1473, prior to which a space between
""and ud-suffix was unfortunately mandatory; see this comment):However, following #1415, GCC 4.8 is no longer within our range of supported (minimum required) compilers. Therefore, we can now (re-)apply the proper fix (removing the space) without further issue.
Important
Following #1415, users on Red Hat 7 or older are expected to use a "Red Hat Developer Toolset" (DTS) or "GCC Toolset" to obtain a sufficiently recent GCC compiler version (GCC 8.1 or newer).
Note
There does not seem to be a ClangFormat option to control this behavior...?