https://llvm.org/bugs/show_bug.cgi?id=27113

            Bug ID: 27113
           Summary: MSVC-compat __identifier implementation incomplete
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows XP
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangb...@nondot.org
          Reporter: turkey...@gmail.com
                CC: llvm-bugs@lists.llvm.org
    Classification: Unclassified

MSVC has a feature __identifier("symbolname") which doesn't seem to work in
Clang.

One common use of __identifier is for keywords; ie, __identifier(class), which
works, but it also supports string identifiers which I make fairly extensive
use of in large multi-language projects.
MSVC produces a warning with string identifiers, which you are instructed to
suppress.

This code should compile:
auto x = (__pragma(warning(suppress: 4483)) __identifier("??_7MyClass@@6B@"));

Since MSVC mangling uses characters that are invalid in C++ identifiers (ie,
'?' and '@'), this is a trick to refer to symbols that are un-name-able.

On a side note; in VS, the symbol resolution yields a typed symbol, and type
deduction is correctly performed for 'x' in this case.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to