From 23da99492f26652f97320397b9f6a91eb8780c3c Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Wed, 24 Jun 2015 10:27:02 +0200 Subject: Add unit-test for Visual2013 ambiguous call to operator= --- test/ref.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/ref.cpp') diff --git a/test/ref.cpp b/test/ref.cpp index 18a89f4e9..1341dfef7 100644 --- a/test/ref.cpp +++ b/test/ref.cpp @@ -221,6 +221,12 @@ int test_ref_overload_fun1(Ref ) { return 3; } int test_ref_overload_fun2(Ref ) { return 4; } int test_ref_overload_fun2(Ref ) { return 5; } +void test_ref_ambiguous(const Ref &A, Ref B) +{ + B = A; + B = A - A; +} + // See also bug 969 void test_ref_overloads() { @@ -233,6 +239,9 @@ void test_ref_overloads() VERIFY( test_ref_overload_fun2(Ad)==4 ); VERIFY( test_ref_overload_fun2(Ad+Bd)==4 ); VERIFY( test_ref_overload_fun2(Af+Bf)==5 ); + + ArrayXd A, B; + test_ref_ambiguous(A, B); } void test_ref() -- cgit v1.2.3