From 785f12ef6a4768b4a009ec542cea4b31f3f21d9f Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Wed, 8 Nov 2017 10:38:48 -0500 Subject: [PATCH 14/46] Strip location wrappers in null_ptr_cst_p Without this, "NULL" fails to be usable in C++11 onwards. gcc/cp/ChangeLog: * call.c (null_ptr_cst_p): Strip location wrappers when converting from '0' to a pointer type in C++11 onwards. --- gcc/cp/call.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gcc/cp/call.c b/gcc/cp/call.c index e09cf97..b762b32 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -534,6 +534,8 @@ null_ptr_cst_p (tree t) if (cxx_dialect >= cxx11) { + STRIP_ANY_LOCATION_WRAPPER (t); + /* Core issue 903 says only literal 0 is a null pointer constant. */ if (TREE_CODE (type) == INTEGER_TYPE && !char_type_p (type) -- 1.8.5.3