aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2010-08-06 15:34:49 -0400
committerJason Merrill <jason@gcc.gnu.org>2010-08-06 15:34:49 -0400
commit0c32fb95f0dc38547c4b3a50536a79cb2dc88f90 (patch)
tree97e9c21d33f38f28412423b57a2486fd422c93e5 /gcc/cp
parent00e9a94486dff064693e711d4161dcbdcf5bbe5b (diff)
downloadgcc-0c32fb95f0dc38547c4b3a50536a79cb2dc88f90.zip
gcc-0c32fb95f0dc38547c4b3a50536a79cb2dc88f90.tar.gz
gcc-0c32fb95f0dc38547c4b3a50536a79cb2dc88f90.tar.bz2
typeck.c (decay_conversion): Any expression with type nullptr_t decays to nullptr.
* typeck.c (decay_conversion): Any expression with type nullptr_t decays to nullptr. From-SVN: r162952
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/typeck.c3
2 files changed, 8 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index ac7d3e0..c9cb173 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2010-08-06 Jason Merrill <jason@redhat.com>
+
+ * typeck.c (decay_conversion): Any expression with type nullptr_t
+ decays to nullptr.
+
2010-07-30 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
PR c++/45112
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 484d299..177f4bb 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -1920,6 +1920,9 @@ decay_conversion (tree exp)
if (error_operand_p (exp))
return error_mark_node;
+ if (NULLPTR_TYPE_P (type))
+ return nullptr_node;
+
/* build_c_cast puts on a NOP_EXPR to make the result not an lvalue.
Leave such NOP_EXPRs, since RHS is being used in non-lvalue context. */
code = TREE_CODE (type);