Anastasia added a comment.

In D134445#3920188 <https://reviews.llvm.org/D134445#3920188>, @rjmccall wrote:

> You really can't ask whether a class template pattern is standard layout; 
> it's not meaningful.

Well the templates have to be instantiated with concrete types as kernels can't 
be called from the host code. But if the concrete type is a reference or 
pointer there is no full instantiation apparently as AST dumps in the review 
description show.

> How are pointers and references passed to kernels?  Does the pointee get 
> copied or something?  If so, you may have a requirement that pointee types be 
> complete, in which case the only problem is probably that you're doing this 
> check too soon, or doing them on declarations rather than on definition/use.

Ok, the kernel function actually already contains the instantiated templates 
since they can't be templated themselves. My understanding is that references 
and pointers to templated types are not required to be fully instantiated as 
they are not ODR-used? At least this is what I deduce from my AST dump 
examples. I.e. it work fine if the templates are not references/pointers and it 
fails to create a complete instantiation otherwise.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D134445/new/

https://reviews.llvm.org/D134445

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to