managarm / frigg

Lightweight C++ utilities and algorithms for system programming
MIT License
56 stars 20 forks source link

string: Remove operator!= for basic_string_view and basic_string #61

Closed Dennisbonke closed 1 year ago

Dennisbonke commented 1 year ago

This change was needed for LLVM 16 to agree on our codebase. Tested by booting Managarm.

qookei commented 1 year ago

The following compiles since C++20, so this should not be necessary:

struct foo {};
struct bar {
    bool operator==(foo) const { return true; }
};

int main () {
    foo{} == bar{};
    bar{} == foo{};
}
Dennisbonke commented 1 year ago

Sure, but LLVM 16 is disagreeing here. It could well be an LLVM bug, but I'd rather not wait on that.

qookei commented 1 year ago

https://godbolt.org/z/xj96exaET

Dennisbonke commented 1 year ago

godbolt.org/z/xj96exaET

https://managarm.is-serious.business/eToTT8W.txt disagrees

Andy-Python-Programmer commented 1 year ago

Was was this the case? Was it an LLVM bug?

ArsenArsen commented 1 year ago

I'm not sure what you mean. the fail that this caused was correct with the standard (previously underspecified IIUC, turned into a fail by the aforementioned paper)