should catch polymorphic exceptions by reference. this silences warnings
like:
error: catching polymorphic type ‘class std::RetryException’ by value
[-Werror=catch-value=]
} catch (std::RetryException) {
Signed-off-by: Kefu Chai <kchai@redhat.com>
try {
val = boost::get<T>(cmdmap.find(k)->second);
return true;
- } catch (boost::bad_get) {
+ } catch (boost::bad_get&) {
handle_bad_get(cct, k, typeid(T).name());
}
}
auto p = config_defaults_bl.begin();
try {
decode(config_defaults, p);
- } catch (buffer::error e) {
+ } catch (buffer::error& e) {
}
}
return config_defaults;
out: \
complete_inject_failure(); \
return r; \
- } catch (RetryException) { \
+ } catch (RetryException&) { \
failed = true; \
} catch (...) { \
ceph_abort(); \