[LLVMbugs] [Bug 11789] New: STR2WSTR(__FUNCTION__) should work in microsoft mode

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jan 17 19:50:56 PST 2012


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

             Bug #: 11789
           Summary: STR2WSTR(__FUNCTION__) should work in microsoft mode
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Driver
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: nicolasweber at gmx.de
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


#include <stdio.h>

#define _FOO_STR2WSTR(s) L##s
#define FOO_STR2WSTR(s) _FOO_STR2WSTR(s)

int main() {
  //const wchar_t* kFoo = L__FUNCTION__;  // doesn't work in cl.exe
  const wchar_t* kWFoo = FOO_STR2WSTR(__FUNCTION__);  // works in cl
}


Both gcc and clang don't allow this, but cl.exe does. (gcc and clang support it
for e.g. __FILE__.)

This is used in msvc's c++ standard headers.

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