You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ clang++ -fsycl null_name.cpp -lOpenCL
In file included from :1:
/tmp/null_name-36241f.h:41:31: error: unknown type name 'nullptr_t'; did you mean 'std::nullptr_t'?
template <> struct KernelInfo<nullptr_t> {
^~~~~~~~~
std::nullptr_t
/usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/x86_64-linux-gnu/c++/7.3.0/bits/c++config.h:235:29: note: 'std::nullptr_t' declared here
typedef decltype(nullptr) nullptr_t;
^
1 error generated.
The text was updated successfully, but these errors were encountered:
We still issue an error when std::nullptr_t is used as a kernel name, it's just that now we do so intentionally instead of accidentally. Kernel names are expected to be forward declarable, and the C++ standard forbids any name in the std namespace to be forward declared. Therefore, std::nullptr_t -- or std::anything -- may not be used in a kernel name, and if it is, then we emit a diagnostic error, "Kernel name cannot be a type in the std namespace."
The following test fails to compile:
null_name.cpp.txt
$ clang++ -fsycl null_name.cpp -lOpenCL
In file included from :1:
/tmp/null_name-36241f.h:41:31: error: unknown type name 'nullptr_t'; did you mean 'std::nullptr_t'?
template <> struct KernelInfo<nullptr_t> {
^~~~~~~~~
std::nullptr_t
/usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/x86_64-linux-gnu/c++/7.3.0/bits/c++config.h:235:29: note: 'std::nullptr_t' declared here
typedef decltype(nullptr) nullptr_t;
^
1 error generated.
The text was updated successfully, but these errors were encountered: