Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix newer GCC compiler warnings. #6257

Merged
merged 1 commit into from
Aug 12, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/parser/parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ class Parser {
auto global = GlobalVar(global_name);
try {
global_names.Add(global_name, global);
} catch (DuplicateKeyError e) {
} catch (const DuplicateKeyError& e) {
this->diag_ctx->Emit(Diagnostic::Error(global_tok->span) << "a function with the name "
<< "`@" << global_name << "` "
<< "was previously defined");
Expand Down Expand Up @@ -703,7 +703,7 @@ class Parser {

try {
type_names.Add(type_id, type_global);
} catch (DuplicateKeyError e) {
} catch (const DuplicateKeyError& e) {
this->diag_ctx->Emit(Diagnostic::Error(type_tok->span) << "a type definition with the name "
<< "`" << type_id << "` "
<< "was previously defined");
Expand Down Expand Up @@ -747,7 +747,7 @@ class Parser {

try {
this->ctors.Add(ctor_name, ctor);
} catch (DuplicateKeyError e) {
} catch (const DuplicateKeyError& e) {
this->diag_ctx->EmitFatal(Diagnostic::Error(ctor_tok->span)
<< "a constructor with the name "
<< "`" << ctor_name << "` "
Expand Down Expand Up @@ -1341,7 +1341,7 @@ class Parser {
DLOG(INFO) << "op_name=" << op_name << " token=" << tok;
try {
return Op::Get(op_name);
} catch (dmlc::Error e) {
} catch (const dmlc::Error& e) {
this->diag_ctx->Emit(Diagnostic::Error(tok->span)
<< "operator `" << op_name
<< "` not found, perhaps you forgot to register it?");
Expand Down