We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
e is func
Describe the bug With cppfront from git ecd3726 and g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0:
pred: (x: int) -> int = x < 20; main: () = { p2 := :(x) -> _ = x < 20; b := 5 is (p2); // true std::cout << b << "\n"; b = 5 is (pred); // false std::cout << b << "\n"; }
I expected both is expressions to produce true, but the second one is false.
is
true
false
A secondary problem is that rewriting pred to be a template fails to compile:
pred
pred: (x) -> _ = x < 20;
lessthan.cpp2:48:17: error: no matching function for call to ‘is(int, <unresolved overloaded function type>)’ ... snip candidates ...
The text was updated successfully, but these errors were encountered:
The reason seems to be
cppfront/include/cpp2util.h
Line 883 in ecd3726
int
bool{pred(5)}
Sorry, something went wrong.
Oops, thanks! So this definition works:
pred: (x: int) -> _ = x < 20;
The remaining problem is if I don't specify a type for x then it doesn't compile.
x
I am currently working on is improvements. I will push it soon.
OK, I have solved also the generic function case.
Successfully merging a pull request may close this issue.
Describe the bug
With cppfront from git ecd3726 and g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0:
I expected both
is
expressions to producetrue
, but the second one isfalse
.A secondary problem is that rewriting
pred
to be a template fails to compile:pred: (x) -> _ = x < 20;
The text was updated successfully, but these errors were encountered: