diff options
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 3 |
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); |