llvm-project
9e15c6cc - [CUDA/HIP] Do not ignore complete destructors in abstract classes (#184894)

Commit
15 days ago
[CUDA/HIP] Do not ignore complete destructors in abstract classes (#184894) Summary: The complete destructor destroys virtual base subobjects even for abstract classes, so target inference must consider vbases when analyzing destructors. This was motivated by behavior observed from a bug where a constexpr function that calls a non-constexpr function. I believe this error is secondary, but can be fixed by this observation. The issue was the switch to C++20 allowing allocator destructors to be constexpr began opting the function into `__host__ __device__` contexts. This function then called a non-constexpr function through a type-trait interface which lead to that only having `__host__` which is illegal. The fix offered here is to check the bases of this function and correctly derive that it is `__host__` and not `__host__ __device__` as was previously inferred. This should only affect cases where the *only* member is an inherited virtual destructor. Previously we found no bases and thus made no judgement. Fixes: https://github.com/llvm/llvm-project/issues/184856
Author
Parents
Loading