aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/ref.cpp
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2015-06-24 10:27:02 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2015-06-24 10:27:02 +0200
commit23da99492f26652f97320397b9f6a91eb8780c3c (patch)
tree06ead595786c3d64aeee5cec30b8fc2274a38d6e /test/ref.cpp
parent6441befbb33644508525a471f12c37d44b9e0ce4 (diff)
Add unit-test for Visual2013 ambiguous call to operator=
Diffstat (limited to 'test/ref.cpp')
-rw-r--r--test/ref.cpp9
1 files changed, 9 insertions, 0 deletions
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<MatrixXf> ) { return 3; }
int test_ref_overload_fun2(Ref<const MatrixXd> ) { return 4; }
int test_ref_overload_fun2(Ref<const MatrixXf> ) { return 5; }
+void test_ref_ambiguous(const Ref<const ArrayXd> &A, Ref<ArrayXd> 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()