[SERVER-62324] Failure to build mongo::unique_function uses with MSVS 2022 in C++20 mode Created: 30/Dec/21 Updated: 29/Oct/23 Resolved: 05/Jan/22 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 5.3.0 |
| Type: | Bug | Priority: | Critical - P2 |
| Reporter: | Andrew Morrow (Inactive) | Assignee: | Billy Donahue |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||
| Operating System: | ALL | ||||||||||||
| Sprint: | Service Arch 2022-10-17 | ||||||||||||
| Participants: | |||||||||||||
| Description |
|
While working on One instance happens in exit.hpp, where it appears unable to decide which sort of unique_function is to be created from a lambda, despite the fact that the lambda is clearly a good type match for one and not the other option:
Another example is in mongo/util/out_of_line_executor.h, where it appears that what looks like a perfectly good match isn't seen as available:
A fix will be required for these issues in order to stand up a C++20 enabled canary builder with MSVS 2022, which is a critical path step towards moving to the v4 toolchains and on to C++20 enablement. Note that this code works with GCC 8.3/11, clang 7/12, and Xcode 10/13 in both C++17 and C++20 mode, as well as with VS 2019 in C++17 mode and VS 2022 in C++17 mode, so it is entirely possible that this is a C++20 mode VS 2022 specific issue. Some workaround would still be required though. |
| Comments |
| Comment by Githook User [ 05/Jan/22 ] | |||||
|
Author: {'name': 'Andrew Morrow', 'email': 'acm@mongodb.com', 'username': 'acmorrow'}Message: | |||||
| Comment by Andrew Morrow (Inactive) [ 04/Jan/22 ] | |||||
|
lauren.lewis - As soon as possible please. MSVS is the last platform for which we don't have a C++20 builder up to lock in C++20 compatibility, which is a crucial step before we can migrate. | |||||
| Comment by Lauren Lewis (Inactive) [ 04/Jan/22 ] | |||||
|
hi acm, is this something we need to address in the next few days, or something we could address in the upcoming sprint? | |||||
| Comment by Billy Donahue [ 31/Dec/21 ] | |||||
|
We could try explicitly telling the compiler which unique_function overload we want.
https://github.com/10gen/mongo/compare/billydonahue/SERVER-62324 It may be the case that due to a MSVC bug, a void() is considered invocable with extra arguments, and those arguments are ignored? |