Skip to content

Commit c7e52ca

Browse files
committed
[C++20] Make operator== const.
C++20 considers calls to `operator==` ambiguous with calls that have the arguments reversed if the argument is const but `this` is not.
1 parent 484fc77 commit c7e52ca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/IRGen/IRGenDebugInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo {
128128
uint16_t Column = 0;
129129
llvm::DIFile *File = nullptr;
130130
StringRef getFilename() const { return File ? File->getFilename() : ""; }
131-
bool operator==(const FileAndLocation &other) {
131+
bool operator==(const FileAndLocation &other) const {
132132
return Line == other.Line && Column == other.Column && File == other.File;
133133
}
134134
};

0 commit comments

Comments
 (0)