[PATCH] D100860: [C++4OpenCL] Add missing OpenCL specific diagnostics in templates

Ole Strohm via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 23 04:24:19 PDT 2021


olestrohm updated this revision to Diff 339976.
olestrohm added a comment.

I noticed that I could move the new check above the diagnostic for program scope variables, and the check during parsing can then be removed, while maintaining good diagnostics.

This does change the diagnostic for `event_t` mentioned above, however it's not a bad diagnostic, and actually matches what happens in non-kernel functions, so I think it's okay.
I would prefer the previous diagnostic for `event_t`, but that originates in the other branch of the same if statement as the program scope diagnostic, so it's not easy to separate them out and then insert the new check between them.


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

https://reviews.llvm.org/D100860

Files:
  clang/lib/Sema/SemaDecl.cpp
  clang/test/SemaOpenCL/clk_event_t.cl
  clang/test/SemaOpenCL/event_t.cl
  clang/test/SemaOpenCL/sampler_t.cl
  clang/test/SemaOpenCLCXX/template-opencl-types.clcpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100860.339976.patch
Type: text/x-patch
Size: 10267 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210423/c5e53802/attachment.bin>


More information about the cfe-commits mailing list