From 1ebc7e681079e61300e75a5c0f3b2da335720cc7 Mon Sep 17 00:00:00 2001 From: Raksit Ashok Date: Wed, 9 Jul 2008 08:23:48 +0000 Subject: invoke.texi (Option Summary): Mention new option -Wdisallowed-function-list=... 2008-07-09 Raksit Ashok * doc/invoke.texi (Option Summary): Mention new option -Wdisallowed-function-list=... (Warning Options): Document -Wdisallowed-function-list=... * common.opt (Wdisallowed-function-list=): New flag. * flags.h (warn_disallowed_functions): External definition of new boolean warning flag. (warn_if_disallowed_function_p): Declare new function. * opts.c (warning_disallowed_functions): New static variable. (warn_disallowed_functions): New boolean warning flag. (warn_if_disallowed_function_p): New function. (add_comma_separated_to_vector): Rename add_instrument_functions_exclude_list to this. (common_handle_option): Handle new option. Rename calls to add_instrument_functions_exclude_list into calls to add_comma_separated_to_vector. * c-parser.c (c_parser_postfix_expression_after_primary): New warning based on flag warn_disallowed_functions. gcc/cp/ChangeLog 2008-07-09 Raksit Ashok * parser.c (cp_parser_postfix_expression): New warning based on flag warn_disallowed_functions. gcc/testsuite/ChangeLog 2008-07-09 Raksit Ashok * gcc.dg/wdisallowed-functions-1.c: New test. * gcc.dg/wdisallowed-functions-2.c: New test. * g++.dg/warn/Wdisallowed-functions-1.C: New test. * g++.dg/warn/Wdisallowed-functions-2.C: New test. From-SVN: r137655 --- gcc/cp/parser.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gcc/cp/parser.c') diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 2323c67..767d14d 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -4725,6 +4725,9 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p, koenig_p, tf_warning_or_error); + if (warn_disallowed_functions) + warn_if_disallowed_function_p (postfix_expression); + /* The POSTFIX_EXPRESSION is certainly no longer an id. */ idk = CP_ID_KIND_NONE; } -- cgit v1.1