* cvt.c (cp_convert_to_pointer): Always build a CONVERT_EXPR when
!dofold.
From-SVN: r257161
+2018-01-29 Jason Merrill <jason@redhat.com>
+
+ PR c++/68810 - wrong location for reinterpret_cast error.
+ * cvt.c (cp_convert_to_pointer): Always build a CONVERT_EXPR when
+ !dofold.
+
2018-01-29 Marek Polacek <polacek@redhat.com>
PR c++/83996
gcc_assert (GET_MODE_SIZE (SCALAR_INT_TYPE_MODE (TREE_TYPE (expr)))
== GET_MODE_SIZE (SCALAR_INT_TYPE_MODE (type)));
+ /* FIXME needed because convert_to_pointer_maybe_fold still folds
+ conversion of constants. */
+ if (!dofold)
+ return build1 (CONVERT_EXPR, type, expr);
+
return convert_to_pointer_maybe_fold (type, expr, dofold);
}
constexpr static Inner & getInner()
/* I am surprised this is considered a constexpr */
- { return *((Inner *)4); } // { dg-error "reinterpret_cast" }
+ {
+ return *((Inner *)4); // { dg-error "reinterpret_cast" }
+ }
};
B B::instance;