[all-commits] [llvm/llvm-project] 5c0ea7: [libc++] Enable the optimized _IsSame on GCC as we...

Quuxplusone via All-commits all-commits at lists.llvm.org
Wed Dec 15 17:20:44 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5c0ea7488bc051453ad07135f32145465f502a84
      https://github.com/llvm/llvm-project/commit/5c0ea7488bc051453ad07135f32145465f502a84
  Author: Arthur O'Dwyer <arthur.j.odwyer at gmail.com>
  Date:   2021-12-15 (Wed, 15 Dec 2021)

  Changed paths:
    M libcxx/include/__tuple
    M libcxx/include/type_traits

  Log Message:
  -----------
  [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




More information about the All-commits mailing list