mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-19 11:35:51 -04:00

This avoids cloning variadic virtual methods when the target supports musttail and the return type is not covariant. I think we never implemented this previously because it doesn't handle the covariant case. But, in the MS ABI, there are some cases where vtable thunks must be emitted even when the variadic method defintion is not available, so it looks like we need to implement this. Do it for both ABIs, since it's a nice size improvement and simplification for Itanium. Emit an error when emitting thunks for variadic methods with a covariant return type. This case is essentially not implementable unless the ABI provides a way to perfectly forward variadic arguments without a tail call. Fixes PR43173. Differential Revision: https://reviews.llvm.org/D67028 llvm-svn: 371269
14 lines
425 B
C++
14 lines
425 B
C++
// RUN: %clang_cc1 -fno-rtti-data -triple x86_64-windows-msvc -emit-llvm-only %s -verify
|
|
|
|
// Verify that we error out on this return adjusting thunk that we can't emit.
|
|
|
|
struct A {
|
|
virtual A *clone(const char *f, ...) = 0;
|
|
};
|
|
struct B : virtual A {
|
|
// expected-error@+1 2 {{cannot compile this return-adjusting thunk with variadic arguments yet}}
|
|
B *clone(const char *f, ...) override;
|
|
};
|
|
struct C : B { int c; };
|
|
C c;
|