diff options
author | Ian Lance Taylor <iant@google.com> | 2012-01-14 00:22:14 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-01-14 00:22:14 +0000 |
commit | 12448f77a57be1954b4f15455b06de9012e88390 (patch) | |
tree | 65cee32b0b18592f5aa5a416fb63c7ceeca865bc /gcc/tree.h | |
parent | 738134ef335a67def3b324823e24d2932d1baf06 (diff) | |
download | gcc-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.h | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -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) |