-2011-12-31 Fabien Chêne <fabien@gcc.gnu.org>
+2012-01-01 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/51379
+ * typeck.c (build_reinterpret_cast_1): Implement resolution of
+ DR 799.
+
+2012-01-01 Fabien Chêne <fabien@gcc.gnu.org>
* parser.c (cp_parser_using_declaration): Add a warning about
deprecated access declarations when no errors were encountered
else if (TYPE_PTR_P (type) && INTEGRAL_OR_ENUMERATION_TYPE_P (intype))
/* OK */
;
+ else if ((INTEGRAL_OR_ENUMERATION_TYPE_P (type)
+ || TYPE_PTR_P (type) || TYPE_PTR_TO_MEMBER_P (type))
+ && same_type_p (type, intype))
+ /* DR 799 */
+ return fold_if_not_in_template (build_nop (type, expr));
else if ((TYPE_PTRFN_P (type) && TYPE_PTRFN_P (intype))
|| (TYPE_PTRMEMFUNC_P (type) && TYPE_PTRMEMFUNC_P (intype)))
return fold_if_not_in_template (build_nop (type, expr));
2012-01-01 Paolo Carlini <paolo.carlini@oracle.com>
+ PR c++/51379
+ * g++.dg/conversion/reinterpret4.C: New.
+ * g++.dg/conversion/reinterpret1.C: Adjust.
+
+2012-01-01 Paolo Carlini <paolo.carlini@oracle.com>
+
* g++.dg/cpp0x/constexpr-delegating2.C: Add missing piece.
2012-01-01 Fabien Chêne <fabien@gcc.gnu.org>
struct Y { Y(int &); };
int v;
-Y y1(reinterpret_cast<int>(v)); // { dg-error "" }
+Y y1(reinterpret_cast<int>(v));
--- /dev/null
+// PR c++/51379
+
+unsigned long t1 = 1;
+unsigned long t2 = reinterpret_cast<unsigned long>(t1);