[llvm-bugs] [Bug 26506] New: clang-cl -fmsc-version=1900 produces .obj files that don't link
via llvm-bugs
llvm-bugs at lists.llvm.org
Sat Feb 6 08:18:14 PST 2016
https://llvm.org/bugs/show_bug.cgi?id=26506
Bug ID: 26506
Summary: clang-cl -fmsc-version=1900 produces .obj files that
don't link
Product: clang
Version: unspecified
Hardware: PC
OS: Windows NT
Status: NEW
Severity: normal
Priority: P
Component: LLVM Codegen
Assignee: unassignedclangbugs at nondot.org
Reporter: nicolasweber at gmx.de
CC: llvm-bugs at lists.llvm.org
Classification: Unclassified
C:\src\chrome\src>type dll.cc
struct A;
struct __declspec(dllexport) Base {
virtual ~Base() {}
virtual void operator()(const A&) const = 0;
};
struct __declspec(dllexport) Sub : public Base {
void operator()(const A&) const override {};
};
C:\src\chrome\src>"third_party\llvm-build\Release+Asserts\bin\clang-cl.exe" /c
client.cc -fmsc-version=1900
C:\src\chrome\src>link /dll dll.obj
Microsoft (R) Incremental Linker Version 14.00.23506.0
Copyright (C) Microsoft Corporation. All rights reserved.
Creating library dll.lib and object dll.exp
C:\src\chrome\src>type client.cc
struct A;
struct __declspec(dllimport) Base {
virtual ~Base() {}
virtual void operator()(const A&) const = 0;
};
struct __declspec(dllimport) Sub : public Base {
void operator()(const A&) const override {};
};
void f(Base* f) {
static Sub s;
}
int main() {
}
C:\src\chrome\src>"third_party\llvm-build\Release+Asserts\bin\clang-cl.exe" /c
client.cc -fmsc-version=1900
C:\src\chrome\src>link client.obj dll.lib
Microsoft (R) Incremental Linker Version 14.00.23506.0
Copyright (C) Microsoft Corporation. All rights reserved.
client.obj : error LNK2001: unresolved external symbol "const Sub::`vftable'"
(??_7Sub@@6B@)
client.exe : fatal error LNK1120: 1 unresolved externals
Works fine if I use -fmsc-version=1800 for the second compilation, or if I use
cl.exe.
If I use lld-link.exe for linking, it errors out with the same error.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160206/a3c6497d/attachment.html>
More information about the llvm-bugs
mailing list