PR c++/88410
* cp-gimplify.c (cp_fold) <case ADDR_EXPR>: For offsetof-like folding,
call maybe_constant_value on val to see if it is INTEGER_CST.
* g++.dg/cpp0x/pr88410.C: New test.
From-SVN: r267220
+2018-12-17 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/88410
+ * cp-gimplify.c (cp_fold) <case ADDR_EXPR>: For offsetof-like folding,
+ call maybe_constant_value on val to see if it is INTEGER_CST.
+
2018-12-17 Jonathan Wakely <jwakely@redhat.com>
PR c++/52321
{
val = TREE_OPERAND (val, 0);
STRIP_NOPS (val);
+ val = maybe_constant_value (val);
if (TREE_CODE (val) == INTEGER_CST)
return fold_offsetof (op0, TREE_TYPE (x));
}
+2018-12-17 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/88410
+ * g++.dg/cpp0x/pr88410.C: New test.
+
2018-12-17 Steve Ellcey <sellcey@cavium.com>
* gcc.target/aarch64/torture/aarch64-torture.exp: New file.
--- /dev/null
+// PR c++/88410
+// { dg-do compile { target c++11 } }
+
+typedef __UINTPTR_TYPE__ uintptr_t;
+const uintptr_t a = 32;
+struct C { int b; int c; };
+uintptr_t d { uintptr_t (&reinterpret_cast<C *>(a)->c) - a };