-
- Downloads
Implement P1002R1, Try-catch blocks in constexpr functions PR c++/89513
Implement P1002R1, Try-catch blocks in constexpr functions PR c++/89513 * parser.c (cp_parser_ctor_initializer_opt_and_function_body): Diagnose constexpr ctor or function with function-try-block with pedwarn for c++17 and earlier. Formatting fix. (cp_parser_try_block): Use pedwarn instead of error and only for c++17 and earlier when try block appears in constexpr function. * constexpr.c (build_constexpr_constructor_member_initializers): Handle TRY_BLOCK here instead of erroring on it. * g++.dg/cpp2a/constexpr-try1.C: New test. * g++.dg/cpp2a/constexpr-try2.C: New test. * g++.dg/cpp2a/constexpr-try3.C: New test. * g++.dg/cpp2a/constexpr-try4.C: New test. * g++.dg/cpp2a/constexpr-try5.C: New test. * g++.dg/cpp0x/constexpr-ctor10.C: Don't expect error for C++2a. From-SVN: r269314
Showing
- gcc/cp/ChangeLog 12 additions, 0 deletionsgcc/cp/ChangeLog
- gcc/cp/constexpr.c 6 additions, 6 deletionsgcc/cp/constexpr.c
- gcc/cp/parser.c 22 additions, 5 deletionsgcc/cp/parser.c
- gcc/testsuite/ChangeLog 11 additions, 0 deletionsgcc/testsuite/ChangeLog
- gcc/testsuite/g++.dg/cpp0x/constexpr-ctor10.C 1 addition, 1 deletiongcc/testsuite/g++.dg/cpp0x/constexpr-ctor10.C
- gcc/testsuite/g++.dg/cpp2a/constexpr-try1.C 44 additions, 0 deletionsgcc/testsuite/g++.dg/cpp2a/constexpr-try1.C
- gcc/testsuite/g++.dg/cpp2a/constexpr-try2.C 45 additions, 0 deletionsgcc/testsuite/g++.dg/cpp2a/constexpr-try2.C
- gcc/testsuite/g++.dg/cpp2a/constexpr-try3.C 44 additions, 0 deletionsgcc/testsuite/g++.dg/cpp2a/constexpr-try3.C
- gcc/testsuite/g++.dg/cpp2a/constexpr-try4.C 61 additions, 0 deletionsgcc/testsuite/g++.dg/cpp2a/constexpr-try4.C
- gcc/testsuite/g++.dg/cpp2a/constexpr-try5.C 40 additions, 0 deletionsgcc/testsuite/g++.dg/cpp2a/constexpr-try5.C
Loading
Please register or sign in to comment