================ @@ -32,22 +32,24 @@ public: template class B<float>; } -// The implicit host/device attrs of virtual dtor B<float>::~B() is inferred to -// have implicit device attr since dtors of its members and parent classes can -// be executed on device. This causes a diagnostic since B<float>::~B() must -// be emitted, and it eventually causes host_fun() called on device side. +// The implicit host/device attrs of virtual dtor ~B() should be +// conservatively inferred, where constexpr member dtor's should +// not be considered device since they may call host functions. +// Therefore B<float>::~B() should not have implicit device attr. +// However C<float>::~C() should have implicit device attr since +// it is trivial. namespace ExplicitInstantiationDtorNoAttr { -void host_fun() // dev-note {{'host_fun' declared here}} +void host_fun() ---------------- Artem-B wrote:
Do I understand it correctly that the code is still expected to error out as a deferred diag at codegen phase? If so, it would be great to mention that in the comment, and, maybe, add a codegen case if it's not done already in the deferred diags part of the patch we split off. https://github.com/llvm/llvm-project/pull/128926 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits