[clang] [clang] Add `clang::behaves_like_std(...)` attribute (PR #76596)

Nikolas Klauser via cfe-commits cfe-commits at lists.llvm.org
Sun Dec 31 01:35:06 PST 2023


philnik777 wrote:

> @philnik777 Do `std::move`/ `std::forward` etc actually need an abi tag? Maybe we should simply not set a tag given that clang / gcc replace call to these functions.

If that were always the case we could simply provide a declaration without ever defining the function, but clang and gcc don't always replace it. e.g. if you take the address (which both compilers unfortunately still allow). While it's unlikely for `std::move` specifically, it's always possible that the implementation changes and we have ABI breaks in the end, and having an ABI break vs. not allowing forward declarations of standard library functions seems like a no-brainer to me.

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


More information about the cfe-commits mailing list