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

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun May 22 03:25:01 PDT 2011


           Summary: failure of wide string literals defined inside a macro
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: jason at filsinger.me
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com

the following code produces an error:

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

The preprocessor appears to ignore the L inside the define as the literal
declaring the string as a wide string.   The code not using the macro passes
without error.

Here is the analyzer output:

"Use of undeclared identifier 'L'"

This fails on both using the analyzer that ships with XCode 4.0.1 as well as
svn trunk (test at revision 131851).

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