This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH 09/14] Strip location wrappers in null_ptr_cst_p
- From: David Malcolm <dmalcolm at redhat dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: Nathan Sidwell <nathan at acm dot org>, Jakub Jelinek <jakub at redhat dot com>, Richard Biener <richard dot guenther at gmail dot com>, gcc-patches List <gcc-patches at gcc dot gnu dot org>, David Malcolm <dmalcolm at redhat dot com>
- Date: Fri, 10 Nov 2017 16:45:24 -0500
- Subject: [PATCH 09/14] Strip location wrappers in null_ptr_cst_p
- Authentication-results: sourceware.org; auth=none
- References: <CADzB+2kfB26fTGXk2AVWuN1mv641OrcEBze+Lq-KexXHeS=Y9A@mail.gmail.com> <1510350329-48956-1-git-send-email-dmalcolm@redhat.com>
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