[SUGGESTION] Don't accept implicit integers in [[assert: 1]] #645
realgdman
started this conversation in
Suggestions
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This is minor one.
When skimming through some snippets, I got impression that you can write
[[assert: 42]]
Which is actually not checking for value, (say, of short-syntax function), and just implicit converted to
bool
According to this note at ES.87, checking for pointers is good, but checking integers without comparison can be suspicious.
Probably assert accepting only bools or pointers can be implemented with the help of concepts like std::is_arithmetic_v and std::is_pointer_v instead of simply
bool
cppfront/include/cpp2util.h
Line 325 in f83ca9b
Beta Was this translation helpful? Give feedback.
All reactions