[BUG] is
type for std::optional
can return unexpected results
#1328
Labels
bug
Something isn't working
is
type for std::optional
can return unexpected results
#1328
Describe the bug
An expression testing if a
std::optional
is a type can return unexpected results, depending on whether theoptional
's type is convertible to the target type. (I'm assuming this behaviour is unintended.)To Reproduce
Run cppfront on the following and then compile with a C++ compiler:
The output is:
Repro on Godbolt.
I think this behaviour is due to this cast:
cppfront/include/cpp2util.h
Line 2042 in ddde3d8
CC @filipsajdak
The text was updated successfully, but these errors were encountered: