File tree Expand file tree Collapse file tree 2 files changed +24
-3
lines changed Expand file tree Collapse file tree 2 files changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ class queue {
70
70
// /
71
71
// / \param SyclDevice is an instance of SYCL device.
72
72
// / \param PropList is a list of properties for queue construction.
73
- queue (const device &SyclDevice, const property_list &PropList = {})
73
+ explicit queue (const device &SyclDevice, const property_list &PropList = {})
74
74
: queue(SyclDevice, async_handler{}, PropList) {}
75
75
76
76
// / Constructs a SYCL queue instance with an async_handler using the device
@@ -79,8 +79,8 @@ class queue {
79
79
// / \param SyclDevice is an instance of SYCL device.
80
80
// / \param AsyncHandler is a SYCL asynchronous exception handler.
81
81
// / \param PropList is a list of properties for queue construction.
82
- queue (const device &SyclDevice, const async_handler &AsyncHandler,
83
- const property_list &PropList = {});
82
+ explicit queue (const device &SyclDevice, const async_handler &AsyncHandler,
83
+ const property_list &PropList = {});
84
84
85
85
// / Constructs a SYCL queue instance that is associated with the context
86
86
// / provided, using the device returned by the device selector.
Original file line number Diff line number Diff line change
1
+ // RUN: %clangxx -fsyntax-only -Xclang -verify %s -Xclang -verify-ignore-unexpected=note,warning
2
+ // ==-- implicit_conversion_error.cpp - Unintended implicit conversion check --==//
3
+ //
4
+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5
+ // See https://llvm.org/LICENSE.txt for license information.
6
+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7
+ //
8
+ // ===-----------------------------------------------------------------------===//
9
+ #include < CL/sycl.hpp>
10
+
11
+ int main () {
12
+ cl::sycl::queue q;
13
+ cl::sycl::context cxt = q.get_context ();
14
+ cl::sycl::device dev = q.get_device ();
15
+
16
+ cl::sycl::context cxt2{dev};
17
+ cl::sycl::context cxt3 = dev; // expected-error {{no viable conversion from 'cl::sycl::device' to 'cl::sycl::context'}}
18
+
19
+ cl::sycl::queue q2{dev};
20
+ cl::sycl::queue q3 = dev; // expected-error {{no viable conversion from 'cl::sycl::device' to 'cl::sycl::queue'}}
21
+ }
You can’t perform that action at this time.
0 commit comments