* [Bug libstdc++/104559] vector<bool> v; v.insert(v.begin()); compiles, but it shouldn't
2022-02-15 22:31 [Bug libstdc++/104559] New: vector<bool> v; v.insert(v.begin()); compiles, but it shouldn't arthur.j.odwyer at gmail dot com
@ 2022-02-15 22:50 ` pinskia at gcc dot gnu.org
2022-02-16 9:32 ` redi at gcc dot gnu.org
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-02-15 22:50 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104559
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
>From include/bits/stl_bvector.h"
iterator
#if __cplusplus >= 201103L
insert(const_iterator __position, const bool& __x = bool())
#else
insert(iterator __position, const bool& __x = bool())
#endif
Looks like it has been there since std::vector<bool> was added back in
1999/2000 or so.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug libstdc++/104559] vector<bool> v; v.insert(v.begin()); compiles, but it shouldn't
2022-02-15 22:31 [Bug libstdc++/104559] New: vector<bool> v; v.insert(v.begin()); compiles, but it shouldn't arthur.j.odwyer at gmail dot com
2022-02-15 22:50 ` [Bug libstdc++/104559] " pinskia at gcc dot gnu.org
@ 2022-02-16 9:32 ` redi at gcc dot gnu.org
2022-02-16 10:01 ` de34 at live dot cn
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2022-02-16 9:32 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104559
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
Status|UNCONFIRMED |NEW
Last reconfirmed| |2022-02-16
Keywords| |accepts-invalid
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Arthur O'Dwyer from comment #0)
> Somehow libstdc++ believes that `vector<bool>::insert(_Bit_const_reference)`
> should work.
?
That's not what your example does.
I'll try to do some archaeology for the default argument tomorrow and see why
we have it.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug libstdc++/104559] vector<bool> v; v.insert(v.begin()); compiles, but it shouldn't
2022-02-15 22:31 [Bug libstdc++/104559] New: vector<bool> v; v.insert(v.begin()); compiles, but it shouldn't arthur.j.odwyer at gmail dot com
2022-02-15 22:50 ` [Bug libstdc++/104559] " pinskia at gcc dot gnu.org
2022-02-16 9:32 ` redi at gcc dot gnu.org
@ 2022-02-16 10:01 ` de34 at live dot cn
2022-02-17 10:48 ` redi at gcc dot gnu.org
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: de34 at live dot cn @ 2022-02-16 10:01 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104559
Jiang An <de34 at live dot cn> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |de34 at live dot cn
--- Comment #3 from Jiang An <de34 at live dot cn> ---
The default argument has been present in a very early (perhaps the first)
version of libstdc++.
https://github.com/gcc-mirror/gcc/blob/6599da043e22e96ac830fb50a61c1b6d95d1b142/libstdc%2B%2B/stl/bvector.h#L472
AFIAK this default argument has never been a part of the C++ standard, but was
in in some prehistoric working drafts. Seems removed by WG21-N1051.
http://www.open-std.org/JTC1/SC22/WG21/docs/wp/html/cd2/lib-containers.html#lib.vector.bool
http://www.open-std.org/JTC1/SC22/WG21/docs/papers/1997/N1051.asc
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug libstdc++/104559] vector<bool> v; v.insert(v.begin()); compiles, but it shouldn't
2022-02-15 22:31 [Bug libstdc++/104559] New: vector<bool> v; v.insert(v.begin()); compiles, but it shouldn't arthur.j.odwyer at gmail dot com
` (2 preceding siblings ...)
2022-02-16 10:01 ` de34 at live dot cn
@ 2022-02-17 10:48 ` redi at gcc dot gnu.org
2022-02-17 23:45 ` cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2022-02-17 10:48 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104559
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Yep, that's why we have it, thanks. But it should have been excised years ago.
I'll deprecate it, and kill it some time after GCC 12.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug libstdc++/104559] vector<bool> v; v.insert(v.begin()); compiles, but it shouldn't
2022-02-15 22:31 [Bug libstdc++/104559] New: vector<bool> v; v.insert(v.begin()); compiles, but it shouldn't arthur.j.odwyer at gmail dot com
` (3 preceding siblings ...)
2022-02-17 10:48 ` redi at gcc dot gnu.org
@ 2022-02-17 23:45 ` cvs-commit at gcc dot gnu.org
2022-02-17 23:46 ` redi at gcc dot gnu.org
2022-02-17 23:46 ` redi at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-02-17 23:45 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104559
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:
https://gcc.gnu.org/g:12a88e6e208fa45a449775bfb9353c777a6081aa
commit r12-7289-g12a88e6e208fa45a449775bfb9353c777a6081aa
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Thu Feb 17 17:37:42 2022 +0000
libstdc++: Deprecate non-standard std::vector<bool>::insert(pos) [PR104559]
The SGI STL and pre-1998 drafts of the C++ standard had a default
argument for vector<bool>::insert(iterator, const bool&) which was
remove by N1051. The default argument is still present in libstdc++ for
some reason. There are no tests verifying it as an extension, so I don't
think it has been kept intentionally.
This removes the default argument but adds an overload without the
second parameter, and adds the deprecated attribute to it. This allows
any code using it to keep working (for now) but with a warning.
libstdc++-v3/ChangeLog:
PR libstdc++/104559
* doc/xml/manual/evolution.xml: Document deprecation.
* doc/html/manual/api.html: Regenerate.
* include/bits/stl_bvector.h (insert(const_iterator, const bool&)):
Remove default argument.
(insert(const_iterator)): New overload with deprecated attribute.
* testsuite/23_containers/vector/bool/modifiers/insert/104559.cc:
New test.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug libstdc++/104559] vector<bool> v; v.insert(v.begin()); compiles, but it shouldn't
2022-02-15 22:31 [Bug libstdc++/104559] New: vector<bool> v; v.insert(v.begin()); compiles, but it shouldn't arthur.j.odwyer at gmail dot com
` (4 preceding siblings ...)
2022-02-17 23:45 ` cvs-commit at gcc dot gnu.org
@ 2022-02-17 23:46 ` redi at gcc dot gnu.org
2022-02-17 23:46 ` redi at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2022-02-17 23:46 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104559
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug libstdc++/104559] vector<bool> v; v.insert(v.begin()); compiles, but it shouldn't
2022-02-15 22:31 [Bug libstdc++/104559] New: vector<bool> v; v.insert(v.begin()); compiles, but it shouldn't arthur.j.odwyer at gmail dot com
` (5 preceding siblings ...)
2022-02-17 23:46 ` redi at gcc dot gnu.org
@ 2022-02-17 23:46 ` redi at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2022-02-17 23:46 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104559
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |12.0
^ permalink raw reply [flat|nested] 8+ messages in thread