Skip to content

Commit fa98c65

Browse files
authored
Merge 2026-03 LWG Motion 8
P3936R1 Safer `atomic_ref::address` (FR-030-310)
2 parents 95673a8 + 71eec91 commit fa98c65

2 files changed

Lines changed: 14 additions & 6 deletions

File tree

source/support.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@
594594
#define @\defnlibxname{cpp_lib_atomic_lock_free_type_aliases}@ 201907L // also in \libheader{atomic}
595595
#define @\defnlibxname{cpp_lib_atomic_min_max}@ 202506L // freestanding, also in \libheader{atomic}
596596
#define @\defnlibxname{cpp_lib_atomic_reductions}@ 202506L // freestanding, also in \libheader{atomic}
597-
#define @\defnlibxname{cpp_lib_atomic_ref}@ 202411L // freestanding, also in \libheader{atomic}
597+
#define @\defnlibxname{cpp_lib_atomic_ref}@ 202603L // freestanding, also in \libheader{atomic}
598598
#define @\defnlibxname{cpp_lib_atomic_shared_ptr}@ 201711L // also in \libheader{memory}
599599
#define @\defnlibxname{cpp_lib_atomic_value_initialization}@ 201911L // freestanding, also in \libheader{atomic}, \libheader{memory}
600600
#define @\defnlibxname{cpp_lib_atomic_wait}@ 201907L // freestanding, also in \libheader{atomic}

source/threads.tex

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2397,6 +2397,10 @@
23972397

23982398
\rSec2[atomics.general]{General}
23992399

2400+
\pnum
2401+
Let \tcode{\placeholdernc{COPYCV}(FROM, TO)} be an alias for type \tcode{TO}
2402+
with the addition of \tcode{FROM}'s top-level cv-qualifiers.
2403+
24002404
\pnum
24012405
Subclause \ref{atomics} describes components for fine-grained atomic access.
24022406
This access is provided via operations on atomic objects.
@@ -3153,6 +3157,7 @@
31533157

31543158
public:
31553159
using value_type = remove_cv_t<T>;
3160+
using @\exposid{address-return-type}@ = @\placeholdernc{COPYCV}@(T, void)*; // \expos
31563161
static constexpr size_t required_alignment = @\impdefx{required alignment for \tcode{atomic_ref} type's operations}@;
31573162

31583163
static constexpr bool is_always_lock_free = @\impdefx{whether a given \tcode{atomic_ref} type's operations are always lock free}@;
@@ -3184,7 +3189,7 @@
31843189
constexpr void wait(value_type, memory_order = memory_order::seq_cst) const noexcept;
31853190
constexpr void notify_one() const noexcept;
31863191
constexpr void notify_all() const noexcept;
3187-
constexpr T* address() const noexcept;
3192+
constexpr @\exposid{address-return-type}@ address() const noexcept;
31883193
};
31893194
}
31903195
\end{codeblock}
@@ -3620,7 +3625,7 @@
36203625

36213626
\indexlibrarymember{address}{atomic_ref<T>}%
36223627
\begin{itemdecl}
3623-
constexpr T* address() const noexcept;
3628+
constexpr @\exposid{address-return-type}@ address() const noexcept;
36243629
\end{itemdecl}
36253630

36263631
\begin{itemdescr}
@@ -3657,6 +3662,7 @@
36573662
public:
36583663
using value_type = remove_cv_t<@\placeholder{integral-type}@>;
36593664
using difference_type = value_type;
3665+
using @\exposid{address-return-type}@ = @\placeholdernc{COPYCV}@(@\placeholder{integral-type}@, void)*; // \expos
36603666
static constexpr size_t required_alignment = @\impdefx{required alignment for \tcode{atomic_ref} type's operations}@;
36613667

36623668
static constexpr bool is_always_lock_free = @\impdefx{whether a given \tcode{atomic_ref} type's operations are always lock free}@;
@@ -3728,7 +3734,7 @@
37283734
constexpr void wait(value_type, memory_order = memory_order::seq_cst) const noexcept;
37293735
constexpr void notify_one() const noexcept;
37303736
constexpr void notify_all() const noexcept;
3731-
constexpr @\placeholder{integral-type}@* address() const noexcept;
3737+
constexpr @\exposid{address-return-type}@ address() const noexcept;
37323738
};
37333739
}
37343740
\end{codeblock}
@@ -3882,6 +3888,7 @@
38823888
public:
38833889
using value_type = remove_cv_t<@\placeholder{floating-point-type}@>;
38843890
using difference_type = value_type;
3891+
using @\exposid{address-return-type}@ = @\placeholdernc{COPYCV}@(@\placeholder{floating-point-type}@, void)*; // \expos
38853892
static constexpr size_t required_alignment = @\impdefx{required alignment for \tcode{atomic_ref} type's operations}@;
38863893

38873894
static constexpr bool is_always_lock_free = @\impdefx{whether a given \tcode{atomic_ref} type's operations are always lock free}@;
@@ -3949,7 +3956,7 @@
39493956
memory_order = memory_order::seq_cst) const noexcept;
39503957
constexpr void notify_one() const noexcept;
39513958
constexpr void notify_all() const noexcept;
3952-
constexpr @\placeholder{floating-point-type}@* address() const noexcept;
3959+
constexpr @\exposid{address-return-type}@ address() const noexcept;
39533960
};
39543961
}
39553962
\end{codeblock}
@@ -4177,6 +4184,7 @@
41774184
public:
41784185
using value_type = remove_cv_t<@\placeholder{pointer-type}@>;
41794186
using difference_type = ptrdiff_t;
4187+
using @\exposid{address-return-type}@ = @\placeholdernc{COPYCV}@(@\placeholder{pointer-type}@, void)*; // \expos
41804188
static constexpr size_t required_alignment = @\impdefx{required alignment for \tcode{atomic_ref} type's operations}@;
41814189

41824190
static constexpr bool is_always_lock_free = @\impdefx{whether a given \tcode{atomic_ref} type's operations are always lock free}@;
@@ -4233,7 +4241,7 @@
42334241
constexpr void wait(value_type, memory_order = memory_order::seq_cst) const noexcept;
42344242
constexpr void notify_one() const noexcept;
42354243
constexpr void notify_all() const noexcept;
4236-
constexpr @\placeholder{pointer-type}@* address() const noexcept;
4244+
constexpr @\placeholder{address-return-type}@ address() const noexcept;
42374245
};
42384246
}
42394247
\end{codeblock}

0 commit comments

Comments
 (0)