This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C++ PATCH] P0003R5 - removal of dynamic exception specification from C++17


On Wed, Dec 7, 2016 at 2:00 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> I think throw() is still so commonly used that emitting deprecation warning
> for it is undesirable (in any mode).

Agreed.

> +  location_t loc = token->location;
>
>    /* Consume the `throw'.  */
>    cp_lexer_consume_token (parser->lexer);
> @@ -23821,7 +23816,23 @@ cp_parser_exception_specification_opt (c
>        type_id_list = cp_parser_type_id_list (parser);
>        /* Restore the saved message.  */
>        parser->type_definition_forbidden_message = saved_message;
> +
> +      if (cxx_dialect >= cxx1z)
> +       {
> +         error_at (loc, "ISO C++1z does not allow dynamic exception "
> +                        "specifications");
> +         type_id_list = NULL_TREE;
> +       }
> +      else if (cxx_dialect >= cxx11 && !in_system_header_at (input_location))
> +       warning_at (loc, OPT_Wdeprecated,
> +                   "dynamic exception specifications are deprecated in C++11;"
> +                   " use %<noexcept%> instead");

Let's use in_system_header_at (loc).  OK with that change.

Jason


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]