[clang] [CUDA][HIP] make trivial ctor/dtor host device (PR #72394)

Yaxun Liu via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 21 08:33:06 PST 2023


yxsamliu wrote:

Thanks for reporting. A reduced testcase is https://godbolt.org/z/MY84az9xh

`template <class T>
struct ptr {
    ~ptr() { static int x = 1;}
};

template <class T>
struct Abc : ptr<T> {
 public:
  Abc();
  ~Abc() {}
};

template 
class Abc<int>;
`

clang thinks Abc<int>::~Abc() is trivial but it is not. It could be due to clang does not check base class for templates. Probably should only make instantiated ctor/dtor implicit.

https://github.com/llvm/llvm-project/pull/72394


More information about the cfe-commits mailing list