-
Notifications
You must be signed in to change notification settings - Fork 11.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Microsoft codegen] __thiscall
function with non-trivially-destructible first arg crashes
#90336
Comments
@llvm/issue-subscribers-clang-codegen Author: Mital Ashok (MitalAshok)
https://godbolt.org/z/ofozszdr7
Compiled with struct A { ~A(); };
void __thiscall f(A) {}
# Crash reproducer for clang version 19.0.0git (https://github.com/llvm/llvm-project.git c229f767e48c7190b7568e6ebd1688bb08795744)
# Driver args: "--driver-mode=g++" "--target=i686-win32" "this_call_non_trivial.cpp"
# Original command: "/cmake-build-debug/bin/clang-18" "-cc1" "-triple" "i686-unknown-windows-msvc19.33.0" "-emit-obj" "-mincremental-linker-compatible" "-dumpdir" "a-" "-disable-free" "-clear-ast-before-backend" "-main-file-name" "this_call_non_trivial.cpp" "-mrelocation-model" "static" "-mframe-pointer=all" "-fmath-errno" "-ffp-contract=on" "-fno-rounding-math" "-mconstructor-aliases" "-target-cpu" "pentium4" "-tune-cpu" "generic" "-fdebug-compilation-dir=/llvm/llvm-project" "-fcoverage-compilation-dir=/llvm/llvm-project" "-resource-dir" "/cmake-build-debug/lib/clang/19" "-internal-isystem" "/cmake-build-debug/lib/clang/19/include" "-fdeprecated-macro" "-ferror-limit" "19" "-fno-use-cxa-atexit" "-fms-extensions" "-fms-compatibility" "-fms-compatibility-version=19.33" "-std=c++14" "-fskip-odr-check-in-gmf" "-fdelayed-template-parsing" "-fcxx-exceptions" "-fexceptions" "-fcolor-diagnostics" "-faddrsig" "-o" "/tmp/-1f0735.o" "-x" "c++" "this_call_non_trivial.cpp"
"/cmake-build-debug/bin/clang-18" "-cc1" "-triple" "i686-unknown-windows-msvc19.33.0" "-emit-obj" "-mincremental-linker-compatible" "-dumpdir" "a-" "-disable-free" "-clear-ast-before-backend" "-main-file-name" "this_call_non_trivial.cpp" "-mrelocation-model" "static" "-mframe-pointer=all" "-fmath-errno" "-ffp-contract=on" "-fno-rounding-math" "-mconstructor-aliases" "-target-cpu" "pentium4" "-tune-cpu" "generic" "-fdebug-compilation-dir=/llvm/llvm-project" "-fcoverage-compilation-dir=/llvm/llvm-project" "-fdeprecated-macro" "-ferror-limit" "19" "-fno-use-cxa-atexit" "-fms-extensions" "-fms-compatibility" "-fms-compatibility-version=19.33" "-std=c++14" "-fskip-odr-check-in-gmf" "-fdelayed-template-parsing" "-fcxx-exceptions" "-fexceptions" "-fcolor-diagnostics" "-faddrsig" "-x" "c++" "-5e89b8.cpp" 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 In a similar situation where a function can't be void __thiscall g(...) {} Clang has an error that |
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?The text was updated successfully, but these errors were encountered: