constexpr redefinition errors when compiling Protocol Buffers generated code with Visual Studio 2022 and Protocol Buffers v29.3 #20100
Labels
untriaged
auto added to all issues by default when created.
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\
The text was updated successfully, but these errors were encountered: