diff options
Diffstat (limited to 'gcc/cp/pt.c')
| -rw-r--r-- | gcc/cp/pt.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index dd88b98..8ee4be9 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -8353,7 +8353,14 @@ tsubst_copy_and_build (tree t, (RECUR (TREE_OPERAND (t, 0)), TREE_CODE (TREE_OPERAND (t, 1)), RECUR (TREE_OPERAND (t, 2))); - TREE_NO_WARNING (r) = TREE_NO_WARNING (t); + /* TREE_NO_WARNING must be set if either the expression was + parenthesized or it uses an operator such as >>= rather + than plain assignment. In the former case, it was already + set and must be copied. In the latter case, + build_x_modify_expr sets it and it must not be reset + here. */ + if (TREE_NO_WARNING (t)) + TREE_NO_WARNING (r) = TREE_NO_WARNING (t); return r; } |
