Skip to content

Commit

Permalink
Fix warnings in exception.h
Browse files Browse the repository at this point in the history
  • Loading branch information
certik committed Aug 25, 2020
1 parent bd1b459 commit 0f29159
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/lfortran/exception.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,18 @@ class LFortranException : public std::exception
std::string m_msg;
lfortran_exceptions_t ec;
std::string m_stacktrace;
int m_stacktrace_depth;

public:
LFortranException(const std::string &msg, lfortran_exceptions_t error,
int stacktrace_dept)
: m_msg(msg), ec(error)
int stacktrace_depth)
: m_msg{msg}, ec{error}, m_stacktrace_depth{stacktrace_depth}
{
#if defined(HAVE_LFORTRAN_STACKTRACE)
if (ec != lfortran_exceptions_t::LFORTRAN_TOKENIZER_ERROR &&
ec != lfortran_exceptions_t::LFORTRAN_PARSER_ERROR &&
ec != lfortran_exceptions_t::LFORTRAN_SEMANTIC_ERROR) {
m_stacktrace = LFortran::get_stacktrace(stacktrace_dept);
m_stacktrace = LFortran::get_stacktrace(stacktrace_depth);
}
#endif
}
Expand Down

0 comments on commit 0f29159

Please sign in to comment.