Skip to content

Commit a25e0e8

Browse files
jyu2-gitbader
authored andcommitted
[SYCL] Fix assertion for sycl keyword using without -fsycl option. (#445)
This is to fix assertion when clang compile C++ head file without -fsycl The problem is when __pipe (one of sycl keyworld) used without -fsycl option, the __pipe should not be keyword and keyword status should be KS_Disable. But it is wrongly set to KS_Future. The root problem is the KEYSYCL is add to KEYALLCXX: KEYALLCXX = KEYSYCL | KEYCXX | KEYCXX11 | KEYCXX2A It seems, we want KEYSYCL to be part of feature of C++. But which C++ should belong: C++11 or C++2a? (for example KEYCX2A... vs concept) For now we should just use -fsycl option to control this. Signed-off-by: Yu [email protected]
1 parent 21a443f commit a25e0e8

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

clang/lib/Basic/IdentifierTable.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ namespace {
101101
KEYOPENCLCXX = 0x400000,
102102
KEYMSCOMPAT = 0x800000,
103103
KEYSYCL = 0x1000000,
104-
KEYALLCXX = KEYSYCL | KEYCXX | KEYCXX11 | KEYCXX2A,
104+
KEYALLCXX = KEYCXX | KEYCXX11 | KEYCXX2A,
105105
KEYALL = (0x1ffffff & ~KEYNOMS18 &
106106
~KEYNOOPENCL) // KEYNOMS18 and KEYNOOPENCL are used to exclude.
107107
};

clang/test/SemaSYCL/keyword.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// RUN: %clang_cc1 -verify -fsyntax-only -std=c++11 %s
2+
//
3+
// expected-no-diagnostics
4+
int foo(bool __pipe);
5+
int foo(bool __read_only);
6+
int foo(bool __write_only);

0 commit comments

Comments
 (0)