[libc-commits] [libc] [libc] fix and explicit atomic difference from c++ (PR #119715)

Schrodinger ZHU Yifan via libc-commits libc-commits at lists.llvm.org
Thu Dec 12 09:13:18 PST 2024


================
@@ -62,6 +62,18 @@ template <typename T> struct Atomic {
     return static_cast<int>(mem_scope);
   }
 
+  LIBC_INLINE static T *addressof(T &ref) { return __builtin_addressof(ref); }
----------------
SchrodingerZhu wrote:

`constexpr` can only be static, otherwise the compiler would complain.
The function here can be static or not but it does not depend on the member field so `static` seems more suitable.

https://github.com/llvm/llvm-project/pull/119715


More information about the libc-commits mailing list