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

GCC10: warning: catching polymorphic type 'struct dmlc::Error' by value #7319

Closed
ggardet opened this issue Jan 21, 2021 · 1 comment · Fixed by #7336
Closed

GCC10: warning: catching polymorphic type 'struct dmlc::Error' by value #7319

ggardet opened this issue Jan 21, 2021 · 1 comment · Fixed by #7336

Comments

@ggardet
Copy link
Contributor

ggardet commented Jan 21, 2021

With GCC10, there is the following warning:

[ 1395s] /home/abuild/rpmbuild/BUILD/incubator-tvm-0.7.0/tests/cpp/ir_functor_test.cc: In member function 'virtual void IRF_ExprTransform_Test::TestBody()':
[ 1395s] /home/abuild/rpmbuild/BUILD/incubator-tvm-0.7.0/tests/cpp/ir_functor_test.cc:75:18: warning: catching polymorphic type 'struct dmlc::Error' by value [-Wcatch-value=]
[ 1395s]    75 |   } catch (dmlc::Error) {
[ 1395s]       |                  ^~~~~

Something like } catch (dmlc::Error&) { should fix it.

@tqchen
Copy link
Member

tqchen commented Jan 21, 2021

thanks @ggardet can you send a new PR ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants