OSDN Git Service

libcpp/:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 2 Sep 2009 17:35:30 +0000 (17:35 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 2 Sep 2009 17:35:30 +0000 (17:35 +0000)
* macro.c (stringify_arg): Escape CPP_WCHAR tokens.
gcc/testsuite/:
* gcc.dg/20090902-1.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@151343 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 4f8f0cd..67c54c3 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 f76fa18..1b020ac 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 e051fbc..f318059 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);