From 4667528ee8f997ce62d83d916064f12b296bab0d Mon Sep 17 00:00:00 2001 From: Samira Bazuzi Date: Tue, 3 Oct 2023 11:37:10 -0400 Subject: [PATCH] Mark operator== const to avoid ambiguity in C++20. 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. --- lld/COFF/Config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lld/COFF/Config.h b/lld/COFF/Config.h index e66ab3a32c567..ff87eab2744dd 100644 --- a/lld/COFF/Config.h +++ b/lld/COFF/Config.h @@ -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 &&