This is a narrowed down version of the original code. Circle build 195. Blind guess here is compile time evaluation is getting tripped by uint8_t somehow...?
// If not using edition_2023, compiles fine.
#feature on edition_2023
#include <array>
#include <iostream>
enum class Op {
MOV,
};
// If unsigned is used instead, compiles fine.
//using u8 = unsigned
using u8 = uint8_t;
constexpr std::array!<Op, 256> create_opcode_table() {
std::array!<Op, 256> arr{};
u8 start = 0b10001000;
for (u8 i = 0; i < 4; i++)
arr[start + i] = Op::MOV;
return arr;
}
constexpr auto opcode_table = create_opcode_table();
int main() {
std::cout << opcode_table.size() << "\n";
return 0;
}
This is a narrowed down version of the original code. Circle build 195. Blind guess here is compile time evaluation is getting tripped by uint8_t somehow...?