[all-commits] [llvm/llvm-project] 9965f3: [libc++] Improve diagnostic when violating `std::a...

Damien L-G via All-commits all-commits at lists.llvm.org
Mon Apr 7 12:26:06 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9965f3d337bba09fbf2497a78123957fdaee0ffa
      https://github.com/llvm/llvm-project/commit/9965f3d337bba09fbf2497a78123957fdaee0ffa
  Author: Damien L-G <dalg24 at gmail.com>
  Date:   2025-04-07 (Mon, 07 Apr 2025)

  Changed paths:
    M libcxx/include/__atomic/atomic.h
    M libcxx/include/__atomic/support.h
    M libcxx/test/std/atomics/atomics.types.generic/trivially_copyable.verify.cpp

  Log Message:
  -----------
  [libc++] Improve diagnostic when violating `std::atomic` trivially copyable mandates (#131754)

When attempting to instantiate `std::atomic` with a non trivially
copyable type, one gets errors from instantiating internals before the
actual static assertion that check the template parameter type
requirements.

The `verify` test for it had a `// ADDITIONAL_COMPILE_FLAGS: -Xclang
-verify-ignore-unexpected=error` directive to work around this issue.
The changes I propose enable us to drop that directive.
As I understand it, the `verify` test was misplaced so I moved it to
`test/{std -> libcxx}/atomics`.

(I ran into this while working on #121414 in which we would add another
static assertion in `__check_atomic_mandates`)



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