On Wed, Dec 7, 2016 at 2:00 PM, Jakub Jelinek <ja...@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