llvm / llvm/llvm-project

Support `__has_feature(bounds_safety)` macro evaluation

Open
#182,948 3 comments 0 reactions 1 assignee Claimed by @abhijeetsharma200 View on GitHub
clang:bounds-safety
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

Building this source file like:

```
#if __has_feature(bounds_safety)
// OK
#else
#error bounds safety language feature is off
#endif
```

```
$ clang -Xclang -fexperimental-bounds-safety -c tmp/has_bounds_safety_feature.c
```

should not produce errors.

I think adding `FEATURE(bounds_safety, LangOpts.BoundsSafety)` to `include/clang/Basic/Features.def` and a test case should be sufficient.

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.