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: r151347
This commit is contained in:
Ian Lance Taylor 2009-09-02 18:47:29 +00:00 committed by Ian Lance Taylor
parent f2f909e76f
commit a30d561cee
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-08-31 Jason Merrill <jason@redhat.com>
PR c++/41127

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-07-22 Release Manager
* GCC 4.4.1 released.

View File

@ -375,7 +375,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);