macro.c (stringify_arg): Escape CPP_WCHAR tokens.

libcpp/:
	* macro.c (stringify_arg): Escape CPP_WCHAR tokens.
gcc/testsuite/:
	* gcc.dg/20090902-1.c: New test.

From-SVN: r151343
This commit is contained in:
Ian Lance Taylor 2009-09-02 17:35:30 +00:00 committed by Ian Lance Taylor
parent dd3824a300
commit fd2ab214c5
4 changed files with 12 additions and 1 deletions

View 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.

View File

@ -0,0 +1,3 @@
/* { dg-do compile } */
#define STRING(x) #x
char buf[] = STRING(L'\x123');

View 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.

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