[LLVMbugs] [Bug 9984] failure of wide string literals defined inside a macro

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun May 22 08:27:43 PDT 2011


Douglas Gregor <dgregor at apple.com> changed:

           What    |Removed                     |Added
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID

--- Comment #1 from Douglas Gregor <dgregor at apple.com> 2011-05-22 10:27:42 CDT ---
Clang is behaving correctly here (as does GCC). You can't both stringize a
token and concatenate in one step. Instead, use:

  #define TESTL2(x) L##x 
  #define TESTL(x) TESTL2(#x)
  const wchar_t* a = L"Hello World";
  const wchar_t* b = TESTL(Hello World);

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list