This patch will allow the cast of 0 to event_t type.
Details
Diff Detail
Event Timeline
foo((event_t)0);
Is above use have been hint by some test cases?
include/clang/Basic/DiagnosticSemaKinds.td | ||
---|---|---|
7679 | Please do not use DOS format. | |
lib/Sema/SemaCast.cpp | ||
2316 |
OpenCL v2.0 s6.13.10 - .... | |
2317 | (Self.getLangOpts().OpenCL) -> Self.getLangOpts().OpenCL | |
2318 | Indent. | |
2319 | Sema has a context. | |
2321 | There is a CK_ZeroToOCLEvent, why not use that? | |
2324–2328 | Indent. |
lib/Sema/SemaCast.cpp | ||
---|---|---|
2324–2326 | Need a test case for this. |
lib/Sema/SemaCast.cpp | ||
---|---|---|
2318 | Please name this variable properly: http://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly | |
2322–2323 | 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 | 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 | 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 | 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. |
Please do not use DOS format.