aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog8
-rw-r--r--gcc/cp/typeck.c5
2 files changed, 12 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 3d2c5de..b4a3df4 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,4 +1,10 @@
-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
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index b168963..d9166c9 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -6203,6 +6203,11 @@ build_reinterpret_cast_1 (tree type, tree expr, bool c_cast_p,
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));