#include #include "tclap/CmdLine.h" using namespace TCLAP; using namespace std; int main() { try { CmdLine cmd("test constraint bug"); ValueArg arg("i","int", "tests int arg", false, 4711, NULL, cmd); cout << "Expected exception" << endl; } catch(std::logic_error &e) { /* expected */ } try { CmdLine cmd("test constraint bug"); ValueArg arg1("i","int", "tests int arg", false, 4711, NULL, NULL); cout << "Expected exception" << endl; } catch(std::logic_error &e) { /* expected */ } try { CmdLine cmd("test constraint bug"); MultiArg arg1("i","int", "tests int arg", false, NULL, NULL); cout << "Expected exception" << endl; } catch(std::logic_error &e) { /* expected */ } try { CmdLine cmd("test constraint bug"); MultiArg arg1("i","int", "tests int arg", false, NULL, cmd); cout << "Expected exception" << endl; } catch(std::logic_error &e) { /* expected */ } cout << "Passed" << endl; }