Skip to content

Commit 89f5c86

Browse files
committed
P3697R1 Minor additions to C++26 standard library hardening
1 parent a8d9618 commit 89f5c86

File tree

5 files changed

+40
-32
lines changed

5 files changed

+40
-32
lines changed

source/diagnostics.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2034,7 +2034,7 @@
20342034
Let \tcode{n} be \tcode{t.size()}.
20352035

20362036
\pnum
2037-
\expects
2037+
\hardexpects
20382038
\tcode{skip <= skip + max_depth} is \tcode{true}.
20392039

20402040
\pnum
@@ -2213,7 +2213,7 @@
22132213

22142214
\begin{itemdescr}
22152215
\pnum
2216-
\expects
2216+
\hardexpects
22172217
\tcode{frame_no < size()} is \tcode{true}.
22182218

22192219
\pnum

source/iterators.tex

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5574,7 +5574,7 @@
55745574

55755575
\begin{itemdescr}
55765576
\pnum
5577-
\expects
5577+
\hardexpects
55785578
\tcode{x.v_.valueless_by_exception()} is \tcode{false}.
55795579

55805580
\pnum
@@ -5594,7 +5594,7 @@
55945594

55955595
\begin{itemdescr}
55965596
\pnum
5597-
\expects
5597+
\hardexpects
55985598
\tcode{x.v_.valueless_by_exception()} is \tcode{false}.
55995599

56005600
\pnum
@@ -5624,7 +5624,7 @@
56245624

56255625
\begin{itemdescr}
56265626
\pnum
5627-
\expects
5627+
\hardexpects
56285628
\tcode{holds_alternative<I>(v_)} is \tcode{true}.
56295629

56305630
\pnum
@@ -5649,7 +5649,7 @@
56495649
\end{codeblock}
56505650

56515651
\pnum
5652-
\expects
5652+
\hardexpects
56535653
\tcode{holds_alternative<I>(v_)} is \tcode{true}.
56545654

56555655
\pnum
@@ -5694,7 +5694,7 @@
56945694

56955695
\begin{itemdescr}
56965696
\pnum
5697-
\expects
5697+
\hardexpects
56985698
\tcode{holds_alternative<I>(v_)} is \tcode{true}.
56995699

57005700
\pnum
@@ -5713,7 +5713,7 @@
57135713

57145714
\begin{itemdescr}
57155715
\pnum
5716-
\expects
5716+
\hardexpects
57175717
\tcode{holds_alternative<I>(v_)} is \tcode{true}.
57185718

57195719
\pnum
@@ -5768,7 +5768,7 @@
57685768

57695769
\begin{itemdescr}
57705770
\pnum
5771-
\expects
5771+
\hardexpects
57725772
\tcode{x.v_.valueless_by_exception()} and \tcode{y.v_.valueless_by_exception()}
57735773
are each \tcode{false}.
57745774

@@ -5789,7 +5789,7 @@
57895789

57905790
\begin{itemdescr}
57915791
\pnum
5792-
\expects
5792+
\hardexpects
57935793
\tcode{x.v_.valueless_by_exception()} and \tcode{y.v_.valueless_by_exception()}
57945794
are each \tcode{false}.
57955795

@@ -5810,7 +5810,7 @@
58105810

58115811
\begin{itemdescr}
58125812
\pnum
5813-
\expects
5813+
\hardexpects
58145814
\tcode{x.v_.valueless_by_exception()} and \tcode{y.v_.valueless_by_exception()}
58155815
are each \tcode{false}.
58165816

@@ -5832,7 +5832,7 @@
58325832

58335833
\begin{itemdescr}
58345834
\pnum
5835-
\expects
5835+
\hardexpects
58365836
\tcode{holds_alternative<I>(i.v_)} is \tcode{true}.
58375837

58385838
\pnum
@@ -5849,7 +5849,7 @@
58495849

58505850
\begin{itemdescr}
58515851
\pnum
5852-
\expects
5852+
\hardexpects
58535853
\tcode{holds_alternative<I>(x.v_)} and \tcode{holds_alternative<I2>(y.v_)}
58545854
are each \tcode{true}.
58555855

@@ -6014,8 +6014,8 @@
60146014

60156015
\begin{itemdescr}
60166016
\pnum
6017-
\expects
6018-
\tcode{n >= 0}.
6017+
\hardexpects
6018+
\tcode{n >= 0} is \tcode{true}.
60196019

60206020
\pnum
60216021
\effects
@@ -6101,7 +6101,7 @@
61016101

61026102
\begin{itemdescr}
61036103
\pnum
6104-
\expects
6104+
\hardexpects
61056105
\tcode{length > 0} is \tcode{true}.
61066106

61076107
\pnum
@@ -6129,8 +6129,8 @@
61296129

61306130
\begin{itemdescr}
61316131
\pnum
6132-
\expects
6133-
\tcode{n < length}.
6132+
\hardexpects
6133+
\tcode{n < length} is \tcode{true}.
61346134

61356135
\pnum
61366136
\effects
@@ -6146,8 +6146,8 @@
61466146

61476147
\begin{itemdescr}
61486148
\pnum
6149-
\expects
6150-
\tcode{length > 0}.
6149+
\hardexpects
6150+
\tcode{length > 0} is \tcode{true}.
61516151

