diff options
| author | Paolo Carlini <paolo@gcc.gnu.org> | 2012-05-15 15:14:49 +0000 |
|---|---|---|
| committer | Paolo Carlini <paolo@gcc.gnu.org> | 2012-05-15 15:14:49 +0000 |
| commit | a1bde5afcfe2e42ca2250fbf5676bdf5f30d05f6 (patch) | |
| tree | 64ee7c2534fe46beab3731586d7d305cfcd1afc8 /gcc/c-family/c-common.c | |
| parent | 7d67c380fab04773732b6b0494cf8ab22cc2d126 (diff) | |
| download | gcc-a1bde5afcfe2e42ca2250fbf5676bdf5f30d05f6.zip gcc-a1bde5afcfe2e42ca2250fbf5676bdf5f30d05f6.tar.gz gcc-a1bde5afcfe2e42ca2250fbf5676bdf5f30d05f6.tar.bz2 | |
re PR c++/11856 (unsigned warning in template)
/cp
2012-05-15 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/11586
* pt.c (tsubst_copy_and_build): Increase / decrease
c_inhibit_evaluation_warnings around build_x_binary_op call.
/c-family
2012-05-15 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/11586
* c-common.c (shorten_compare): Check c_inhibit_evaluation_warnings.
/testsuite
2012-05-15 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/11586
* g++.dg/warn/Wtype-limits.C: Don't warn in templates.
* g++.dg/warn/Wtype-limits-Wextra.C: Likewise.
From-SVN: r187542
Diffstat (limited to 'gcc/c-family/c-common.c')
| -rw-r--r-- | gcc/c-family/c-common.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index f32a94a..f745365 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -3754,7 +3754,8 @@ shorten_compare (tree *op0_ptr, tree *op1_ptr, tree *restype_ptr, type = c_common_unsigned_type (type); } - if (TREE_CODE (primop0) != INTEGER_CST) + if (TREE_CODE (primop0) != INTEGER_CST + && c_inhibit_evaluation_warnings == 0) { if (val == truthvalue_false_node) warning_at (loc, OPT_Wtype_limits, @@ -3834,6 +3835,7 @@ shorten_compare (tree *op0_ptr, tree *op1_ptr, tree *restype_ptr, warning. */ bool warn = warn_type_limits && !in_system_header + && c_inhibit_evaluation_warnings == 0 && !(TREE_CODE (primop0) == INTEGER_CST && !TREE_OVERFLOW (convert (c_common_signed_type (type), primop0))) |
