* pt.c (tsubst_copy, tsubst_copy_and_build): Copy TREE_NO_WARNING
from input for MODOP_EXPR.
testsuite:
* g++.dg/Wparentheses-3.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@86241
138bc75d-0d04-0410-961f-
82ee72b054a4
+2004-08-19 Joseph S. Myers <jsm@polyomino.org.uk>
+
+ PR c++/17041
+ * pt.c (tsubst_copy, tsubst_copy_and_build): Copy TREE_NO_WARNING
+ from input for MODOP_EXPR.
+
2004-08-18 Mark Mitchell <mark@codesourcery.com>
* pt.c (dependent_template_p): Fix typo in commment.
2004-08-18 Mark Mitchell <mark@codesourcery.com>
* pt.c (dependent_template_p): Fix typo in commment.
(code, tsubst_copy (TREE_OPERAND (t, 0), args, complain, in_decl),
tsubst_copy (TREE_OPERAND (t, 1), args, complain, in_decl),
tsubst_copy (TREE_OPERAND (t, 2), args, complain, in_decl));
(code, tsubst_copy (TREE_OPERAND (t, 0), args, complain, in_decl),
tsubst_copy (TREE_OPERAND (t, 1), args, complain, in_decl),
tsubst_copy (TREE_OPERAND (t, 2), args, complain, in_decl));
+ TREE_NO_WARNING (r) = TREE_NO_WARNING (t);
return cxx_sizeof_or_alignof_expr (op1, TREE_CODE (t));
case MODOP_EXPR:
return cxx_sizeof_or_alignof_expr (op1, TREE_CODE (t));
case MODOP_EXPR:
- return build_x_modify_expr
- (RECUR (TREE_OPERAND (t, 0)),
- TREE_CODE (TREE_OPERAND (t, 1)),
- RECUR (TREE_OPERAND (t, 2)));
+ {
+ tree r = build_x_modify_expr
+ (RECUR (TREE_OPERAND (t, 0)),
+ TREE_CODE (TREE_OPERAND (t, 1)),
+ RECUR (TREE_OPERAND (t, 2)));
+ TREE_NO_WARNING (r) = TREE_NO_WARNING (t);
+ return r;
+ }
case ARROW_EXPR:
op1 = tsubst_non_call_postfix_expression (TREE_OPERAND (t, 0),
case ARROW_EXPR:
op1 = tsubst_non_call_postfix_expression (TREE_OPERAND (t, 0),
+2004-08-19 Joseph S. Myers <jsm@polyomino.org.uk>
+
+ PR c++/17041
+ * g++.dg/Wparentheses-3.C: New test.
+
2004-08-19 Dorit Naishlos <dorit@il.ibm.com>
* gcc.dg/vect/vect-1.c: Remove xfail from i?86-*-* x86_64-*-* due
2004-08-19 Dorit Naishlos <dorit@il.ibm.com>
* gcc.dg/vect/vect-1.c: Remove xfail from i?86-*-* x86_64-*-* due
--- /dev/null
+// Test that -Wparentheses does not give bogus warnings in the
+// presence of templates. Bug 17041.
+
+// { dg-do compile }
+// { dg-options "-Wparentheses" }
+
+template<int> struct A
+{
+ int i;
+ A() { if ((i = 0)) ; }
+};
+
+A<0> a;