[libc++] Enable the optimized _IsSame on GCC as well as Clang.
However, there's a problem on both GCC and Clang: they can't mangle `__is_same(T,U)` if it appears anywhere that affects mangling. That's a hard error. And it turns out that GCC puts dependent return types into the mangling more aggressively than Clang, so for GCC's benefit we need to avoid using raw `_IsSame` in the return type of `swap(tuple&, tuple&)`. Therefore, make `__all` into a named type instead of an alias. If we ever need to support a compiler without the __is_same builtin, we can make this an alias template for `is_same<T,U>::type`. Differential Revision: https://reviews.llvm.org/D115100
Loading
Please sign in to comment