Commit 81fa6d73 by Jakub Jelinek

c++: Readd [LR]ROTATE_EXPR support to constexpr.c [PR94067]

Since r10-6527-gaaa26bf4 fold_for_warn
will perform maybe_constant_value even on some cp_fold produced trees and
so can include rotate exprs which were removed last fall from constexpr.c

2020-03-09  Jakub Jelinek  <jakub@redhat.com>

	PR c++/94067
	Revert
	2019-10-11  Paolo Carlini  <paolo.carlini@oracle.com>

	* constexpr.c (cxx_eval_constant_expression): Do not handle
	RROTATE_EXPR and LROTATE_EXPR.

	* g++.dg/warn/Wconversion-pr94067.C: New test.
parent 5dc1390b
2020-03-09 Jakub Jelinek <jakub@redhat.com>
PR c++/94067
Revert
2019-10-11 Paolo Carlini <paolo.carlini@oracle.com>
* constexpr.c (cxx_eval_constant_expression): Do not handle
RROTATE_EXPR and LROTATE_EXPR.
2020-03-09 Marek Polacek <polacek@redhat.com>
PR c++/94050 - ABI issue with alignas on armv7hl.
......
......@@ -5730,6 +5730,8 @@ cxx_eval_constant_expression (const constexpr_ctx *ctx, tree t,
case MAX_EXPR:
case LSHIFT_EXPR:
case RSHIFT_EXPR:
case LROTATE_EXPR:
case RROTATE_EXPR:
case BIT_IOR_EXPR:
case BIT_XOR_EXPR:
case BIT_AND_EXPR:
......@@ -7853,6 +7855,8 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict, bool now,
case MAX_EXPR:
case LSHIFT_EXPR:
case RSHIFT_EXPR:
case LROTATE_EXPR:
case RROTATE_EXPR:
case BIT_IOR_EXPR:
case BIT_XOR_EXPR:
case BIT_AND_EXPR:
......
2020-03-09 Jakub Jelinek <jakub@redhat.com>
PR c++/94067
* g++.dg/warn/Wconversion-pr94067.C: New test.
2020-03-09 Marek Polacek <polacek@redhat.com>
PR c++/94050 - ABI issue with alignas on armv7hl.
......
// PR c++/94067
// { dg-do compile }
// { dg-options "-Wconversion" }
static inline unsigned short
swap (unsigned short x)
{
return (x >> 8) | static_cast<unsigned short>(x << 8);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment