Skip to content

Commit 1b59f88

Browse files
committed
New issue from Yihe Li: "Some more feature-test macros for fully freestanding features are not marked freestanding"
1 parent 5e52cd6 commit 1b59f88

File tree

1 file changed

+91
-0
lines changed

1 file changed

+91
-0
lines changed

xml/issue4286.xml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
<?xml version='1.0' encoding='utf-8' standalone='no'?>
2+
<!DOCTYPE issue SYSTEM "lwg-issue.dtd">
3+
4+
<issue num="4286" status="New">
5+
<title>Some more feature-test macros for fully freestanding features are not marked freestanding</title>
6+
<section>
7+
<sref ref="[version.syn]"/><sref ref="[memory.syn]"/>
8+
</section>
9+
<submitter>Yihe Li</submitter>
10+
<date>17 Jun 2025</date>
11+
<priority>99</priority>
12+
13+
<discussion>
14+
<p>
15+
LWG <iref ref="4189"/> (accepted in Hagenberg) added nearly the entire <tt>&lt;ranges&gt;</tt> header to freestanding.
16+
However, the only feature-test macro being added to freestanding is `__cpp_lib_ranges_cache_latest`, which seems weird,
17+
since `views::enumerate` is also added to freestanding following the blanket comment strategy, but its feature-test
18+
macro remains not in freestanding. In retrospective, since all range algorithms are in freestanding via
19+
<paper num="P2976"/>, all `__cpp_lib_ranges_*` FTMs (except `__cpp_lib_ranges_generate_random` since
20+
`ranges::generate_random` is not in freestanding) should probably be marked as freestanding.
21+
<p/>
22+
Furthermore, LWG <iref ref="4126"/> left out some other FTMs for fully freestanding features. They are also added
23+
in the following wording.
24+
<p/>
25+
A note about `is_sufficiently_aligned`: <paper num="P2897R7"/> does indicate in 5.7.6.1 that the function should be
26+
freestanding, but somehow the wording didn't say so. The following wording includes the function and its FTM anyway
27+
since hopefully this is just an omission when wording the paper.
28+
</p>
29+
</discussion>
30+
31+
<resolution>
32+
<p>
33+
This wording is relative to <paper num="N5008"/>.
34+
</p>
35+
36+
<ol>
37+
<li><p>Modify <sref ref="[version.syn]"/>, header <tt>&lt;version&gt;</tt> synopsis, as indicated:</p>
38+
39+
<blockquote>
40+
<pre>
41+
[&hellip;]
42+
#define __cpp_lib_aligned_accessor 202411L <i>// <ins>freestanding,</ins> also in &lt;mdspan&gt;</i>
43+
[&hellip;]
44+
#define __cpp_lib_array_constexpr 201811L <i>// <ins>freestanding,</ins> also in &lt;iterator&gt;, &lt;array&gt;</i>
45+
[&hellip;]
46+
#define __cpp_lib_clamp 201603L <i>// <ins>freestanding,</ins> also in &lt;algorithm&gt;</i>
47+
[&hellip;]
48+
#define __cpp_lib_constexpr_numeric 201911L <i>// <ins>freestanding,</ins> also in &lt;numeric&gt;</i>
49+
[&hellip;]
50+
#define __cpp_lib_function_ref 202306L <i>// <ins>freestanding,</ins> also in &lt;functional&gt;</i>
51+
#define __cpp_lib_gcd_lcm 201606L <i>// <ins>freestanding,</ins> also in &lt;numeric&gt;</i>
52+
[&hellip;]
53+
#define __cpp_lib_integer_comparison_functions 202002L <i>// <ins>freestanding,</ins> also in &lt;utility&gt;</i>
54+
[&hellip;]
55+
#define __cpp_lib_is_sufficiently_aligned 202411L <i>// <ins>freestanding,</ins> also in &lt;memory&gt;</i>
56+
[&hellip;]
57+
#define __cpp_lib_ranges_contains 202207L <i>// <ins>freestanding,</ins> also in &lt;algorithm&gt;</i>
58+
#define __cpp_lib_ranges_enumerate 202302L <i>// <ins>freestanding,</ins> also in &lt;ranges&gt;</i>
59+
#define __cpp_lib_ranges_find_last 202207L <i>// <ins>freestanding,</ins> also in &lt;algorithm&gt;</i>
60+
#define __cpp_lib_ranges_fold 202207L <i>// <ins>freestanding,</ins> also in &lt;algorithm&gt;</i>
61+
[&hellip;]
62+
#define __cpp_lib_ranges_iota 202202L <i>// <ins>freestanding,</ins> also in &lt;numeric&gt;</i>
63+
[&hellip;]
64+
#define __cpp_lib_ranges_reserve_hint 202502L <i>// <ins>freestanding,</ins> also in &lt;ranges&gt;</i>
65+
[&hellip;]
66+
#define __cpp_lib_ranges_starts_ends_with 202106L <i>// <ins>freestanding,</ins> also in &lt;algorithm&gt;</i>
67+
[&hellip;]
68+
#define __cpp_lib_robust_nonmodifying_seq_ops 201304L <i>// <ins>freestanding,</ins> also in &lt;algorithm&gt;</i>
69+
#define __cpp_lib_sample 201603L <i>// <ins>freestanding,</ins> also in &lt;algorithm&gt;</i>
70+
#define __cpp_lib_saturation_arithmetic 202311L <i>// <ins>freestanding,</ins> also in &lt;numeric&gt;</i>
71+
[&hellip;]
72+
</pre>
73+
</blockquote>
74+
</li>
75+
76+
<li><p>Modify <sref ref="[memory.syn]"/>, header <tt>&lt;memory&gt;</tt> synopsis, as indicated:</p>
77+
78+
<blockquote>
79+
<pre>
80+
[&hellip;]
81+
template&lt;size_t Alignment, class T&gt;
82+
bool is_sufficiently_aligned(T* ptr); <ins><i>// freestanding</i></ins>
83+
[&hellip;]
84+
</pre>
85+
</blockquote>
86+
</li>
87+
88+
</ol>
89+
</resolution>
90+
91+
</issue>

0 commit comments

Comments
 (0)