Improve checking for the standard layout type when diagnosing
the kernel argument with templated types. The check doesn't work
correctly for references or pointers due to the lazy template
instantiation.
Current fix only improves cases where nested types in the templates
do not depend on the template parameters.
Differential Revision: https://reviews.llvm.org/D134445