Add unit tests for bug #981: valid and invalid usage of ternary operator

This commit is contained in:
Gael Guennebaud
2015-09-09 11:38:25 +02:00
parent 84e0c27b61
commit 680d318352
4 changed files with 43 additions and 0 deletions

13
failtest/ternary_2.cpp Normal file
View File

@@ -0,0 +1,13 @@
#include "../Eigen/Core"
using namespace Eigen;
int main(int argc,char **)
{
VectorXf a(10), b(10);
#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
b = argc>1 ? 2*a : a+a;
#else
b = argc>1 ? VectorXf(2*a) : VectorXf(a+a);
#endif
}