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]

Re: [PATCH, PR C++/61038] - g++ -E is unusable with UDL strings


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);


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