From bda2001935e61d13c95371120561862a07b90a22 Mon Sep 17 00:00:00 2001 From: Andrzej Krzemienski Date: Fri, 5 Sep 2014 16:15:39 +0200 Subject: [PATCH] Testing MSVC bugs --- test/optional_test_COMPILER_CONVERSION_BUGS1.cpp | 16 ++++++++++++++++ test/optional_test_COMPILER_CONVERSION_BUGS2.cpp | 14 ++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 test/optional_test_COMPILER_CONVERSION_BUGS1.cpp create mode 100644 test/optional_test_COMPILER_CONVERSION_BUGS2.cpp 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