Fix wrong asserts.

This commit is contained in:
Vassil Vassilev 2020-08-17 10:21:34 +00:00 committed by jenkins
parent 16988119ae
commit 6a66cbd1df

View File

@ -108,11 +108,11 @@ namespace cling {
utils::DiagnosticsStore DS(
m_Importer->getFromContext().getDiagnostics(), false, false, true);
llvm::Expected<const Decl *> To = m_Importer->Import(declToImport);
assert(To.get() && "Import did not work!");
assert(!DS.empty() &&
DS[0].getID() == clang::diag::err_unsupported_ast_node &&
"Import may be supported");
const Decl* To = llvm::cantFail(m_Importer->Import(declToImport));
assert(To && "Import did not work!");
assert((DS.empty() ||
DS[0].getID() == clang::diag::err_unsupported_ast_node) &&
"Import not supported!");
#endif
return;
}