Skip to content
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

constexpr redefinition errors when compiling Protocol Buffers generated code with Visual Studio 2022 and Protocol Buffers v29.3 #20100

Open
Matgo01 opened this issue Jan 24, 2025 · 0 comments
Labels
untriaged auto added to all issues by default when created.

Comments

@Matgo01
Copy link

Matgo01 commented Jan 24, 2025

I encountered multiple errors while compiling the code generated by Protocol Buffers v29.3 using Visual Studio 2022. The errors point to constexpr redefinition issues and other problems with functions being marked as constexpr. Below is the exact error message:

RiskUnitProtocol.pb.cc
1>C:\Users\mgorla\Documents\alicanto\QPosition_Risk\QPosition_Risk\RiskUnitProtocol.pb.cc(10553,15): error C2475: 'RiskUnitProtocol::Drivers::InternalNewImpl_': redefinition; different 'constexpr' specifiers
1> C:\Users\mgorla\Documents\alicanto\QPosition_Risk\QPosition_Risk\RiskUnitProtocol.pb.h(10937,25):
1> see declaration of 'RiskUnitProtocol::Drivers::InternalNewImpl_'
1>C:\Users\mgorla\Documents\alicanto\QPosition_Risk\QPosition_Risk\RiskUnitProtocol.pb.cc(10553,15): error C3615: constexpr function 'RiskUnitProtocol::Drivers::InternalNewImpl_' cannot return a constant expression
1> C:\Users\mgorla\Documents\alicanto\QPosition_Risk\QPosition_Risk\RiskUnitProtocol.pb.cc(10553,15):
1> failure was caused by reaching the end of a constexpr function
1>C:\Users\mgorla\Documents\alicanto\QPosition_Risk\QPosition_Risk\RiskUnitProtocol.pb.cc(16780,41): error C2475: 'RiskUnitProtocol::VistaturaSecondoLivello::InternalNewImpl_': redefinition; different 'constexpr' specifiers
1> C:\Users\mgorla\Documents\alicanto\QPosition_Risk\QPosition_Risk\RiskUnitProtocol.pb.h(512,15):
1> see declaration of 'RiskUnitProtocol::VistaturaSecondoLivello::InternalNewImpl_'
1>C:\Users\mgorla\Documents\alicanto\QPosition_Risk\QPosition_Risk\RiskUnitProtocol.pb.cc(19031,19): error C2475: 'RiskUnitProtocol::Simulazioni::InternalNewImpl_': redefinition; different 'constexpr' specifiers
1> C:\Users\mgorla\Documents\alicanto\QPosition_Risk\QPosition_Risk\RiskUnitProtocol.pb.h(7997,25):
1> see declaration of 'RiskUnitProtocol::Simulazioni::InternalNewImpl_'
1>C:\Users\mgorla\Documents\alicanto\QPosition_Risk\QPosition_Risk\RiskUnitProtocol.pb.cc(19031,19): error C3615: constexpr function 'RiskUnitProtocol::Simulazioni::InternalNewImpl_' cannot return a constant expression
1> C:\Users\mgorla\Documents\alicanto\QPosition_Risk\QPosition_Risk\RiskUnitProtocol.pb.cc(19031,19):
1> failure was caused by reaching the end of a constexpr function
Environment:

Protocol Buffers version: v29.2
Compiler: Visual Studio 2022
Operating System: Windows 1\

@Matgo01 Matgo01 added the untriaged auto added to all issues by default when created. label Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
untriaged auto added to all issues by default when created.
Projects
None yet
Development

No branches or pull requests

1 participant