This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH 11/14] Handle location wrappers in string_conv_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:26 -0500
- Subject: [PATCH 11/14] Handle location wrappers in string_conv_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>
gcc/cp/ChangeLog:
* typeck.c (string_conv_p): Strip any location wrapper from "exp".
---
gcc/cp/typeck.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index dd3e19d..523e4d3 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -2149,6 +2149,8 @@ string_conv_p (const_tree totype, const_tree exp, int warn)
&& !same_type_p (t, wchar_type_node))
return 0;
+ STRIP_ANY_LOCATION_WRAPPER (exp);
+
if (TREE_CODE (exp) == STRING_CST)
{
/* Make sure that we don't try to convert between char and wide chars. */
--
1.8.5.3