Compiler: gcc (Ubuntu 15.2.0-4ubuntu4) 15.2.0, C++ version set to 20.
Here is a minimal reproducible example of the issue:
#include <cstdint>
#include <iostream>
#include <fix8/conjure_enum.hpp>
template <FIX8::valid_enum T>
std::string enum_to_string(T value)
{
return std::string(FIX8::conjure_enum<T>::enum_to_string(value));
}
enum Repro : uint8_t {
kExpected = 0x01,
kInvalid = 0x80,
};
int main() {
const auto val = Repro::kExpected;
std::cout << "The name of " << +static_cast<uint8_t>(val)
<< " is " << enum_to_string(val) << std::endl;
return 0;
}
Expected output:
The name of 1 is kExpected
Got:
The name of 1 is kInvalid
If kInvalid is set to anything less (like 0x7F or 0x10), then the program above works as expected.
Compiler:
gcc (Ubuntu 15.2.0-4ubuntu4) 15.2.0, C++ version set to 20.Here is a minimal reproducible example of the issue:
Expected output:
Got:
If
kInvalidis set to anything less (like0x7For0x10), then the program above works as expected.