https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104559

            Bug ID: 104559
           Summary: vector<bool> v; v.insert(v.begin()); compiles, but it
                    shouldn't
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: arthur.j.odwyer at gmail dot com
  Target Milestone: ---

// https://godbolt.org/z/3efs3aY67
#include <vector>
int main() {
    std::vector<bool> v;
    v.insert(v.begin());  // libstdc++ accepts!
}

Somehow libstdc++ believes that `vector<bool>::insert(_Bit_const_reference)`
should work. (I bet it inserts "false" at the given position, but I haven't
checked.)

Reply via email to