[LLD][COFF] Mark operator== const to avoid ambiguity in C++20. (#68119)

C++20 will automatically generate an operator== with reversed operand
order, which is ambiguous with the written operator== when one argument
is marked const and the other isn't.
This commit is contained in:
Samira Bazuzi 2023-10-04 11:39:20 -04:00 committed by GitHub
parent 2848125c6c
commit 8899b713ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -72,7 +72,7 @@ struct Export {
StringRef symbolName;
StringRef exportName; // Name in DLL
bool operator==(const Export &e) {
bool operator==(const Export &e) const {
return (name == e.name && extName == e.extName &&
aliasTarget == e.aliasTarget &&
ordinal == e.ordinal && noname == e.noname &&