[SERVER-67069] Pass /Zc:lambda to MSVC Created: 07/Jun/22  Updated: 29/Oct/23  Resolved: 23/Jun/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.1.0-rc0

Type: Bug Priority: Major - P3
Reporter: Mathias Stearn Assignee: Alex Neben
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Dev Platform 2022-06-27
Participants:

 Description   

Until we are on C+20, we should pass /Zc:lambda to msvc. It is implied by /std:c+20 and higher, but must be passed explicitly before then. It will tell msvc to use a standards-conforming lambda parser rather than whatever it is they were doing before. This was recomended by the MSVC team in response to a bug I filed about hitting an ICE.

It is probably worth doing this on any branch with a new enough MSVC that we still backport to in order to minimize surprising compiler errors when backporting. On older version of MSVC 2019 it was spelled /experimental:newLambdaProcessor, but the documentation seems to imply that it is just a different spelling of the same flag.



 Comments   
Comment by Githook User [ 23/Jun/22 ]

Author:

{'name': 'Alexander Neben', 'email': 'alexander.neben@mongodb.com', 'username': 'IamXander'}

Message: SERVER-67069 added /Zc:lambda for windows in cxx17
Branch: davish/SERVER-63099
https://github.com/mongodb/mongo/commit/09d251fb165d7f5976ed707a3ed16d12f6da945f

Comment by Githook User [ 23/Jun/22 ]

Author:

{'name': 'Alexander Neben', 'email': 'alexander.neben@mongodb.com', 'username': 'IamXander'}

Message: SERVER-67069 added /Zc:lambda for windows in cxx17
Branch: master
https://github.com/mongodb/mongo/commit/09d251fb165d7f5976ed707a3ed16d12f6da945f

Generated at Thu Feb 08 06:07:12 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.