Commit 27bec7bf by Jason Merrill Committed by Jason Merrill

Core 903 (partial)

	Core 903 (partial)
	* call.c (null_ptr_cst_p): Only 0 qualifies in C++11.

From-SVN: r177996
parent 9b8662c2
2011-08-23 Jason Merrill <jason@redhat.com>
Core 903 (partial)
* call.c (null_ptr_cst_p): Only 0 qualifies in C++11.
2011-08-23 Jason Merrill <jason@redhat.com>
Core 975
* decl.c (cxx_init_decl_processing): Initialize
dependent_lambda_return_type_node.
......
......@@ -541,20 +541,14 @@ null_ptr_cst_p (tree t)
return true;
if (CP_INTEGRAL_TYPE_P (TREE_TYPE (t)))
{
if (cxx_dialect >= cxx0x)
{
t = fold_non_dependent_expr (t);
t = maybe_constant_value (t);
if (TREE_CONSTANT (t) && integer_zerop (t))
return true;
}
else
/* Core issue 903 says only literal 0 is a null pointer constant. */
if (cxx_dialect < cxx0x)
{
t = integral_constant_value (t);
STRIP_NOPS (t);
if (integer_zerop (t) && !TREE_OVERFLOW (t))
return true;
}
if (integer_zerop (t) && !TREE_OVERFLOW (t))
return true;
}
return false;
}
......
2011-08-23 Jason Merrill <jason@redhat.com>
Core 903
* g++.dg/cpp0x/constexpr-nullptr.C: Now ill-formed.
2011-08-23 Jason Merrill <jason@redhat.com>
Core 975
* g++.dg/cpp0x/lambda/lambda-deduce-ext-neg2.C: Now accepted.
* g++.dg/cpp0x/lambda/lambda-deduce-ext-neg.C: Adjust.
......
......@@ -2,5 +2,5 @@
constexpr int zero() { return 0; }
void* ptr1 = zero(); // #1
constexpr void* ptr2 = zero(); // #2
void* ptr1 = zero(); // { dg-error "int" }
constexpr void* ptr2 = zero(); // { dg-error "int" }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment