-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
regression : [protobuf] generated code fails to compile with MSVC after upgrade to 3.25.1 with C2370 error #39459
Comments
suggested workaround lead to an ICE for me, see this |
After some discussions I was informed that code that compiles in strict mode i.e /permissive- can fail to compile in lax mode i.e. /permissive. This means that using /permissive may not be a work around. |
I just realized the problem is not in the code generated by the protoc compiler but in the map_field.h file in the package. So a patch for this would be to change line 681 of map_field.h from Note this is exactly the change made by the patch protocolbuffers/protobuf@f78f9c5 in protobuf 2.6.0 |
- See microsoft/vcpkg#39459 for details. - The fix, protocolbuffers/protobuf@f78f9c5, is not in any 25.x release. - Also, add a rule for `rules_python` to prevent regressions on Linux and Mac. PiperOrigin-RevId: 670929662
I hit this. It breaks my proto file generation. |
This is as much an information message to save other people trying to understand this issue.
The following PR was just merged #35781
This upgrades protobuf to version 3.25.1
This causes a regression for MSVC
The code in the protobuf package can't be compiled with the MSVC compiler.
The compiler issue is known and is described here https://developercommunity.visualstudio.com/t/c2370-is-falsely-emitted-when-a-static-const-membe/898167
There are a number of issues on the protobuf/grpc github related to this
protocolbuffers/protobuf#14602
grpc/grpc#35297
The suggested work around seem to be to add /permissive to your build which is sad. Even sadder the bug is in code in the generated header file so /permissive has to be specified in any including code.
Note the problematic code is only generated if you use a map field in your protobuf definition i.e.
map<string,int>
The text was updated successfully, but these errors were encountered: