[Bug libstdc++/104874] New: Non-compile test in string_vector_iterators.cc test fails for the wrong reason.
brooks at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Mar 10 22:49:56 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104874
Bug ID: 104874
Summary: Non-compile test in string_vector_iterators.cc test
fails for the wrong reason.
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: brooks at gcc dot gnu.org
Target Milestone: ---
The testsuite/24_iterators/random_access/string_vector_iterators.cc test
contains the following code blob, in every version since the test originated
with the initial libstdc++ checkin in April 2000, through to current HEAD:
569 #ifdef ITER24_F8
570 std::vector<const int> v(1);
571 std::vector<const int>::reference r(v.begin()[0]);
572 r = 1; // cannot assign through reference to
const
573 failures++;
574 #endif
This code actually fails to compile on the first line because the template
parameter of a std::container object cannot be const.
This indicates a stronger problem with these non-compile tests, which is that
they're not actually testing what we think they're testing. (As far as I can
tell, they're not checked at all, and so should either be deleted or replaced
with proper dejagnu non-compile tests.)
More information about the Gcc-bugs
mailing list