[clang] [Clang] Permit noescape on non-pointer types (PR #117344)

Gábor Horváth via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 3 13:58:11 PST 2024


Xazax-hun wrote:

> If that's the intended meaning, should we restrict this to structs that have pointer fields?

Yeah, that is the intended meaning. I am on the fence about restricting to structs with pointers though, mostly to more ergonomically support use cases like:

```
struct SometimesHasPtr {
#ifdef COMPILE_TIME_FEATURE_FLAG
int *ptr;
#endif
};
```

A diagnostic to warn on structs that have no pointers would trigger on `SometimesHasPtr` in some build configurations but not in others. If you think that is not a blocker, I can add a diagnostic. 

https://github.com/llvm/llvm-project/pull/117344


More information about the cfe-commits mailing list