Skip to content

Commit 8899b71

Browse files
authored
[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.
1 parent 2848125 commit 8899b71

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lld/COFF/Config.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ struct Export {
7272
StringRef symbolName;
7373
StringRef exportName; // Name in DLL
7474

75-
bool operator==(const Export &e) {
75+
bool operator==(const Export &e) const {
7676
return (name == e.name && extName == e.extName &&
7777
aliasTarget == e.aliasTarget &&
7878
ordinal == e.ordinal && noname == e.noname &&

0 commit comments

Comments
 (0)