mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-10-07 10:54:01 +00:00
[libc] Mark operator== const to avoid ambiguity in C++20. (#68805)
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 operator currently triggers -Wambiguous-reversed-operator at usage site libc/test/UnitTest/PrintfMatcher.cpp:28.
This commit is contained in:
parent
1379a7286e
commit
b5c2fa14ea
@ -53,7 +53,7 @@ struct FormatSection {
|
||||
|
||||
// This operator is only used for testing and should be automatically
|
||||
// optimized out for release builds.
|
||||
bool operator==(const FormatSection &other) {
|
||||
bool operator==(const FormatSection &other) const {
|
||||
if (has_conv != other.has_conv)
|
||||
return false;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user