aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2015-11-17 13:16:29 -0500
committerJason Merrill <jason@gcc.gnu.org>2015-11-17 13:16:29 -0500
commit3212c3c8ff81e677cef51136e13966a4157648d1 (patch)
tree09c659d3d639f355703734bc9746117837499ec0 /gcc
parent7098adab6e6b5e10d6d008f3403f5d6abfc8f384 (diff)
downloadgcc-3212c3c8ff81e677cef51136e13966a4157648d1.zip
gcc-3212c3c8ff81e677cef51136e13966a4157648d1.tar.gz
gcc-3212c3c8ff81e677cef51136e13966a4157648d1.tar.bz2
re PR bootstrap/68361 (Bootstrap failure with --enable-checking=release)
PR bootstrap/68361 * cvt.c (cp_convert_and_check): Use warning_sentinel to suppress -Wparentheses. From-SVN: r230470
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/cvt.c2
-rw-r--r--gcc/testsuite/g++.dg/warn/Wparentheses-28.C14
3 files changed, 21 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 05b9252..e410300 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c
index 0231efc..ebca004 100644
--- a/gcc/cp/cvt.c
+++ b/gcc/cp/cvt.c
@@ -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
index 0000000..f6636cb
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wparentheses-28.C
@@ -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);
+}