2 // { dg-do compile { target c++11 } }
3 // { dg-options "-pedantic" }
6 try { // { dg-warning "function-try-block body of 'constexpr' function only available with" "" { target c++17_down } }
8 } catch (...) { // { dg-warning "compound-statement in 'constexpr' function" "" { target c++11_only } }
10 } // { dg-error "body of 'constexpr' function" "" { target c++11_only } }
13 try { // { dg-warning "function-try-block body of 'constexpr' function only available with" "" { target c++17_down } }
14 try { // { dg-warning "'try' in 'constexpr' function only available with" "" { target c++17_down } }
15 return true; // { dg-warning "compound-statement in 'constexpr' function" "" { target c++11_only } .-1 }
16 } catch (int) { // { dg-warning "compound-statement in 'constexpr' function" "" { target c++11_only } }
19 } catch (...) { // { dg-warning "compound-statement in 'constexpr' function" "" { target c++11_only } }
21 } // { dg-error "not a return-statement" "" { target c++11_only } }
25 try { return true; } catch (...) { return false; } // { dg-warning "'try' in 'constexpr' function only available with" "" { target c++17_down } }
26 } // { dg-error "not a return-statement" "" { target c++11_only } }
27 // { dg-warning "compound-statement in 'constexpr' function" "" { target c++11_only } .-2 }
30 constexpr S () try : m (1) // { dg-warning "function-try-block body of 'constexpr' constructor only available with" "" { target c++17_down } }
32 try { // { dg-warning "'try' in 'constexpr' function only available with" "" { target c++17_down } }
33 } catch (int) { // { dg-warning "compound-statement in 'constexpr' function" "" { target c++11_only } }
34 } // { dg-warning "compound-statement in 'constexpr' function" "" { target c++11_only } .-2 }
35 } catch (...) { // { dg-error "'constexpr' constructor does not have empty body" "" { target c++11_only } }
42 try { // { dg-warning "function-try-block body of 'constexpr' constructor only available with" "" { target c++17_down } }
43 } catch (...) { // { dg-warning "compound-statement in 'constexpr' function" "" { target c++11_only } }