Assertion: catch | /r/HasProperty | const std
Facets:
Source sentences:
text: 1) Catch-clause that declares a named formal parameter try { /* */ } catch ( const std:: exception & e ) {
text: 2) Catch-clause that declares an unnamed parameter try { /* */ } catch ( const std:: exception & ) {
text: try { f ( ) ; } catch ( const std:: overflow_error & e ) { // this executes if f() throws std::overflow_error (same type rule) } catch ( const std:: runtime_error & e ) { // this executes if f() throws std::underflow_error (base class rule) } catch ( const std:: exception & e ) { // this executes if f() throws std::logic_error (base class rule) } catch ( ... ) { // this executes if f() throws std::string or int or any other unrelated type }
text: try { f ( ) ; } catch ( const std:: overflow_error & e ) { // this executes if f() throws std::overflow_error (same type rule) } catch ( const std:: runtime_error & e ) { // this executes if f() throws std::underflow_error (base class rule) } catch ( const std:: exception & e ) { // this executes if f() throws std::logic_error (base class rule) } catch ( ... ) { // this executes if f() throws std::string or int or any other unrelated type }
text: try { f ( ) ; } catch ( const std:: overflow_error & e ) { // this executes if f() throws std::overflow_error (same type rule) } catch ( const std:: runtime_error & e ) { // this executes if f() throws std::underflow_error (base class rule) } catch ( const std:: exception & e ) { // this executes if f() throws std::logic_error (base class rule) } catch ( ... ) { // this executes if f() throws std::string or int or any other unrelated type }
text: (); // information from length_error is lost // } } catch ( const std:: exception & e ) {
text: try { f ( ) ; } catch ( const std:: exception & e ) { // will be executed if f() throws std::runtime_error } catch ( const std:: runtime_error & e ) { // dead code! }