This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ PATCH] P0003R5 - removal of dynamic exception specification from C++17
- From: Jason Merrill <jason at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Jonathan Wakely <jwakely at redhat dot com>, gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 8 Dec 2016 00:22:46 -0500
- Subject: Re: [C++ PATCH] P0003R5 - removal of dynamic exception specification from C++17
- Authentication-results: sourceware.org; auth=none
- References: <20161207190007.GS3541@tucnak.redhat.com>
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