* cp-gimplify.c (cp_fully_fold): First call maybe_constant_value.
From-SVN: r238559
+2016-07-21 Jason Merrill <jason@redhat.com>
+
+ PR c++/71121
+ * cp-gimplify.c (cp_fully_fold): First call maybe_constant_value.
+
2016-07-21 Andrew Sutton <andrew.n.sutton@gmail.com>
Jason Merrill <jason@redhat.com>
tree
cp_fully_fold (tree x)
{
+ if (processing_template_decl)
+ return x;
+ /* FIXME cp_fold ought to be a superset of maybe_constant_value so we don't
+ have to call both. */
+ x = maybe_constant_value (x);
return cp_fold (x);
}
--- /dev/null
+// PR c++/71121
+// { dg-do compile { target c++14 } }
+// { dg-options -Waddress }
+
+struct CC { void mbr(); };
+
+constexpr auto getFunc() {
+ return &CC::mbr;
+}
+
+constexpr bool xxx(void (CC::*_a)())
+{
+ constexpr auto f = getFunc();
+ return (f == _a);
+}
+++ /dev/null
-// PR c/62096 - unexpected warning overflow in implicit constant conversion
-// { dg-do compile { target c++11 } }
-
-enum E {
- E_val = 1,
-};
-
-inline constexpr E operator~(E e)
-{
- return E(~static_cast<int>(e));
-}
-
-int main()
-{
- int val = ~E_val; // { dg-bogus "overflow in implicit constant conversion" }
- (void) val;
-}