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

2021-04-27 Thread Anastasia Stulova via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG6a92c19f3bbc: [C++4OpenCL] Add diagnostics for OpenCL types in templates. (authored by Anastasia). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D100860/new/

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

2021-04-23 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh accepted this revision. svenvh added a comment. LGTM, thanks! Please make sure that the commit message corresponds to the new shape of your patch: you might want to update the description of this review. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D100860/new/ https://reviews.

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

2021-04-23 Thread Ole Strohm via Phabricator via cfe-commits
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

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

2021-04-22 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh added a comment. In D100860#2709057 , @olestrohm wrote: > The first on explains that `event_t` can't be used in program scope at all, > which is better I think. Agreed, removing the parser check gives a worse diagnostic here. The underlying prob

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

2021-04-22 Thread Ole Strohm via Phabricator via cfe-commits
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 '

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

2021-04-22 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh added a comment. > I've left the check during parsing as well, because it provides slightly > better error messages Do you have an example of what error messages get worse if you remove the parsing check? Just wondering if there is an easy way to fix that and avoid having the check twi

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

2021-04-21 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm updated this revision to Diff 339251. olestrohm added a comment. Renamed test as suggested. 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/Sema

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

2021-04-21 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia accepted this revision. Anastasia added a comment. This revision is now accepted and ready to land. LGTM, let's just rename `template-diagnostics.clcpp` into something like `template-opencl-types.clcpp`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D100860/new/ https://review

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

2021-04-21 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm updated this revision to Diff 339197. olestrohm added a comment. Ran git-clang-format. 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/SemaOpenC

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

2021-04-21 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm updated this revision to Diff 339175. olestrohm added a comment. Inlined the `thread_local` check and moved `static clk_event_t` into the appropriate test. I did not move the `thread_local` check since NewVD had the wrong value for `TSCS`, so D was required. CHANGES SINCE LAST ACTION

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

2021-04-20 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. > I've left the check during parsing as well, because it provides slightly > better error messages, though some are lost now that NewVD is set as invalid, > instead of just setting D invalid. Yes, when there are multiple errors we don't provide the diagnostics consis

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

2021-04-20 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm created this revision. olestrohm added reviewers: Anastasia, svenvh. Herald added subscribers: ldrumm, wenlei, yaxunl. olestrohm requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. For templates diagnosis must be done after specializa