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

catch by constant reference #1608

Closed
bgoodri opened this issue Jan 11, 2020 · 0 comments · Fixed by #1609
Closed

catch by constant reference #1608

bgoodri opened this issue Jan 11, 2020 · 0 comments · Fixed by #1609
Assignees
Milestone

Comments

@bgoodri
Copy link
Contributor

bgoodri commented Jan 11, 2020

Description

In

https://github.com/stan-dev/math/blob/develop/stan/math/prim/core/init_threadpool_tbb.hpp#L50

we catch (boost::bad_lexical_cast), which throws a warning with g++-8 and above saying

stan/math/prim/core/init_threadpool_tbb.hpp:52:21: warning: catching polymorphic type ‘class boost::bad_lexical_cast’ by value [-Wcatch-value=]

The internet thinks that exceptions should be caught by constant reference.

Example

Compile anything that includes this header file with g++-8

Expected Output

None

Current Version:

v3.0.0

@bgoodri bgoodri self-assigned this Jan 11, 2020
@bgoodri bgoodri added this to the 3.0.0++ milestone Jan 11, 2020
@bgoodri bgoodri mentioned this issue Jan 11, 2020
5 tasks
@serban-nicusor-toptal serban-nicusor-toptal modified the milestones: 3.0.0++, 3.1.0 Jan 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants