This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 09/14] 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 6875492..e4a7f19 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]