Skip to content

libc++: reverse_iterator operator== won't compile. #64971

@huihzhang

Description

@huihzhang

Failure triggered by https://reviews.llvm.org/D149543

Reduced test case

#include <vector>

std::vector<bool> vec(3, true);

#define RI  std::reverse_iterator<std::vector<bool>::iterator>
class D : public RI {
public:
        RI::iterator_type getCurrent() { return current; }
        D(bool a=true) {
                if (a)
                    current = vec.begin();
                else
                    current = vec.end();
        }
};

int test() {
    D x(true);
    D y(false);
    return std::operator==<std::vector<bool>::iterator>(x, y);
}

Compiler explorer: https://godbolt.org/z/ahM1PnTYr

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalidResolved as invalid, i.e. not a buglibc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions