Cannot handle assignment to u8 and i16 from literal values
Describe the bug If a variable is declared as u8 and a character literal is assigned to it, or a variable is declared as i16 and an integer literal is assigned to it, the generated code cannot be compiled by clang++ (g++ compiles but with warnings). I suspect this also applies to the respective signed/unsigned counterparts. To Reproduce Steps to reproduce the behavior: Sample code - distilled down to minimal essentials please test.cpp2 main: () -> int = { foo: u8; foo = 'a'; bar: i16; bar = 3; } Command lines including which C++ compiler you are using cppfront test.cpp2 -p clang++ -std=c++20…
- Demand 25% × 0.00 = 00 reactions, 1 comments (not counted alone)
- Technical fit 30% × 0.73 = 22cppfront is in Language & Toolchain (a focus area); issue needs cpp20, which you listed; project tags you follow: cpp20
- Maintainer engagement 25% × 0.20 = 5comments not checked; labelled (triaged)
- Feasibility 20% × 0.50 = 10clear scope; has reproduction steps; has code; project onboarding 25%
- #1446 [BUG] Cannot handle assignment to u8 and i16 from literal valuesissue
Describe the bug If a variable is declared as u8 and a character literal is assigned to it, or a variable is declared as i16 and an integer literal is assigned to it, the generated code cannot be compiled by clang++ (g++ compiles but with warnings). I suspect this also applies…
Reproduce the bug on the latest main branch of cppfront, reduce it to a minimal example, and post your findings on the issue before opening a PR.
