This patch will allow the cast of 0 to event_t type.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
foo((event_t)0);
Is above use have been hint by some test cases?
include/clang/Basic/DiagnosticSemaKinds.td | ||
---|---|---|
7679 ↗ | (On Diff #48966) | Please do not use DOS format. |
lib/Sema/SemaCast.cpp | ||
2316 ↗ | (On Diff #48966) |
OpenCL v2.0 s6.13.10 - .... |
2317 ↗ | (On Diff #48966) | (Self.getLangOpts().OpenCL) -> Self.getLangOpts().OpenCL |
2318 ↗ | (On Diff #48966) | Indent. |
2319 ↗ | (On Diff #48966) | Sema has a context. |
2321 ↗ | (On Diff #48966) | There is a CK_ZeroToOCLEvent, why not use that? |
2324–2328 ↗ | (On Diff #48966) | Indent. |
lib/Sema/SemaCast.cpp | ||
---|---|---|
2324–2326 ↗ | (On Diff #48966) | Need a test case for this. |
lib/Sema/SemaCast.cpp | ||
---|---|---|
2318 ↗ | (On Diff #49219) | Please name this variable properly: http://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly |
2322–2323 ↗ | (On Diff #49219) | Don't have an else after return. http://llvm.org/docs/CodingStandards.html#don-t-use-else-after-a-return |
lib/Sema/SemaCast.cpp | ||
---|---|---|
2317 ↗ | (On Diff #49219) | A similar patch has been submitted and rejected several times: https://www.mail-archive.com/cfe-commits@cs.uiuc.edu/msg91067.html http://marc.info/?l=cfe-commits&m=141198505414824&w=2 These were all before OpenCL 2.0. The 1.2 spec does not allow this, so I think this should be guarded by an OpenCL version check. |
lib/Sema/SemaCast.cpp | ||
---|---|---|
2317 ↗ | (On Diff #49219) | I opened a bug at khronos bugzilla requesting clarification of the issue: https://cvs.khronos.org/bugzilla/show_bug.cgi?id=15609 I will keep you updated. |
lib/Sema/SemaCast.cpp | ||
---|---|---|
2317 ↗ | (On Diff #49219) | OpenCL WG has clarified that explicit or implicit cast of 0 to event_t is allowed. It does not make sense to only allow implicit cast but not allow explicit cast. So I think we should move on with this patch. |