[clang] Reland [Clang] Deprecate `__is_trivially_relocatable` (PR #139061)

Hans Wennborg via cfe-commits cfe-commits at lists.llvm.org
Mon May 12 04:58:17 PDT 2025


zmodem wrote:

I don't know all the background here, so apologies if this is a silly question, but we have some code that's checking:

```
static_assert(__is_trivially_relocatable(std::pair<const int, int>));
```

which now triggers a -Wdeprecated-builtins warning.

But if I switch to `__builtin_is_cpp_trivially_relocatable` instead, it fails:

```
error: static assertion failed due to requirement '__builtin_is_cpp_trivially_relocatable(std::pair<const int, int>)'
```

Is this intentional? (I also tried `__builtin_is_replaceable`, and that also fails.)

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


More information about the cfe-commits mailing list