diff options
author | Ian Lance Taylor <iant@google.com> | 2009-06-16 14:24:40 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2009-06-16 14:24:40 +0000 |
commit | 7d882b8356b9ee3e6844bf4898a996289223fab2 (patch) | |
tree | 7a42ffff9a8ca843cf87a59b7858690a5f169948 /gcc/cp/cvt.c | |
parent | 2e4078422e64a42224ca69daa70604885698a942 (diff) | |
download | gcc-7d882b8356b9ee3e6844bf4898a996289223fab2.zip gcc-7d882b8356b9ee3e6844bf4898a996289223fab2.tar.gz gcc-7d882b8356b9ee3e6844bf4898a996289223fab2.tar.bz2 |
c-common.c (skip_evaluation): Don't define.
./: * c-common.c (skip_evaluation): Don't define.
(c_inhibit_evaluation_warnings): Define global variable.
(overflow_warning): Check c_inhibit_evaluation_warnings rather
than skip_evaluation.
(convert_and_check, warn_for_div_by_zero): Likewise.
* c-common.h (skip_evaluation): Don't declare.
(c_inhibit_evaluation_warnings): Declare.
* c-parser.c (c_parser_typeof_specifier): Set
c_inhibit_evaluation_warnings rather than skip_evaluation.
(c_parser_conditional_expression): Likewise.
(c_parser_binary_expression): Likewise.
(c_parser_sizeof_expression): Likewise.
(c_parser_alignof_expression): Likewise.
* c-typeck.c (build_indirect_ref): Check
c_inhibit_evaluation_warnings rather than skip_evaluation.
(build_conditional_expr, build_binary_op): Likewise.
cp/:
* parser.c (cp_unevaluated_operand): Define global variable.
(cp_parser_question_colon_clause): Increment
c_inhibit_evaluation_warnings when evaluating an expression which
will never be executed.
(cp_parser_decltype): Increment cp_unevaluated_operand and
c_inhibit_evaluation_warnings, not skip_evaluation.
(cp_parser_sizeof_operand): Likewise.
(cp_parser_enclosed_template_argument_list): Save
cp_unevaluated_operand and c_inhibit_evaluation_warnings, not
skip_evaluation.
* cp-tree.h (struct saved_scope): Remove skip_evaluation field.
Add unevaluated_operand and inhibit_evaluation_warnings fields.
(cp_unevaluated_operand): Declare.
* name-lookup.c (push_to_top_level): Save cp_unevaluated_operand
and c_inhibit_evaluation_warnings rather than skip_evaluation.
(pop_from_top_level): Restore cp_unevaluated_operand and
c_inhibit_evaluation_warnings rather than skip_evaluation.
* class.c (build_base_path): Check cp_unevaluated_operand rather
than skip_evaluation.
* typeck.c (build_class_member_access_expr): Likewise.
(cp_build_binary_op): Don't warn about bad shift counts if
c_inhibit_evaluation_warnings is non-zero.
* pt.c (coerce_template_parms): Save state of
cp_unevaluated_operand and c_inhibit_evaluation_warnings, not
skip_evaluation.
(tsubst_aggr_type): Likewise.
(tsubst_pack_expansion): Check cp_unevaluated_operand rather than
skip_evaluation.
(tsubst_copy): Likewise.
(tsubst): Set cp_unevaluated_operand and
c_inhibit_evaluation_warnings, not skip_evaluation.
(tsubst_copy_and_build): Likewise.
* call.c (convert_arg_to_ellipsis): Check cp_unevaluated_operand
rather than skip_evaluation.
* decl2.c (mark_used): Likewise.
* semantics.c (finish_non_static_data_member): Likewise.
* cvt.c (cp_convert_and_check): Check
c_inhibit_evaluation_warnings rather than skip_evaluation.
* mangle.c (write_type): Set cp_unevaluated_operand rather than
skip_evaluation.
testsuite/:
* g++.dg/warn/skip-1.C: New testcase.
From-SVN: r148535
Diffstat (limited to 'gcc/cp/cvt.c')
-rw-r--r-- | gcc/cp/cvt.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c index 596e81c..dfd0ea8 100644 --- a/gcc/cp/cvt.c +++ b/gcc/cp/cvt.c @@ -565,7 +565,9 @@ cp_convert_and_check (tree type, tree expr) result = cp_convert (type, expr); - if (!skip_evaluation && !TREE_OVERFLOW_P (expr) && result != error_mark_node) + if (c_inhibit_evaluation_warnings == 0 + && !TREE_OVERFLOW_P (expr) + && result != error_mark_node) warnings_for_convert_and_check (type, expr, result); return result; |