diff --git a/test/optional_test_COMPILER_CONVERSION_BUGS1.cpp b/test/optional_test_COMPILER_CONVERSION_BUGS1.cpp new file mode 100644 index 0000000..63baf3f --- /dev/null +++ b/test/optional_test_COMPILER_CONVERSION_BUGS1.cpp @@ -0,0 +1,16 @@ +struct A +{ + A(int) {} + A(A &&) {} +}; + +struct B +{ + operator A() { return A(1); } + operator int() { return 0; } +}; + +int main() +{ + A t = B(); +} \ No newline at end of file diff --git a/test/optional_test_COMPILER_CONVERSION_BUGS2.cpp b/test/optional_test_COMPILER_CONVERSION_BUGS2.cpp new file mode 100644 index 0000000..9c6c699 --- /dev/null +++ b/test/optional_test_COMPILER_CONVERSION_BUGS2.cpp @@ -0,0 +1,14 @@ +struct A +{ + A(int) {} +}; + +struct B +{ + operator int() { return 0; } +}; + +int main() +{ + A t = B(); +} \ No newline at end of file