[all-commits] [llvm/llvm-project] 886b76: [libc++][test] Fix `msvc_is_lock_free_macro_value(...

Stephan T. Lavavej via All-commits all-commits at lists.llvm.org
Sat Aug 24 09:55:38 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 886b76128fba5f995c8c8e24aaa2030b59dec01a
      https://github.com/llvm/llvm-project/commit/886b76128fba5f995c8c8e24aaa2030b59dec01a
  Author: Stephan T. Lavavej <stl at nuwen.net>
  Date:   2024-08-24 (Sat, 24 Aug 2024)

  Changed paths:
    M libcxx/test/support/atomic_helpers.h

  Log Message:
  -----------
  [libc++][test] Fix `msvc_is_lock_free_macro_value()` (#105876)

Followup to #99570.

* `TEST_COMPILER_MSVC` must be tested for `defined`ness, as it is
everywhere else.
+ Definition:
https://github.com/llvm/llvm-project/blob/52a7116f5c6ada234f47f7794aaf501a3692b997/libcxx/test/support/test_macros.h#L71-L72
+ Example usage:
https://github.com/llvm/llvm-project/blob/52a7116f5c6ada234f47f7794aaf501a3692b997/libcxx/test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp#L248
+ Fixes: `llvm-project\libcxx\test\support\atomic_helpers.h(33): fatal
error C1017: invalid integer constant expression`
* Fix bogus return type: `msvc_is_lock_free_macro_value()` returns `2`
or `0`, so it needs to return `int`.
+ Fixes: `llvm-project\libcxx\test\support\atomic_helpers.h(41): warning
C4305: 'return': truncation from 'int' to 'bool'`
* Clarity improvement: also add parens when mixing bitwise with
arithmetic operators.



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