Issue 139856
Summary [ARM64EC] Can't `std::invoke` a virtual function
Labels new issue
Assignees
Reporter tuxzz
    Minimal code to reproduct:
````c++
struct ChildClass {
  virtual int fn() { return m_c0;  }

  int m_c0{0xcd};
};


int main()
{
  auto obj = new ChildClass();
  auto v = std::invoke(&ChildClass::fn, obj);
  return v;
}
````

The crash point always like this:

> [0x0] ConsoleApplication1!ChildClass::`vcall'{0}'+0x54   0x66f818fc00 0x7ff78acc1184 

![Image](https://github.com/user-attachments/assets/c515e077-1d87-4ecb-99f4-fbf6c331429b)

Verison: clang 20.1.4
target: arm64ec-pc-windows-msvc

This is a arm64ec specific problem. This can't be reproduced on arm64-pc-windows-msvc
For a simple virtual function call, there is no problem.

This bug also makes googletest unusable.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to