[OpenCL] Fix diagnostics with templates in kernel args.
authorAnastasia Stulova <anastasia.stulova@arm.com>
Thu, 10 Nov 2022 15:20:34 +0000 (15:20 +0000)
committerAnastasia Stulova <anastasia.stulova@arm.com>
Thu, 10 Nov 2022 18:55:12 +0000 (18:55 +0000)
commit790cbaafc9e276aa740373c00849951338056174
treedcf296a3b89f5ecfd0e6cadcb88f0c09536703e9
parent868186cf6cb7edba08c916f98f5f87a942bf50ba
[OpenCL] Fix diagnostics with templates in kernel args.

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
clang/lib/Sema/SemaDecl.cpp
clang/test/SemaOpenCLCXX/invalid-kernel.clcpp