coin-or-Clp/coin-or-Clp-catch.patch
2020-02-21 12:42:47 -07:00

58 lines
2.9 KiB
Diff

diff -up Clp-releases-1.17.5/Clp/src/ClpModel.cpp.orig Clp-releases-1.17.5/Clp/src/ClpModel.cpp
--- Clp-releases-1.17.5/Clp/src/ClpModel.cpp.orig 2020-02-20 09:50:46.973499354 -0700
+++ Clp-releases-1.17.5/Clp/src/ClpModel.cpp 2020-02-20 09:54:26.138615175 -0700
@@ -2892,7 +2892,7 @@ int ClpModel::readMps(const char *fileNa
int status = 0;
try {
status = m.readMps(fileName, "");
- } catch (CoinError e) {
+ } catch (CoinError& e) {
e.print();
status = -1;
}
diff -up Clp-releases-1.17.5/Clp/src/ClpSolver.cpp.orig Clp-releases-1.17.5/Clp/src/ClpSolver.cpp
--- Clp-releases-1.17.5/Clp/src/ClpSolver.cpp.orig 2020-02-20 09:53:29.722615016 -0700
+++ Clp-releases-1.17.5/Clp/src/ClpSolver.cpp 2020-02-20 09:54:26.139615157 -0700
@@ -1294,7 +1294,7 @@ int ClpMain1(int argc, const char *argv[
}
}
#endif
- } catch (CoinError e) {
+ } catch (CoinError& e) {
e.print();
status = -1;
}
diff -up Clp-releases-1.17.5/Clp/src/OsiClp/OsiClpSolverInterface.cpp.orig Clp-releases-1.17.5/Clp/src/OsiClp/OsiClpSolverInterface.cpp
--- Clp-releases-1.17.5/Clp/src/OsiClp/OsiClpSolverInterface.cpp.orig 2020-02-03 06:32:17.000000000 -0700
+++ Clp-releases-1.17.5/Clp/src/OsiClp/OsiClpSolverInterface.cpp 2020-02-20 09:54:26.141615122 -0700
@@ -5790,7 +5790,7 @@ int OsiClpSolverInterface::readLp(const
*m.messagesPointer() = modelPtr_->coinMessages();
try {
m.readLp(filename, epsilon);
- } catch (CoinError e) {
+ } catch (CoinError& e) {
printf("ERROR: %s::%s, %s\n",
e.className().c_str(), e.methodName().c_str(), e.message().c_str());
return -1;
diff -up Clp-releases-1.17.5/Clp/test/OsiClpSolverInterfaceTest.cpp.orig Clp-releases-1.17.5/Clp/test/OsiClpSolverInterfaceTest.cpp
--- Clp-releases-1.17.5/Clp/test/OsiClpSolverInterfaceTest.cpp.orig 2020-02-03 06:32:17.000000000 -0700
+++ Clp-releases-1.17.5/Clp/test/OsiClpSolverInterfaceTest.cpp 2020-02-20 09:54:26.141615122 -0700
@@ -143,7 +143,7 @@ OsiClpSolverInterfaceUnitTest(const std:
solver.setObjCoeff(0,0.0);
OSIUNITTEST_ADD_OUTCOME("clp", "setObjCoeff on empty model", "should throw exception", OsiUnitTest::TestOutcome::ERROR, false);
}
- catch (CoinError e) {
+ catch (CoinError& e) {
if (OsiUnitTest::verbosity >= 1)
std::cout<<"Correct throw from setObjCoeff on empty model"<<std::endl;
}
@@ -158,7 +158,7 @@ OsiClpSolverInterfaceUnitTest(const std:
solver.setColSetBounds(index,index+2,value);
OSIUNITTEST_ADD_OUTCOME("clp", "setColSetBounds on cols not in model", "should throw exception", OsiUnitTest::TestOutcome::ERROR, false);
}
- catch (CoinError e) {
+ catch (CoinError& e) {
if (OsiUnitTest::verbosity >= 1)
std::cout<<"Correct throw from setObjCoeff on empty model"<<std::endl;
}