aboutsummaryrefslogtreecommitdiffhomepage
path: root/failtest/swap_2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'failtest/swap_2.cpp')
-rw-r--r--failtest/swap_2.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/failtest/swap_2.cpp b/failtest/swap_2.cpp
new file mode 100644
index 000000000..c130ba6e4
--- /dev/null
+++ b/failtest/swap_2.cpp
@@ -0,0 +1,14 @@
+#include "../Eigen/Core"
+
+using namespace Eigen;
+
+int main()
+{
+ VectorXf a(10), b(10);
+ VectorXf const &ac(a);
+#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
+ b.swap(ac);
+#else
+ b.swap(ac.const_cast_derived());
+#endif
+} \ No newline at end of file