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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187542
138bc75d-0d04-0410-961f-
82ee72b054a4
+2012-05-15 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/11586
+ * c-common.c (shorten_compare): Check c_inhibit_evaluation_warnings.
+
2012-05-14 Bernd Schmidt <bernds@codesourcery.com>
- * c-family/c-common.c (DEF_ATTR_STRING): Define and undefine as
- necessary.
+ * c-common.c (DEF_ATTR_STRING): Define and undefine as necessary.
2012-05-14 Manuel López-Ibáñez <manu@gcc.gnu.org>
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,
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)))
+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.
+
2012-05-12 Paolo Carlini <paolo.carlini@oracle.com>
* cp-tree.h (TYPE_PTRMEM_P): Rename to TYPE_PTRDATAMEM_P.
case MEMBER_REF:
case DOTSTAR_EXPR:
{
- tree r = build_x_binary_op
+ tree r;
+
+ ++c_inhibit_evaluation_warnings;
+
+ r = build_x_binary_op
(input_location, TREE_CODE (t),
RECUR (TREE_OPERAND (t, 0)),
(TREE_NO_WARNING (TREE_OPERAND (t, 0))
complain);
if (EXPR_P (r) && TREE_NO_WARNING (t))
TREE_NO_WARNING (r) = TREE_NO_WARNING (t);
+
+ --c_inhibit_evaluation_warnings;
+
return r;
}
+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.
+
2012-05-15 Olivier Hainque <hainque@adacore.com>
* g++.dg/eh/sighandle.C: New testcase.
template <typename Int, Int D>
void f(Int x) {
- assert(0 <= x and x <= D); // { dg-warning "comparison is always true due to limited range of data type" }
+ assert(0 <= x and x <= D);
}
int ff(void) {
template <typename Int, Int D>
void f(Int x) {
- assert(0 <= x and x <= D); // { dg-warning "comparison is always true due to limited range of data type" }
+ assert(0 <= x and x <= D);
}
int ff(void) {