From: Jason Merrill Date: Fri, 6 Aug 2010 19:34:49 +0000 (-0400) Subject: typeck.c (decay_conversion): Any expression with type nullptr_t decays to nullptr. X-Git-Tag: releases/gcc-4.6.0~5199 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0c32fb95f0dc38547c4b3a50536a79cb2dc88f90;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index ac7d3e01fdcf..c9cb17357267 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2010-08-06 Jason Merrill + + * typeck.c (decay_conversion): Any expression with type nullptr_t + decays to nullptr. + 2010-07-30 Ulrich Weigand PR c++/45112 diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 484d299f4626..177f4bb6a902 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);