[all-commits] [llvm/llvm-project] accfbd: [libc++] Replace __is_trivially_relocatable by is_...

Louis Dionne via All-commits all-commits at lists.llvm.org
Wed Feb 5 19:33:12 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: accfbd4cb327411ad66c0109ba1841482b871967
      https://github.com/llvm/llvm-project/commit/accfbd4cb327411ad66c0109ba1841482b871967
  Author: Louis Dionne <ldionne.2 at gmail.com>
  Date:   2025-02-05 (Wed, 05 Feb 2025)

  Changed paths:
    M libcxx/include/__type_traits/is_trivially_relocatable.h
    M libcxx/test/libcxx/type_traits/is_trivially_relocatable.compile.pass.cpp
    A libcxx/test/std/containers/sequences/vector/trivial_relocation.pass.cpp

  Log Message:
  -----------
  [libc++] Replace __is_trivially_relocatable by is_trivially_copyable (#124970)

The __is_trivially_relocatable builtin has semantics that do not
correspond to any current or future notion of trivial relocation.
Furthermore, it currently leads to incorrect optimizations for some
types on supported compilers:
- Clang on Windows where types with non-trivial destructors get
  incorrectly optimized
- AppleClang where types with non-trivial move constructors get
  incorrectly optimized

Until there is an agreed upon and bugfree implementation of what it
means to be trivially relocatable, it is safer to simply use trivially
copyable instead. This doesn't leave a lot of types behind and is
definitely correct.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list