https://llvm.org/bugs/show_bug.cgi?id=23242
Bug ID: 23242
Summary: [ms] __declspec(selectany) not handled correctly for
extern "C" symbols
Product: clang
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: Frontend
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
This compiles and links with both cl and clang-cl:
__declspec(selectany) int ChromeEnableBits[1];
int main() { return ChromeEnableBits[0]; }
This compiles and links fine with cl:
extern "C" __declspec(selectany) int ChromeEnableBits[1];
int main() { return ChromeEnableBits[0]; }
With clang-cl:
D:\src\llvm-ninja-rel64>bin\clang-cl foo.cc
foo-ac216e.obj : error LNK2019: unresolved external symbol ChromeEnableBits
referenced in function main
foo.exe : fatal error LNK1120: 1 unresolved externals
clang-cl.exe: error: linker command failed with exit code 1120 (use -v to see
invocation)
Code like this is created by mc.exe, msvs's message compiler. So it's important
to match cl.exe here.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs