2 // { dg-do compile { target c++11 } }
5 try { // { dg-error "function-try-block body of 'constexpr' function only available with" "" { target c++17_down } }
7 } catch (...) { // { dg-error "compound-statement in 'constexpr' function" "" { target c++11_only } }
9 } // { dg-error "body of 'constexpr' function" "" { target c++11_only } }
12 try { // { dg-error "function-try-block body of 'constexpr' function only available with" "" { target c++17_down } }
13 try { // { dg-error "'try' in 'constexpr' function only available with" "" { target c++17_down } }
14 return true; // { dg-error "compound-statement in 'constexpr' function" "" { target c++11_only } .-1 }
15 } catch (int) { // { dg-error "compound-statement in 'constexpr' function" "" { target c++11_only } }
18 } catch (...) { // { dg-error "compound-statement in 'constexpr' function" "" { target c++11_only } }
20 } // { dg-error "not a return-statement" "" { target c++11_only } }
24 try { return true; } catch (...) { return false; } // { dg-error "'try' in 'constexpr' function only available with" "" { target c++17_down } }
25 } // { dg-error "not a return-statement" "" { target c++11_only } }
26 // { dg-error "compound-statement in 'constexpr' function" "" { target c++11_only } .-2 }
29 constexpr S () try : m (1) // { dg-error "function-try-block body of 'constexpr' constructor only available with" "" { target c++17_down } }
31 try { // { dg-error "'try' in 'constexpr' function only available with" "" { target c++17_down } }
32 } catch (int) { // { dg-error "compound-statement in 'constexpr' function" "" { target c++11_only } }
33 } // { dg-error "compound-statement in 'constexpr' function" "" { target c++11_only } .-2 }
34 } catch (...) { // { dg-error "'constexpr' constructor does not have empty body" "" { target c++11_only } }
41 try { // { dg-error "function-try-block body of 'constexpr' constructor only available with" "" { target c++17_down } }
42 } catch (...) { // { dg-error "compound-statement in 'constexpr' function" "" { target c++11_only } }