Hi, I got this error while compiling smtsim.
here is my part of code which gives the error (Actual file is 445 lines and contains a header file). I am getting error___ error: expected ‘)’ before ‘return’ ___ at both of these "if (noexcept)" i.e line 10 and line 26. Can anyone help me out?
case KVPathComp::Name:
{
const string& name = comp.get_name();
if (!name.empty()) {
KVTreeVal *child = walk->get_child(name);
if (child) {
if (!(next = dynamic_cast<KVTree *>(child))) {
if (all_trees || !is_final_comp) {
// All components but the last must be trees
if (noexcept)
return 0;
KVPath child_path = KVParsedPath::full_path(walk);
child_path.down(comp);
throw KVParsedPath::BadPath(child_path,
"not a tree");
}
result = child;
}
} elseif (create_missing_trees &&
(!is_final_comp || all_trees)) {
KVTree *new_tree = new KVTree();
walk->set_child(name, new_tree, false);
next = new_tree;
} else {
next = 0;
if (noexcept)
return 0;
KVPath child_path = KVParsedPath::full_path(walk);
child_path.down(comp);
throw KVParsedPath::BadPath(child_path, "not found");
}
}
break;
}
Actually, I did not do this code. I was just compiling it for my work, this code was supposed to be correct, since many got the output. It was done by SMTSIM people.
Well, you'll have to ask them to fix it, then. At the very least, tell them your compiler rejects the code and they should tell you what to do to at least get the compiler to behave.
I tweaked a bit and changed noexcept to no_except (may be it is a variable). And that removed the error but have to see whether the program works fine. I was thinking to ask them, after this. Thanks helios.