https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89513

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Fri Mar  1 14:20:03 2019
New Revision: 269314

URL: https://gcc.gnu.org/viewcvs?rev=269314&root=gcc&view=rev
Log:
        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.

Added:
    trunk/gcc/testsuite/g++.dg/cpp2a/constexpr-try1.C
    trunk/gcc/testsuite/g++.dg/cpp2a/constexpr-try2.C
    trunk/gcc/testsuite/g++.dg/cpp2a/constexpr-try3.C
    trunk/gcc/testsuite/g++.dg/cpp2a/constexpr-try4.C
    trunk/gcc/testsuite/g++.dg/cpp2a/constexpr-try5.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/constexpr.c
    trunk/gcc/cp/parser.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor10.C

Reply via email to