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

catching polymorphic type ‘class std::runtime_error’ by value #36

Closed
zingdle opened this issue Dec 11, 2019 · 1 comment
Closed

Comments

@zingdle
Copy link

zingdle commented Dec 11, 2019

When compiling with g++ 8.3, catching polymorphic type ‘class std::runtime_error’ by value occurred on L503, jitify.hpp

$ cd jitify && make
g++ -o stringify stringify.cpp -O3 -Wall
./stringify example_headers/my_header1.cuh > example_headers/my_header1.cuh.jit
g++ -o jitify_example jitify_example.cpp -O3 -Wall -g -fmessage-length=80 -pthread -std=c++11 -D LINUX -I/usr/local/cuda/include -rdynamic -Wl,-b,binary,example_headers/my_header2.cuh,-b,default -ldl -L/usr/local/cuda/lib64 -lcuda -lcudart -lnvrtc
In file included from jitify_example.cpp:40:
jitify.hpp: In function ‘bool 
   jitify::detail::load_source(std::__cxx11::string, 
   std::map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> 
   >&, std::__cxx11::string, std::vector<std::__cxx11::basic_string<char> >, 
   jitify::file_callback_type, std::map<std::__cxx11::basic_string<char>, 
   std::__cxx11::basic_string<char> >*)’:
jitify.hpp:503:21: warning: catching polymorphic 
   type ‘class std::runtime_error’ by value [
   -Wcatch-value=]
       } catch (std::runtime_error) {
                     ^~~~~~~~~~~~~

Compiling cudf, which using jitify, requires -Werror and changing catch (std::runtime_error) to catch (std::runtime_error&) solved the problem.

@trevorsm7
Copy link
Contributor

@zingdle this should be closed by #37

@zingdle zingdle closed this as completed Dec 17, 2019
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

No branches or pull requests

2 participants