The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
28.69k
stars
11.87k
forks
source link
[Microsoft codegen] `__thiscall` function with non-trivially-destructible first arg crashes #90336
Open
MitalAshok opened 6 months ago
https://godbolt.org/z/ofozszdr7
Compiled with
clang++ --target=i686-win32
The first argument is supposed to be a pointer, but it is not here.
MSVC seems to compile it fine. I don't know if it silently rewrites
__thiscall
to__cdecl
or what. It does properly call the destructor too.In a similar situation where a function can't be
__thiscall
because it has variadic arguments https://godbolt.org/z/cKr9dWKb3:Clang has an error that
g
can't be__thiscall
. Maybe that's what needs to happen for non-pointer first args?