llvm-project
llvm-project copied to clipboard
[Win] Assertion failed: D->getCachedLinkage() == LV.getLinkage()
| Bugzilla Link | 42364 |
| Version | unspecified |
| OS | Windows NT |
| Attachments | reproduces the bug |
| Reporter | LLVM Bugzilla Contributor |
| CC | @DougGregor,@zygoloid |
Extended Description
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
Looks like it's fixed: https://compiler-explorer.com/z/KzzvdcTfv. It also does not trigger assertions on Windows locally.