[libcxx-commits] [libcxx] [libc++] Use remove_pointer builtin as library traits (PR #91838)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Thu May 16 12:02:49 PDT 2024


philnik777 wrote:

> > I agree that it doesn't make a ton of sense to guard this on the version, since the GCC folks make it very clear that they don't intend to support the use of the builtin directly.
> 
> For type traits, no. It is because type traits structure doesn't require demangle names. For value traits, yes. They are using the builtin directly to avoid intermediate symbols.
> 
> We have the same issues with `__add_pointer` as well where there're lacking structure used for type alias.

GCC doesn't mangle any of the builtin type traits, so you can't use `__is_whatever` directly either. You have to go through either a class template or a variable template. Both have their own mangling, while an alias template doesn't.



> > We should simply resolve the `__remove_pointer_t` alias to either `remove_pointer<>::type` for GCC or `__remove_pointer()` for Clang.
> 
> It's up to you. You're the maintainer. But that reason doesn't convince me because it makes things complex especially the patch. As a user of libc++, I want things go upstream because it makes maintainment easier without introducing some complex code.

I'm not sure why you think this makes the patch complex. That's like four lines of code.


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


More information about the libcxx-commits mailing list