[llvm-bugs] [Bug 42364] New: [Win] Assertion failed: D->getCachedLinkage() == LV.getLinkage()
via llvm-bugs
llvm-bugs at lists.llvm.org
Sun Jun 23 15:26:24 PDT 2019
https://bugs.llvm.org/show_bug.cgi?id=42364
Bug ID: 42364
Summary: [Win] Assertion failed: D->getCachedLinkage() ==
LV.getLinkage()
Product: clang
Version: unspecified
Hardware: PC
OS: Windows NT
Status: NEW
Severity: enhancement
Priority: P
Component: Modules
Assignee: unassignedclangbugs at nondot.org
Reporter: mikhail.strelnikov at gmail.com
CC: dgregor at apple.com, llvm-bugs at lists.llvm.org,
richard-llvm at metafoo.co.uk
Created attachment 22132
--> https://bugs.llvm.org/attachment.cgi?id=22132&action=edit
reproduces the bug
TL;DR Please see attached 'build.bat'
file: my.cppm
export module my;
template <class>
struct v {
~v(){} // works, if destructor is removed
};
export v<int> foo(){ throw 1; }
file: main.cpp
import my;
int main(){ foo(); }
file: commands.bat
set CC="C:\Program Files\LLVM\bin\clang++.exe"
%CC% -std=c++2a -fmodules-ts --precompile my.cppm -fprebuilt-module-path=.
-o my.pcm
%CC% -std=c++2a -fmodules-ts -c my.pcm -o my.o
%CC% -std=c++2a -fmodules-ts -fuse-ld=lld -fprebuilt-module-path=. my.o
main.cpp -o main.exe
On Linux it does not fail on assert. It emits quite confusing warning, then
refuses to link:
my.cppm:4:5: warning: inline function 'v<int>::~v' is not defined
[-Wundefined-inline]
~v(){}
^
main.cpp:2:13: note: used here
int main(){ foo(); }
^
1 warning generated.
ld.lld: error: undefined symbol: _ZW2myEN1vIiED1Ev
--
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/20190623/4c8f0035/attachment.html>
More information about the llvm-bugs
mailing list