Fix warning

`warning: catching polymorphic type ???class std::bad_cast??? by value`
This commit is contained in:
Antony Polukhin
2018-10-03 20:33:30 +03:00
committed by GitHub
parent 2a0a2a59f5
commit 29997a9fe1

View File

@ -72,7 +72,7 @@ int main( int argc, char * argv[] )
bool caught_exception = false;
try { derived = polymorphic_cast<Derived*>( 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