aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.h
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2012-01-14 00:22:14 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2012-01-14 00:22:14 +0000
commit12448f77a57be1954b4f15455b06de9012e88390 (patch)
tree65cee32b0b18592f5aa5a416fb63c7ceeca865bc /gcc/tree.h
parent738134ef335a67def3b324823e24d2932d1baf06 (diff)
downloadgcc-12448f77a57be1954b4f15455b06de9012e88390.zip
gcc-12448f77a57be1954b4f15455b06de9012e88390.tar.gz
gcc-12448f77a57be1954b4f15455b06de9012e88390.tar.bz2
re PR c++/50012 (C++ front end misses -Wsign-compare warnings when extraneous parentheses are present)
gcc/: PR c++/50012 * tree.h (TYPE_QUALS): Add cast to int. (TYPE_QUALS_NO_ADDR_SPACE): Likewise. gcc/cp: PR c++/50012 * typeck.c (enum_cast_to_int): New static function. (cp_build_binary_op): When handling warn_sign_compare, don't test for TREE_NO_WARNING. Do call enum_cast_to_int. * call.c (avoid_sign_compare_warnings): Remove static function. (build_new_op_1): Don't call avoid_sign_compare_warnings. gcc/testsuite/: PR c++/50012 * g++.dg/warn/Wsign-compare-4.C: New. From-SVN: r183178
Diffstat (limited to 'gcc/tree.h')
-rw-r--r--gcc/tree.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/gcc/tree.h b/gcc/tree.h
index 3f9fdbc..5719b8f 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -1,6 +1,6 @@
/* Front-end tree definitions for GNU compiler.
Copyright (C) 1989, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+ 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
Free Software Foundation, Inc.
This file is part of GCC.
@@ -2298,16 +2298,16 @@ enum cv_qualifier
/* The set of type qualifiers for this type. */
#define TYPE_QUALS(NODE) \
- ((TYPE_READONLY (NODE) * TYPE_QUAL_CONST) \
- | (TYPE_VOLATILE (NODE) * TYPE_QUAL_VOLATILE) \
- | (TYPE_RESTRICT (NODE) * TYPE_QUAL_RESTRICT) \
- | (ENCODE_QUAL_ADDR_SPACE (TYPE_ADDR_SPACE (NODE))))
+ ((int) ((TYPE_READONLY (NODE) * TYPE_QUAL_CONST) \
+ | (TYPE_VOLATILE (NODE) * TYPE_QUAL_VOLATILE) \
+ | (TYPE_RESTRICT (NODE) * TYPE_QUAL_RESTRICT) \
+ | (ENCODE_QUAL_ADDR_SPACE (TYPE_ADDR_SPACE (NODE)))))
/* The same as TYPE_QUALS without the address space qualifications. */
#define TYPE_QUALS_NO_ADDR_SPACE(NODE) \
- ((TYPE_READONLY (NODE) * TYPE_QUAL_CONST) \
- | (TYPE_VOLATILE (NODE) * TYPE_QUAL_VOLATILE) \
- | (TYPE_RESTRICT (NODE) * TYPE_QUAL_RESTRICT))
+ ((int) ((TYPE_READONLY (NODE) * TYPE_QUAL_CONST) \
+ | (TYPE_VOLATILE (NODE) * TYPE_QUAL_VOLATILE) \
+ | (TYPE_RESTRICT (NODE) * TYPE_QUAL_RESTRICT)))
/* These flags are available for each language front end to use internally. */
#define TYPE_LANG_FLAG_0(NODE) (TYPE_CHECK (NODE)->type_common.lang_flag_0)