61526152
\pnum
61536153
\effects
@@ -6166,8 +6166,8 @@
61666166

61676167
\begin{itemdescr}
61686168
\pnum
6169-
\expects
6170-
\tcode{length > 0}.
6169+
\hardexpects
6170+
\tcode{length > 0} is \tcode{true}.
61716171

61726172
\pnum
61736173
\effects
@@ -6263,8 +6263,8 @@
62636263

62646264
\begin{itemdescr}
62656265
\pnum
6266-
\expects
6267-
\tcode{n <= length}.
6266+
\hardexpects
6267+
\tcode{n <= length} is \tcode{true}.
62686268

62696269
\pnum
62706270
\effects
@@ -6339,8 +6339,8 @@
63396339

63406340
\begin{itemdescr}
63416341
\pnum
6342-
\expects
6343-
\tcode{-n <= length}.
6342+
\hardexpects
6343+
\tcode{-n <= length} is \tcode{true}.
63446344

63456345
\pnum
63466346
\effects
@@ -6420,7 +6420,7 @@
64206420

64216421
\begin{itemdescr}
64226422
\pnum
6423-
\expects
6423+
\hardexpects
64246424
\tcode{i.length > 0} is \tcode{true}.
64256425

64266426
\pnum
@@ -6438,7 +6438,7 @@
64386438

64396439
\begin{itemdescr}
64406440
\pnum
6441-
\expects
6441+
\hardexpects
64426442
Both \tcode{x.length > 0} and \tcode{y.length > 0} are \tcode{true}.
64436443

64446444
\pnum

source/memory.tex

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3952,8 +3952,11 @@
39523952
\begin{itemdescr}
39533953
\pnum
39543954
\expects
3955-
\tcode{get() != nullptr \&\& i >= 0}.
3956-
If \tcode{T} is \tcode{U[N]}, \tcode{i < N}.
3955+
\tcode{get() != nullptr}.
3956+
3957+
\pnum
3958+
\hardexpects
3959+
\tcode{i <= 0}. If \tcode{T} is \tcode{U[N]}, \tcode{i < N}.
39573960

39583961
\pnum
39593962
\returns

source/ranges.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1868,7 +1868,7 @@
18681868

18691869
\begin{itemdescr}
18701870
\pnum
1871-
\expects
1871+
\hardexpects
18721872
\tcode{!empty()} is \tcode{true}.
18731873

18741874
\pnum
@@ -1885,7 +1885,7 @@
18851885

18861886
\begin{itemdescr}
18871887
\pnum
1888-
\expects
1888+
\hardexpects
18891889
\tcode{!empty()} is \tcode{true}.
18901890

18911891
\pnum

source/support.tex

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -855,19 +855,24 @@
855855
Additionally, each of the following macros is defined in a hardened implementation:
856856
\begin{codeblock}
857857
#define @\defnlibxname{cpp_lib_hardened_array}@ 202502L // also in \libheader{array}
858+
#define @\defnlibxname{cpp_lib_hardened_basic_stacktrace}@ 202506L // also in \libheader{stacktrace}
858859
#define @\defnlibxname{cpp_lib_hardened_basic_string}@ 202502L // also in \libheader{string}
859860
#define @\defnlibxname{cpp_lib_hardened_basic_string_view}@ 202502L // also in \libheader{string_view}
860861
#define @\defnlibxname{cpp_lib_hardened_bitset}@ 202502L // also in \libheader{bitset}
862+
#define @\defnlibxname{cpp_lib_hardened_common_iterator}@ 202506L // also in \libheader{iterator}
863+
#define @\defnlibxname{cpp_lib_hardened_counted_iterator}@ 202506L // also in \libheader{iterator}
861864
#define @\defnlibxname{cpp_lib_hardened_deque}@ 202502L // also in \libheader{deque}
862865
#define @\defnlibxname{cpp_lib_hardened_expected}@ 202502L // also in \libheader{expected}
863866
#define @\defnlibxname{cpp_lib_hardened_forward_list}@ 202502L // also in \libheader{forward_list}
864867
#define @\defnlibxname{cpp_lib_hardened_inplace_vector}@ 202502L // also in \libheader{inplace_vector}
865868
#define @\defnlibxname{cpp_lib_hardened_list}@ 202502L // also in \libheader{list}
866869
#define @\defnlibxname{cpp_lib_hardened_mdspan}@ 202502L // also in \libheader{mdspan}
867870
#define @\defnlibxname{cpp_lib_hardened_optional}@ 202502L // also in \libheader{optional}
871+
#define @\defnlibxname{cpp_lib_hardened_shared_ptr_array}@ 202506L // also in \libheader{memory}
868872
#define @\defnlibxname{cpp_lib_hardened_span}@ 202502L // also in \libheader{span}
869873
#define @\defnlibxname{cpp_lib_hardened_valarray}@ 202502L // also in \libheader{valarray}
870874
#define @\defnlibxname{cpp_lib_hardened_vector}@ 202502L // also in \libheader{vector}
875+
#define @\defnlibxname{cpp_lib_hardened_view_interface}@ 202506L // also in \libheader{memory}
871876
\end{codeblock}
872877

873878
\pnum

0 commit comments

Comments
 (0)