Closed
Description
Describe the bug
No type safety when comparing two variables
To Reproduce
Steps to reproduce the behavior:
- Sample code - distilled down to minimal essentials please
main: () -> int = {
number: int = 123;
string: std::string = "test";
std::cout << number > string;
}
- Command lines, including which C++ compiler you are using
cppfront -p main.cpp2 &&
g++ main.cpp -std=c++23 -I/root/cppfront/include/ -o main
- Expected result - what you expected to happen
Some kind of error message saying you can't compare incompatible types - Actual result/error
main.cpp:22:19: required from here
/root/cppfront/include/cpp2util.h:1808:28: error: no match for ‘operator>’ (operand types are ‘std::basic_ostream<char>’ and ‘std::__cxx11::basic_string<char>’)
1808 | return CPP2_FORWARD(t) > CPP2_FORWARD(u);
| ^
Additional context
I know it is a stupid problem, but I didn't pay attention and I have to admit that it took me some time to realize where was the problem.