]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
macro.c (stringify_arg): Escape CPP_WCHAR tokens.
authorIan Lance Taylor <iant@google.com>
Wed, 2 Sep 2009 17:35:30 +0000 (17:35 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Wed, 2 Sep 2009 17:35:30 +0000 (17:35 +0000)
libcpp/:
* macro.c (stringify_arg): Escape CPP_WCHAR tokens.
gcc/testsuite/:
* gcc.dg/20090902-1.c: New test.

From-SVN: r151343

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/20090902-1.c [new file with mode: 0644]
libcpp/ChangeLog
libcpp/macro.c

index 4f8f0cd6bd9cc3c5ffcb39805df33049989183d8..67c54c3efb66443cf5522a4b29fb2ea0ce8dde4f 100644 (file)
@@ -1,3 +1,7 @@
+2009-09-02  Ian Lance Taylor  <iant@google.com>
+
+       * gcc.dg/20090902-1.c: New test.
+
 2009-09-02  Jakub Jelinek  <jakub@redhat.com>
 
        * gcc.dg/builtin-object-size-9.c: New test.
diff --git a/gcc/testsuite/gcc.dg/20090902-1.c b/gcc/testsuite/gcc.dg/20090902-1.c
new file mode 100644 (file)
index 0000000..6120ee9
--- /dev/null
@@ -0,0 +1,3 @@
+/* { dg-do compile } */
+#define STRING(x) #x
+char buf[] = STRING(L'\x123');
index f76fa181ddeaf063a8216cc10e95d042ca37d338..1b020ac0ab85387fd30be06af851b2540cde833e 100644 (file)
@@ -1,3 +1,7 @@
+2009-09-02  Ian Lance Taylor  <iant@google.com>
+
+       * macro.c (stringify_arg): Escape CPP_WCHAR tokens.
+
 2009-08-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        * configure.ac (AC_PREREQ): Bump to 2.64.
index e051fbc7757b7e1d36bd11ed00c029c8e1e3a987..f31805955c69bd5496a6685b017a991c6060c8f9 100644 (file)
@@ -377,7 +377,7 @@ stringify_arg (cpp_reader *pfile, macro_arg *arg)
        }
 
       escape_it = (token->type == CPP_STRING || token->type == CPP_CHAR
-                  || token->type == CPP_WSTRING || token->type == CPP_STRING
+                  || token->type == CPP_WSTRING || token->type == CPP_WCHAR
                   || token->type == CPP_STRING32 || token->type == CPP_CHAR32
                   || token->type == CPP_STRING16 || token->type == CPP_CHAR16);