aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/cvt.c
diff options
context:
space:
mode:
authorBernd Edlinger <bernd.edlinger@hotmail.de>2016-09-19 22:10:11 +0000
committerBernd Edlinger <edlinger@gcc.gnu.org>2016-09-19 22:10:11 +0000
commit144a96e4c914710cacdb95d33f4e03dc9fed7655 (patch)
treee93888863720e72051a26271bdd350b2c7f07917 /gcc/cp/cvt.c
parent3385d437fe1e17b7ba4735b5b6869e2153bfb506 (diff)
downloadgcc-144a96e4c914710cacdb95d33f4e03dc9fed7655.zip
gcc-144a96e4c914710cacdb95d33f4e03dc9fed7655.tar.gz
gcc-144a96e4c914710cacdb95d33f4e03dc9fed7655.tar.bz2
re PR c++/77434 (warn about suspicious precedence of ternary operator (?:))
gcc: 2016-09-19 Bernd Edlinger <bernd.edlinger@hotmail.de> PR c++/77434 * doc/invoke.texi: Document -Wint-in-bool-context. c-family: 2016-09-19 Bernd Edlinger <bernd.edlinger@hotmail.de> PR c++/77434 * c.opt (Wcond-in-bool-context): New warning. * c-common.c (c_common_truthvalue_conversion): Warn on integer constants in boolean context. cp: 2016-09-19 Bernd Edlinger <bernd.edlinger@hotmail.de> PR c++/77434 * cvt.c (cp_convert_and_check): Suppress Wint-in-bool-context here. testsuite: 2016-09-19 Bernd Edlinger <bernd.edlinger@hotmail.de> PR c++/77434 * c-c++-common/Wint-in-bool-context.c: New test. From-SVN: r240251
Diffstat (limited to 'gcc/cp/cvt.c')
-rw-r--r--gcc/cp/cvt.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c
index 977c665..2f5f15a 100644
--- a/gcc/cp/cvt.c
+++ b/gcc/cp/cvt.c
@@ -645,6 +645,7 @@ cp_convert_and_check (tree type, tree expr, tsubst_flags_t complain)
{
/* Avoid bogus -Wparentheses warnings. */
warning_sentinel w (warn_parentheses);
+ warning_sentinel c (warn_int_in_bool_context);
folded_result = cp_convert (type, folded, tf_none);
}
folded_result = fold_simple (folded_result);