| Doc. no. |
N2728=08-0238 |
| Date: |
2008-08-24 |
| Project: |
Programming Language C++ |
| Reply to: |
Howard Hinnant <howard.hinnant@gmail.com> |
C++ Standard Library Defect Report List (Revision R59)
Reference ISO/IEC IS 14882:1998(E)
Also see:
This document contains only library issues which have been closed
by the Library Working Group (LWG) after being found to be defects
in the standard. That is, issues which have a status of DR,
TC, or RR. See the
Library Closed Issues List for issues closed as non-defects. See the
Library Active Issues List for active issues and more information. The
introductory material in that document also applies to this
document.
Revision History
- R59:
2008-08-22 pre-San Francisco mailing.
- Summary:
- 192 open issues, up by 9.
- 686 closed issues, up by 0.
- 878 issues total, up by 9.
- Details:
- R58:
2008-07-28 mid-term mailing.
- Summary:
- 183 open issues, up by 12.
- 686 closed issues, down by 4.
- 869 issues total, up by 8.
- Details:
- Added the following New issues: 862, 863, 864, 865, 866, 867, 868, 869.
- Changed the following issues from Pending NAD Editorial to NAD Editorial: 393, 557, 592, 754, 757.
- Changed the following issues from Pending WP to Open: 644.
- Changed the following issues from WP to Ready: 387, 629.
- Changed the following issues from Pending NAD Editorial to Review: 709.
- R57:
2008-06-27 post-Sophia Antipolis mailing.
- Summary:
- 171 open issues, down by 20.
- 690 closed issues, up by 43.
- 861 issues total, up by 23.
- Details:
- Added the following NAD issues: 840.
- Added the following New issues: 841, 843, 845, 846, 847, 849, 853, 854, 855, 856, 857, 858, 859, 860, 861.
- Added the following Open issues: 839.
- Added the following Ready issues: 842, 844, 848, 850, 852.
- Added the following Review issues: 851.
- Changed the following issues from New to NAD: 826.
- Changed the following issues from Open to NAD: 570.
- Changed the following issues from New to NAD Editorial: 786, 831.
- Changed the following issues from Open to NAD Editorial: 756, 767.
- Changed the following issues from New to Open: 723, 726, 794, 815, 825, 830, 833, 834.
- Changed the following issues from Ready to Open: 471.
- Changed the following issues from Review to Open: 539, 711.
- Changed the following issues from New to Ready: 713, 714, 769, 772, 779, 787, 805, 806, 807, 808, 809, 813, 824, 829.
- Changed the following issues from Open to Ready: 180, 396, 522, 720, 762.
- Changed the following issues from Review to Ready: 691, 728, 771, 776.
- Changed the following issues from New to Review: 692, 698, 752, 804, 823, 828, 832.
- Changed the following issues from Open to Review: 23, 675, 734, 803.
- Changed the following issues from Ready to Review: 758.
- Changed the following issues from Ready to WP: 387, 518, 550, 574, 595, 596, 612, 618, 629, 638, 672, 673, 685, 710, 715, 722, 740, 743, 744, 746, 749, 755, 759, 761, 766, 768, 770, 775, 777, 778, 781, 782, 783, 789, 792, 798.
- R56:
2008-05-16 pre-Sophia Antipolis mailing.
- Summary:
- 191 open issues, up by 24.
- 647 closed issues, up by 1.
- 838 issues total, up by 25.
- Details:
- Added the following New issues: 814, 815, 816, 817, 818, 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, 835, 836, 837, 838.
- Changed the following issues from New to NAD: 802.
- R55:
2008-03-14 post-Bellevue mailing.
- Summary:
- 167 open issues, down by 39.
- 646 closed issues, up by 65.
- 813 issues total, up by 26.
- Details:
- Added the following Dup issues: 795.
- Added the following NAD issues: 790, 791, 796, 797, 799.
- Added the following New issues: 788, 794, 802, 804, 805, 806, 807, 808, 809, 810, 811, 812, 813.
- Added the following Open issues: 793, 800, 801, 803.
- Added the following Ready issues: 789, 792, 798.
- Changed the following issues from NAD Future to Dup: 116.
- Changed the following issues from NAD Future to NAD: 188, 323.
- Changed the following issues from New to NAD: 729, 730, 731, 733, 735, 736, 737, 739, 741, 745, 748, 763, 764, 773, 784.
- Changed the following issues from Open to NAD: 388, 462, 579, 627, 653, 686, 707.
- Changed the following issues from NAD Future to NAD Editorial: 140, 390.
- Changed the following issues from Open to NAD Editorial: 529, 626.
- Changed the following issues from Review to NAD Editorial: 645, 684.
- Changed the following issues from NAD Future to Open: 128, 180, 190.
- Changed the following issues from New to Open: 617, 718, 719, 720, 724, 732, 734, 742, 747, 750, 753, 756, 760, 762, 767, 774.
- Changed the following issues from Ready to Open: 675, 676, 688.
- Changed the following issues from New to Pending NAD Editorial: 709, 717, 725, 738, 754, 757.
- Changed the following issues from Open to Pending NAD Editorial: 424, 557, 625.
- Changed the following issues from New to Ready: 710, 715, 722, 740, 743, 744, 746, 749, 755, 758, 759, 761, 766, 768, 770, 775, 777, 778, 781, 782, 783.
- Changed the following issues from Open to Ready: 387, 471, 550, 612, 629, 673.
- Changed the following issues from Review to Ready: 518, 574, 596, 618, 638, 672, 685.
- Changed the following issues from New to Review: 711, 728, 771, 776.
- Changed the following issues from Open to Review: 539.
- Changed the following issues from Ready to WP: 561, 562, 563, 567, 581, 620, 621, 622, 623, 624, 661, 664, 665, 666, 674, 679, 680, 687, 689, 693, 694, 695, 700, 703, 705, 706.
- Changed the following issues from Tentatively Ready to WP: 527.
- R54:
2008-02-01 pre-Bellevue mailing.
- Summary:
- 206 open issues, up by 23.
- 581 closed issues, up by 0.
- 787 issues total, up by 23.
- Details:
- Added the following New issues: 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, 787.
- Changed the following issues from NAD Future to Dup: 105, 348.
- Changed the following issues from NAD Future to NAD Editorial: 353.
- Changed the following issues from New to NAD Editorial: 697.
- Changed the following issues from NAD Future to Open: 388.
- Changed the following issues from Open to Tentatively Ready: 527.
- R53:
2007-12-09 mid-term mailing.
- Summary:
- 183 open issues, up by 11.
- 581 closed issues, down by 1.
- 764 issues total, up by 10.
- Details:
- Added the following New issues: 755, 756, 757, 758, 759, 760, 761, 762, 763, 764.
- Changed the following issues from NAD to Open: 463.
- Changed the following issues from Pending WP to WP: 607, 608, 654, 655, 677, 682.
- R52:
2007-10-19 post-Kona mailing.
- Summary:
- 172 open issues, up by 4.
- 582 closed issues, up by 27.
- 754 issues total, up by 31.
- Details:
- Added the following New issues: 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754.
- Changed the following issues from NAD Future to Dup: 77, 350.
- Changed the following issues from New to NAD: 639, 657, 663.
- Changed the following issues from Open to NAD: 548.
- Changed the following issues from New to Open: 546, 550, 564, 565, 573, 585, 588, 627, 629, 630, 632, 635, 653, 659, 667, 668, 669, 670, 671, 673, 686, 704, 707, 708.
- Changed the following issues from New to Pending NAD Editorial: 393, 592.
- Changed the following issues from New to Pending WP: 607, 608, 654, 655, 677, 682.
- Changed the following issues from New to Ready: 561, 562, 563, 567, 581, 595, 620, 621, 622, 623, 624, 661, 664, 665, 666, 674, 675, 676, 679, 687, 688, 689, 693, 694, 695, 700, 703, 705, 706.
- Changed the following issues from Open to Ready: 680.
- Changed the following issues from New to Review: 574, 596, 618, 638, 645, 672, 684, 685, 691.
- Changed the following issues from New to WP: 552, 634, 650, 651, 652, 678, 681, 699, 712.
- Changed the following issues from Open to WP: 258, 401, 524.
- Changed the following issues from Ready to WP: 488, 577, 660.
- R51:
2007-09-09 pre-Kona mailing.
- Summary:
- 168 open issues, up by 15.
- 555 closed issues, up by 0.
- 723 issues total, up by 15.
- Details:
- Added the following New issues: 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723.
- R50:
2007-08-05 post-Toronto mailing.
- Summary:
- 153 open issues, down by 5.
- 555 closed issues, up by 17.
- 708 issues total, up by 12.
- Details:
- Added the following New issues: 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 707, 708.
- Changed the following issues from New to NAD: 583, 584, 662.
- Changed the following issues from Open to NAD: 528.
- Changed the following issues from New to NAD Editorial: 637, 647, 658, 690.
- Changed the following issues from Open to NAD Editorial: 525.
- Changed the following issues from Pending NAD Editorial to NAD Editorial: 553, 571, 591, 633, 636, 641, 642, 648, 649, 656.
- Changed the following issues from New to Open: 579, 631, 680.
- Changed the following issues from Pending WP to Open: 258.
- Changed the following issues from Ready to Pending WP: 644.
- Changed the following issues from New to Ready: 577, 660.
- Changed the following issues from Open to Ready: 488.
- Changed the following issues from Open to Review: 518.
- Changed the following issues from Ready to TRDec: 604.
- Changed the following issues from DR to WP: 453.
- Changed the following issues from Ready to WP: 531, 551, 566, 628, 640, 643, 646.
- R49:
2007-06-23 pre-Toronto mailing.
- Summary:
- 158 open issues, up by 13.
- 538 closed issues, up by 7.
- 696 issues total, up by 20.
- Details:
- Added the following New issues: 677, 678, 679, 680, 681, 682, 684, 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696.
- Added the following Pending NAD Editorial issues: 683.
- Changed the following issues from New to NAD Editorial: 587.
- Changed the following issues from Open to NAD Editorial: 590.
- Changed the following issues from New to Pending NAD Editorial: 636, 642, 648, 649.
- R48:
2007-05-06 post-Oxford mailing.
- Summary:
- 145 open issues, down by 33.
- 531 closed issues, up by 53.
- 676 issues total, up by 20.
- Details:
- Added the following New issues: 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676.
- Changed the following issues from Tentatively Ready to Dup: 479, 536.
- Changed the following issues from Tentatively Ready to NAD: 385, 463, 466, 470, 515, 526, 547, 560, 572.
- Changed the following issues from NAD to NAD Editorial: 351, 357, 368, 499, 504, 512, 513, 514, 516, 544, 549, 555, 558.
- Changed the following issues from Tentatively Ready to NAD Editorial: 482, 615.
- Changed the following issues from NAD_Future to NAD Future: 77, 105, 111, 116, 128, 138, 140, 149, 180, 188, 190, 219, 323, 348, 350, 353, 388, 390.
- Changed the following issues from Tentatively Ready to Open: 471.
- Changed the following issues from New to Pending NAD Editorial: 633, 641, 656.
- Changed the following issues from Tentatively Ready to Pending NAD Editorial: 532, 553, 571, 591, 594.
- Changed the following issues from Tentatively Ready to Pending WP: 258.
- Changed the following issues from New to Ready: 566, 628, 640, 643, 644, 646.
- Changed the following issues from Review to Ready: 531, 551, 604.
- Changed the following issues from Ready to TRDec: 598, 599, 600, 601, 602, 603, 605.
- Changed the following issues from Ready to WP: 543, 545.
- Changed the following issues from Tentatively Ready to WP: 201, 206, 233, 254, 416, 422, 456, 534, 542, 559, 575, 576, 578, 586, 589, 593, 609, 610, 611, 613, 616, 619.
- R47:
2007-03-09 pre-Oxford mailing.
- Summary:
- 178 open issues, up by 37.
- 478 closed issues, up by 0.
- 656 issues total, up by 37.
- Details:
- Added the following New issues: 620, 621, 622, 623, 624, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656.
- Added the following Open issues: 625, 626.
- Changed the following issues from New to Open: 570, 580, 582, 590, 612, 614.
- Changed the following issues from New to Tentatively Ready: 547, 553, 560, 571, 572, 575, 576, 578, 586, 589, 591, 593, 594, 609, 610, 611, 613, 615, 616, 619.
- Changed the following issues from Open to Tentatively Ready: 201, 206, 233, 254, 258, 385, 416, 422, 456, 463, 466, 470, 471, 479, 482, 515, 526, 532, 536, 542, 559.
- Changed the following issues from Review to Tentatively Ready: 534.
- R46:
2007-01-12 mid-term mailing.
- Summary:
- 141 open issues, up by 11.
- 478 closed issues, down by 1.
- 619 issues total, up by 10.
- Details:
- R45:
2006-11-03 post-Portland mailing.
- Summary:
- 130 open issues, up by 0.
- 479 closed issues, up by 17.
- 609 issues total, up by 17.
- Details:
- Moved issues 520, 521, 530, 535, 537, 538, 540, 541 to WP.
- Moved issues 504, 512, 516, 544, 549, 554, 555, 558 to NAD.
- Moved issue 569 to Dup.
- Moved issues 518, 523, 524, 542, 556, 557, 559, 597, 606 to Open.
- Moved issues 543, 545, 549, 549, 598 - 603, 605 to Ready.
- Moved issues 531, 551, 604 to Review.
- Added new issues 593-609.
- R44:
2006-09-08 pre-Portland mailing.
- Summary:
- 130 open issues, up by 6.
- 462 closed issues, down by 1.
- 592 issues total, up by 5.
- Details:
- R43:
2006-06-23 mid-term mailing.
- Summary:
- 124 open issues, up by 14.
- 463 closed issues, down by 1.
- 587 issues total, up by 13.
- Details:
- R42:
2006-04-21 post-Berlin mailing.
- Summary:
- 110 open issues, down by 16.
- 464 closed issues, up by 24.
- 574 issues total, up by 8.
- Details:
- Added new issues 567-572.
- Moved issues 499, 501, 506, 509-511, 513, 514, 517 to NAD.
- Moved issues 502, 503, 515, 516, 522, 525-529, 532, 536, 539, 548 to Open.
- Moved issue 504, 512, 521, 530, 531, 535, 537, 538, 540, 549 to Ready.
- Moved issues 247, 294, 362, 369, 371, 376, 384, 475, 478, 495, 497, 505, 507, 508, 519 to WP.
- Moved issue 534 to Review.
- R41:
2006-02-24 pre-Berlin mailing.
- Summary:
- 126 open issues, up by 31.
- 440 closed issues, up by 0.
- 566 issues total, up by 31.
- Details:
- Added new issues 536-566.
- Moved 342 from Ready to Open.
- Reopened 309.
- R40:
2005-12-16 mid-term mailing.
- Summary:
- 95 open issues.
- 440 closed issues.
- 535 issues total.
- Details:
- R39:
2005-10-14 post-Mont Tremblant mailing.
Added new issues 526-528.
Moved issues 280, 461, 464, 465, 467, 468, 474, 496 from Ready to WP as per the vote from Mont Tremblant.
Moved issues 247, 294, 342, 362, 369, 371, 376, 384, 475, 478, 495, 497 from Review to Ready.
Moved issues 498, 504, 506, 509, 510, 511, 512, 513, 514 from New to Open.
Moved issues 505, 507, 508, 519 from New to Ready.
Moved issue 500 from New to NAD.
Moved issue 518 from New to Review.
- R38:
2005-07-03 pre-Mont Tremblant mailing.
Merged open TR1 issues in 504-522.
Added new issues 523-523
- R37:
2005-06 mid-term mailing.
Added new issues 498-503.
- R36:
2005-04 post-Lillehammer mailing. All issues in "ready" status except
for 454 were moved to "DR" status, and all issues
previously in "DR" status were moved to "WP".
- R35:
2005-03 pre-Lillehammer mailing.
- R34:
2005-01 mid-term mailing. Added new issues 488-494.
- R33:
2004-11 post-Redmond mailing. Reflects actions taken in Redmond.
- R32:
2004-09 pre-Redmond mailing: reflects new proposed resolutions and
new issues received after the 2004-07 mailing. Added
new issues 479-481.
- R31:
2004-07 mid-term mailing: reflects new proposed resolutions and
new issues received after the post-Sydney mailing. Added
new issues 463-478.
- R30:
Post-Sydney mailing: reflects decisions made at the Sydney meeting.
Voted all "Ready" issues from R29 into the working paper.
Added new issues 460-462.
- R29:
Pre-Sydney mailing. Added new issues 441-457.
- R28:
Post-Kona mailing: reflects decisions made at the Kona meeting.
Added new issues 432-440.
- R27:
Pre-Kona mailing. Added new issues 404-431.
- R26:
Post-Oxford mailing: reflects decisions made at the Oxford meeting.
All issues in Ready status were voted into DR status. All issues in
DR status were voted into WP status.
- R25:
Pre-Oxford mailing. Added new issues 390-402.
- R24:
Post-Santa Cruz mailing: reflects decisions made at the Santa Cruz
meeting. All Ready issues from R23 with the exception of 253, which has been given a new proposed resolution, were
moved to DR status. Added new issues 383-389. (Issues 387-389 were discussed
at the meeting.) Made progress on issues 225, 226, 229: 225 and 229 have been moved to Ready status, and the only remaining
concerns with 226 involve wording.
- R23:
Pre-Santa Cruz mailing. Added new issues 367-382.
Moved issues in the TC to TC status.
- R22:
Post-Curaçao mailing. Added new issues 362-366.
- R21:
Pre-Curaçao mailing. Added new issues 351-361.
- R20:
Post-Redmond mailing; reflects actions taken in Redmond. Added
new issues 336-350, of which issues
347-350 were added since Redmond, hence
not discussed at the meeting.
All Ready issues were moved to DR status, with the exception of issues
284, 241, and 267.
Noteworthy issues discussed at Redmond include
120 202, 226, 233,
270, 253, 254, 323.
- R19:
Pre-Redmond mailing. Added new issues
323-335.
- R18:
Post-Copenhagen mailing; reflects actions taken in Copenhagen.
Added new issues 312-317, and discussed
new issues 271-314.
Changed status of issues
103 118 136 153
165 171 183 184
185 186 214 221
234 237 243 248
251 252 256 260
261 262 263 265
268
to DR.
Changed status of issues
49 109 117 182
228 230 232 235
238 241 242 250
259 264 266 267
271 272 273 275
281 284 285 286
288 292 295 297
298 301 303 306
307 308 312
to Ready.
Closed issues
111 277 279 287
289 293 302 313
314
as NAD.
- R17:
Pre-Copenhagen mailing. Converted issues list to XML. Added proposed
resolutions for issues 49, 76, 91, 235, 250, 267.
Added new issues 278-311.
- R16:
post-Toronto mailing; reflects actions taken in Toronto. Added new
issues 265-277. Changed status of issues
3, 8, 9, 19,
26, 31, 61,
63, 86, 108,
112, 114, 115,
122, 127, 129,
134, 137, 142,
144, 146, 147,
159, 164, 170,
181, 199, 208,
209, 210, 211,
212, 217, 220,
222, 223, 224,
227 to "DR". Reopened issue 23. Reopened
issue 187. Changed issues 2 and
4 to NAD. Fixed a typo in issue 17. Fixed
issue 70: signature should be changed both places it
appears. Fixed issue 160: previous version didn't fix
the bug in enough places.
- R15:
pre-Toronto mailing. Added issues
233-264. Some small HTML formatting
changes so that we pass Weblint tests.
- R14:
post-Tokyo II mailing; reflects committee actions taken in
Tokyo. Added issues 228 to 232. (00-0019R1/N1242)
- R13:
pre-Tokyo II updated: Added issues 212 to 227.
- R12:
pre-Tokyo II mailing: Added issues 199 to
211. Added "and paragraph 5" to the proposed resolution
of issue 29. Add further rationale to issue
178.
- R11:
post-Kona mailing: Updated to reflect LWG and full committee actions
in Kona (99-0048/N1224). Note changed resolution of issues
4 and 38. Added issues 196
to 198. Closed issues list split into "defects" and
"closed" documents. Changed the proposed resolution of issue
4 to NAD, and changed the wording of proposed resolution
of issue 38.
- R10:
pre-Kona updated. Added proposed resolutions 83,
86, 91, 92,
109. Added issues 190 to
195. (99-0033/D1209, 14 Oct 99)
- R9:
pre-Kona mailing. Added issues 140 to
189. Issues list split into separate "active" and
"closed" documents. (99-0030/N1206, 25 Aug 99)
- R8:
post-Dublin mailing. Updated to reflect LWG and full committee actions
in Dublin. (99-0016/N1193, 21 Apr 99)
- R7:
pre-Dublin updated: Added issues 130, 131,
132, 133, 134,
135, 136, 137,
138, 139 (31 Mar 99)
- R6:
pre-Dublin mailing. Added issues 127, 128,
and 129. (99-0007/N1194, 22 Feb 99)
- R5:
update issues 103, 112; added issues
114 to 126. Format revisions to prepare
for making list public. (30 Dec 98)
- R4:
post-Santa Cruz II updated: Issues 110,
111, 112, 113 added, several
issues corrected. (22 Oct 98)
- R3:
post-Santa Cruz II: Issues 94 to 109
added, many issues updated to reflect LWG consensus (12 Oct 98)
- R2:
pre-Santa Cruz II: Issues 73 to 93 added,
issue 17 updated. (29 Sep 98)
- R1:
Correction to issue 55 resolution, 60 code
format, 64 title. (17 Sep 98)
Defect Reports
1. C library linkage editing oversight
Section: 17.4.2.2 [using.linkage] Status: TC
Submitter: Beman Dawes Date: 1997-11-16
View all issues with TC status.
Discussion:
The change specified in the proposed resolution below did not make
it into the Standard. This change was accepted in principle at the
London meeting, and the exact wording below was accepted at the
Morristown meeting.
Proposed resolution:
Change 17.4.2.2 [using.linkage] paragraph 2
from:
It is unspecified whether a name from the Standard C library
declared with external linkage has either extern "C" or
extern "C++" linkage.
to:
Whether a name from the Standard C library declared with external
linkage has extern "C" or extern "C++" linkage
is implementation defined. It is recommended that an implementation
use extern "C++" linkage for this purpose.
3. Atexit registration during atexit() call is not described
Section: 18.4 [support.start.term] Status: TC
Submitter: Steve Clamage Date: 1997-12-12
View all issues with TC status.
Discussion:
We appear not to have covered all the possibilities of
exit processing with respect to
atexit registration.
Example 1: (C and C++)
#include <stdlib.h>
void f1() { }
void f2() { atexit(f1); }
int main()
{
atexit(f2); // the only use of f2
return 0; // for C compatibility
}
At program exit, f2 gets called due to its registration in
main. Running f2 causes f1 to be newly registered during the exit
processing. Is this a valid program? If so, what are its
semantics?
Interestingly, neither the C standard, nor the C++ draft standard nor
the forthcoming C9X Committee Draft says directly whether you can
register a function with atexit during exit processing.
All 3 standards say that functions are run in reverse order of their
registration. Since f1 is registered last, it ought to be run first,
but by the time it is registered, it is too late to be first.
If the program is valid, the standards are self-contradictory about
its semantics.
Example 2: (C++ only)
void F() { static T t; } // type T has a destructor
int main()
{
atexit(F); // the only use of F
}
Function F registered with atexit has a local static variable t,
and F is called for the first time during exit processing. A local
static object is initialized the first time control flow passes
through its definition, and all static objects are destroyed during
exit processing. Is the code valid? If so, what are its semantics?
Section 18.3 "Start and termination" says that if a function
F is registered with atexit before a static object t is initialized, F
will not be called until after t's destructor completes.
In example 2, function F is registered with atexit before its local
static object O could possibly be initialized. On that basis, it must
not be called by exit processing until after O's destructor
completes. But the destructor cannot be run until after F is called,
since otherwise the object could not be constructed in the first
place.
If the program is valid, the standard is self-contradictory about
its semantics.
I plan to submit Example 1 as a public comment on the C9X CD, with
a recommendation that the results be undefined. (Alternative: make it
unspecified. I don't think it is worthwhile to specify the case where
f1 itself registers additional functions, each of which registers
still more functions.)
I think we should resolve the situation in the whatever way the C
committee decides.
For Example 2, I recommend we declare the results undefined.
[See reflector message lib-6500 for further discussion.]
Proposed resolution:
Change section 18.3/8 from:
First, objects with static storage duration are destroyed and
functions registered by calling atexit are called. Objects with
static storage duration are destroyed in the reverse order of the
completion of their constructor. (Automatic objects are not
destroyed as a result of calling exit().) Functions registered with
atexit are called in the reverse order of their registration. A
function registered with atexit before an object obj1 of static
storage duration is initialized will not be called until obj1's
destruction has completed. A function registered with atexit after
an object obj2 of static storage duration is initialized will be
called before obj2's destruction starts.
to:
First, objects with static storage duration are destroyed and
functions registered by calling atexit are called. Non-local objects
with static storage duration are destroyed in the reverse order of
the completion of their constructor. (Automatic objects are not
destroyed as a result of calling exit().) Functions registered with
atexit are called in the reverse order of their registration, except
that a function is called after any previously registered functions
that had already been called at the time it was registered. A
function registered with atexit before a non-local object obj1 of
static storage duration is initialized will not be called until
obj1's destruction has completed. A function registered with atexit
after a non-local object obj2 of static storage duration is
initialized will be called before obj2's destruction starts. A local
static object obj3 is destroyed at the same time it would be if a
function calling the obj3 destructor were registered with atexit at
the completion of the obj3 constructor.
Rationale:
See 99-0039/N1215, October 22, 1999, by Stephen D. Clamage for the analysis
supporting to the proposed resolution.
5. String::compare specification questionable
Section: 21.3.6.8 [string::swap] Status: TC
Submitter: Jack Reeves Date: 1997-12-11
View all other issues in [string::swap].
View all issues with TC status.
Duplicate of: 87
Discussion:
At the very end of the basic_string class definition is the signature: int
compare(size_type pos1, size_type n1, const charT* s, size_type n2 = npos) const; In the
following text this is defined as: returns
basic_string<charT,traits,Allocator>(*this,pos1,n1).compare(
basic_string<charT,traits,Allocator>(s,n2);
Since the constructor basic_string(const charT* s, size_type n, const Allocator& a
= Allocator()) clearly requires that s != NULL and n < npos and further states that it
throws length_error if n == npos, it appears the compare() signature above should always
throw length error if invoked like so: str.compare(1, str.size()-1, s); where 's' is some
null terminated character array.
This appears to be a typo since the obvious intent is to allow either the call above or
something like: str.compare(1, str.size()-1, s, strlen(s)-1);
This would imply that what was really intended was two signatures int compare(size_type
pos1, size_type n1, const charT* s) const int compare(size_type pos1, size_type n1, const
charT* s, size_type n2) const; each defined in terms of the corresponding constructor.
Proposed resolution:
Replace the compare signature in 21.3 [basic.string]
(at the very end of the basic_string synopsis) which reads:
int compare(size_type pos1, size_type n1,
const charT* s,
size_type n2 = npos) const;
with:
int compare(size_type pos1, size_type n1,
const charT* s) const;
int compare(size_type pos1, size_type n1,
const charT* s,
size_type n2) const;
Replace the portion of 21.3.6.8 [string::swap]
paragraphs 5 and 6 which read:
int compare(size_type pos, size_type n1,
charT * s, size_type n2
= npos) const;
Returns:
basic_string<charT,traits,Allocator>(*this, pos, n1).compare(
basic_string<charT,traits,Allocator>( s, n2))
with:
int compare(size_type pos, size_type n1,
const charT * s) const;
Returns:
basic_string<charT,traits,Allocator>(*this, pos, n1).compare(
basic_string<charT,traits,Allocator>( s ))
int compare(size_type pos, size_type n1,
const charT * s,
size_type n2) const;
Returns:
basic_string<charT,traits,Allocator>(*this, pos, n1).compare(
basic_string<charT,traits,Allocator>( s, n2))
Editors please note that in addition to splitting the signature, the third argument
becomes const, matching the existing synopsis.
Rationale:
While the LWG dislikes adding signatures, this is a clear defect in
the Standard which must be fixed. The same problem was also
identified in issues 7 (item 5) and 87.
7. String clause minor problems
Section: 21 [strings] Status: TC
Submitter: Matt Austern Date: 1997-12-15
View all other issues in [strings].
View all issues with TC status.
Discussion:
(1) In 21.3.6.4 [string::insert], the description of template
<class InputIterator> insert(iterator, InputIterator,
InputIterator) makes no sense. It refers to a member function that
doesn't exist. It also talks about the return value of a void
function.
(2) Several versions of basic_string::replace don't appear in the
class synopsis.
(3) basic_string::push_back appears in the synopsis, but is never
described elsewhere. In the synopsis its argument is const charT,
which doesn't makes much sense; it should probably be charT, or
possible const charT&.
(4) basic_string::pop_back is missing.
(5) int compare(size_type pos, size_type n1, charT* s, size_type n2
= npos) make no sense. First, it's const charT* in the synopsis and
charT* in the description. Second, given what it says in RETURNS,
leaving out the final argument will always result in an exception
getting thrown. This is paragraphs 5 and 6 of
21.3.6.8 [string::swap]
(6) In table 37, in section 21.1.1 [char.traits.require],
there's a note for X::move(s, p, n). It says "Copies correctly
even where p is in [s, s+n)". This is correct as far as it goes,
but it doesn't go far enough; it should also guarantee that the copy
is correct even where s in in [p, p+n). These are two orthogonal
guarantees, and neither one follows from the other. Both guarantees
are necessary if X::move is supposed to have the same sort of
semantics as memmove (which was clearly the intent), and both
guarantees are necessary if X::move is actually supposed to be
useful.
Proposed resolution:
ITEM 1: In 21.3.5.4 [lib.string::insert], change paragraph 16 to
EFFECTS: Equivalent to insert(p - begin(), basic_string(first, last)).
ITEM 2: Not a defect; the Standard is clear.. There are ten versions of replace() in
the synopsis, and ten versions in 21.3.5.6 [lib.string::replace].
ITEM 3: Change the declaration of push_back in the string synopsis (21.3,
[lib.basic.string]) from:
void push_back(const charT)
to
void push_back(charT)
Add the following text immediately after 21.3.5.2 [lib.string::append], paragraph 10.
void basic_string::push_back(charT c);
EFFECTS: Equivalent to append(static_cast<size_type>(1), c);
ITEM 4: Not a defect. The omission appears to have been deliberate.
ITEM 5: Duplicate; see issue 5 (and 87).
ITEM 6: In table 37, Replace:
"Copies correctly even where p is in [s, s+n)."
with:
"Copies correctly even where the ranges [p, p+n) and [s,
s+n) overlap."
8. Locale::global lacks guarantee
Section: 22.1.1.5 [locale.statics] Status: TC
Submitter: Matt Austern Date: 1997-12-24
View all issues with TC status.
Discussion:
It appears there's an important guarantee missing from clause
22. We're told that invoking locale::global(L) sets the C locale if L
has a name. However, we're not told whether or not invoking
setlocale(s) sets the global C++ locale.
The intent, I think, is that it should not, but I can't find any
such words anywhere.
Proposed resolution:
Add a sentence at the end of 22.1.1.5 [locale.statics],
paragraph 2:
No library function other than locale::global() shall affect
the value returned by locale().
9. Operator new(0) calls should not yield the same pointer
Section: 18.5.1 [new.delete] Status: TC
Submitter: Steve Cla