This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, PR C++/61038] - g++ -E is unusable with UDL strings
- From: Ed Smith-Rowland <3dw4rd at verizon dot net>
- To: Jason Merrill <jason at redhat dot com>, "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 05 Jun 2014 07:18:35 -0400
- Subject: Re: [PATCH, PR C++/61038] - g++ -E is unusable with UDL strings
- Authentication-results: sourceware.org; auth=none
- References: <5371859C dot 3050502 at verizon dot net> <Pine dot LNX dot 4 dot 64 dot 1405131726380 dot 23277 at digraph dot polyomino dot org dot uk> <5372BFEF dot 5040502 at verizon dot net> <537BBEB2 dot 9020007 at redhat dot com>
On 05/20/2014 04:44 PM, Jason Merrill wrote:
On 05/13/2014 08:59 PM, Ed Smith-Rowland wrote:
+ escape_it = escape_it || cpp_userdef_string_p (token->type)
+ || cpp_userdef_char_p (token->type);
Let's add the new cases to the previous statement instead of a new
one. OK with that change.
Jason
PR c++/61038
I was asked to combine the escape logic for regular chars and strings
with the escape logic for user-defined literals chars and strings.
I just forgot the first time.
After rebuilding and testing committed as obvious.
ed@bad-horse:~/gcc_literal$ svn diff -rPREV libcpp/ChangeLog
libcpp/macro.c
Index: libcpp/ChangeLog
===================================================================
--- libcpp/ChangeLog (revision 211266)
+++ libcpp/ChangeLog (working copy)
@@ -1,3 +1,9 @@
+2014-06-04 Edward Smith-Rowland <3dw4rd@verizon.net>
+
+ PR c++/61038
+ * macro.c (stringify_arg (cpp_reader *, macro_arg *)):
+ Combine user-defined escape logic with the other string and char logic.
+
2014-05-26 Richard Biener <rguenther@suse.de>
* configure.ac: Remove long long and __int64 type checks,
Index: libcpp/macro.c
===================================================================
--- libcpp/macro.c (revision 211265)
+++ libcpp/macro.c (working copy)
@@ -492,11 +492,10 @@
|| token->type == CPP_WSTRING || token->type == CPP_WCHAR
|| token->type == CPP_STRING32 || token->type == CPP_CHAR32
|| token->type == CPP_STRING16 || token->type == CPP_CHAR16
- || token->type == CPP_UTF8STRING);
+ || token->type == CPP_UTF8STRING
+ || cpp_userdef_string_p (token->type)
+ || cpp_userdef_char_p (token->type));
- escape_it = escape_it || cpp_userdef_string_p (token->type)
- || cpp_userdef_char_p (token->type);
-
/* Room for each char being written in octal, initial space and
final quote and NUL. */
len = cpp_token_len (token);