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

Ole Strohm via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 22 09:30:46 PDT 2021


olestrohm added a comment.

The only ones that change (in the test cases at least) are as follows:
Here Old is with the current change, and New is with the call to `diagnoseOpenCLTypes` at parsing removed.

In `event_t.cl`, `event_t glb_evt;` in program scope has this difference:

  Old:
    the '__private event_t' type cannot be used to declare a program scope variable
  New:
    program scope variable must reside in constant address space

In `template-opencl-types.clcpp`, `__local event_t e;` inside a function has this difference:

  Old:
    the event_t type can only be used with __private address space qualifier
  New:
    non-kernel function variable cannot be declared in local address space

The first on explains that `event_t` can't be used in program scope at all, which is better I think.
However the second error actually gets slightly better.

I think these errors are primarily emitted between the two checks, so I don't know if it's easy to put the check somewhere that gives better results.


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

https://reviews.llvm.org/D100860



More information about the cfe-commits mailing list