diff --git a/src/sequence_diagram/visitor/translation_unit_visitor.cc b/src/sequence_diagram/visitor/translation_unit_visitor.cc index a277888d..0a8e0ff1 100644 --- a/src/sequence_diagram/visitor/translation_unit_visitor.cc +++ b/src/sequence_diagram/visitor/translation_unit_visitor.cc @@ -467,9 +467,19 @@ bool translation_unit_visitor::VisitCallExpr(clang::CallExpr *expr) .substr(); m.message_name = message_name.substr(0, message_name.size() - 2); } - m.return_type = - function_call_expr->getCallReturnType(current_ast_context) - .getAsString(); + + const auto &return_type = + function_call_expr->getCallReturnType(current_ast_context); + + // + // Without this if, this crashes test case t20003 on LLVM <= 12 + // + if (!clang::dyn_cast_or_null( + function_call_expr->getCallee())) { + m.return_type = return_type.getAsString(); + } + else + m.return_type = ""; } else { return true;