From 29997a9fe10c06a7253c586640a2357e8feaf8dd Mon Sep 17 00:00:00 2001 From: Antony Polukhin Date: Wed, 3 Oct 2018 20:33:30 +0300 Subject: [PATCH] Fix warning `warning: catching polymorphic type ???class std::bad_cast??? by value` --- test/cast_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/cast_test.cpp b/test/cast_test.cpp index c0af253..8747397 100644 --- a/test/cast_test.cpp +++ b/test/cast_test.cpp @@ -72,7 +72,7 @@ int main( int argc, char * argv[] ) bool caught_exception = false; try { derived = polymorphic_cast( base ); } - catch (std::bad_cast) + catch (const std::bad_cast&) { cout<<"caught bad_cast\n"; caught_exception = true; } BOOST_TEST( caught_exception ); // the following is just so generated code can be inspected