[LLVMbugs] [Bug 10706] New: Stringizing Operator (#) inserts space after macro expansion

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Aug 19 05:20:41 PDT 2011


http://llvm.org/bugs/show_bug.cgi?id=10706

           Summary: Stringizing Operator (#) inserts space after macro
                    expansion
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: eremeev at viva64.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


The Stringizing Operator (#) inserts space after macro expansion, sometimes
making the resulting code uncompileable. For example:

#define TRACE_ID(iD) L#iD;
const wchar_t *str = TRACE_ID(test);

It expands to:
const wchar_t *str = L "test";;
And then it fails to compile with error "use of undeclared identifier 'L'",
while we expected it to expand into the following line, which in turn can be
successfully compiled:
const wchar_t *str = L"test";;

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