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: unassignedclangb...@nondot.org Reporter: nicolaswe...@gmx.de CC: llvm-bugs@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.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs