[clang] [clang] Function type attribute to prevent CFI instrumentation (PR #135836)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 15 11:48:13 PDT 2025


https://github.com/erichkeane commented:

I'm concerned about the approach of trying to leave this as `AttributedType`, as that is going to result in some particularly sharp edges to this.  Consider:

```
using WithAttr = __attribute__((cfi_unchecked_callee)) BaseType;
using WithoutAttr = __attribute__((cfi_unchecked_callee)) BaseType;


using MyType = WithAttr;
using MyType = WithoutAttr; // still valid, since the attribute hasn't changed the type.
```

The diagnostic-inconsistency here mixed with the strange-never-before-an-odr-like-violation odr-like-violation is going to be extra weird.

This, IMO, needs its own AST type, with its own proper conversion rules.

@aaronballman for his opinion if it differs.

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


More information about the cfe-commits mailing list