re PR bootstrap/68361 (Bootstrap failure with --enable-checking=release)
authorJason Merrill <jason@redhat.com>
Tue, 17 Nov 2015 18:16:29 +0000 (13:16 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 17 Nov 2015 18:16:29 +0000 (13:16 -0500)
PR bootstrap/68361

* cvt.c (cp_convert_and_check): Use warning_sentinel to suppress
-Wparentheses.

From-SVN: r230470

gcc/cp/ChangeLog
gcc/cp/cvt.c
gcc/testsuite/g++.dg/warn/Wparentheses-28.C [new file with mode: 0644]

index 05b9252..e410300 100644 (file)
@@ -1,3 +1,9 @@
+2015-11-17  Jason Merrill  <jason@redhat.com>
+
+       PR bootstrap/68361
+       * cvt.c (cp_convert_and_check): Use warning_sentinel to suppress
+       -Wparentheses.
+
 2015-11-16  Jason Merrill  <jason@redhat.com>
 
        * constexpr.c (cxx_eval_builtin_function_call): Use cp_fully_fold
index 0231efc..ebca004 100644 (file)
@@ -644,7 +644,7 @@ cp_convert_and_check (tree type, tree expr, tsubst_flags_t complain)
       else
        {
          /* Avoid bogus -Wparentheses warnings.  */
-         TREE_NO_WARNING (folded) = true;
+         warning_sentinel w (warn_parentheses);
          folded_result = cp_convert (type, folded, tf_none);
        }
       folded_result = fold_simple (folded_result);
diff --git a/gcc/testsuite/g++.dg/warn/Wparentheses-28.C b/gcc/testsuite/g++.dg/warn/Wparentheses-28.C
new file mode 100644 (file)
index 0000000..f6636cb
--- /dev/null
@@ -0,0 +1,14 @@
+// PR bootstrap/68361
+// { dg-options -Wparentheses }
+
+struct A
+{
+  int p: 2;
+};
+
+A a, b;
+
+int main()
+{
+  bool t = (a.p = b.p);
+}