intel / intel/llvm

sycl/access/access.hpp self-references deprecated symbols, breaking downstream `-Werror` builds

Open
#22,038 0 comments 0 reactions 0 assignees View on GitHub
bug confirmed
Dominant language
LLVM
Stars
1.5k
Forks
854
Avg merge
3d 17h
Merged PRs (30d)
137

Description

### Describe the bug

`sycl/include/sycl/access/access.hpp` declares three identifiers as `__SYCL2020_DEPRECATED` and then uses them internally in the same header. Including `` via `-I` (rather than `-isystem`) emits `-Wdeprecated-declarations` warnings even when user code never references the deprecated symbol. With `-Werror`, this fails the build.

### To reproduce

```cpp
// repro.cpp
#include
int main() { return 0; }
```

```
icpx -fsycl -Werror -c -I /path/to/sycl/headers/parent repro.cpp
```

**Expected:** compiles cleanly.
**Actual:**
```
sycl/access/access.hpp:79:63: error: 'constant_buffer' is deprecated:
use 'target::device' instead [-Werror,-Wdeprecated-declarations]
```
(plus similar errors for `host_buffer` at line 91 and `constant_space` at lines 135, 201).

Swapping `-I` for `-isystem` makes it clean, so the file itself is fine — the trigger is purely the include-path classification.

### Environment

- `__SYCL_COMPILER_VERSION` 20260331
- `__LIBSYCL_*_VERSION` 9.0.0
- `icpx` 2026.0.0
- conda package: `intel-sycl-rt 2026.0.0-intel_947`

### Additional context

Downstream consumers often get third-party include dirs via `-I` (e.g. CMake's `find_package` doesn't always apply `SYSTEM`). They then can't `#include ` under `-Werror` without locally patching either their own build files or the SYCL header.

For instance, I am a developer working on scikit-learn-intelex / oneDAL and our CI encounters this issue when including sycl headers: https://dev.azure.com/daal/daal4py/_build/results?buildId=59138&view=logs&jobId=127dcc8d-2748-5502-86be-ea0a2a0d4a29&j=127dcc8d-2748-5502-86be-ea0a2a0d4a29&t=794b472b-283c-5a6f-04b0-f9f2ab00901c

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.