forked from qt-creator/qt-creator
CppEditor: Use a hidden friend to compare BaseEditorDocumentParser::Configuration
Posh, and avoids an upcoming warning with C++20: /data/dev/creator/src/plugins/clangcodemodel/clangdclient.cpp:907:40: warning: C++20 says that these are ambiguous, even though the second is reversed: In file included from /data/dev/creator/src/plugins/clangcodemodel/clangdclient.h:6, from /data/dev/creator/src/plugins/clangcodemodel/clangdclient.cpp:4: /data/dev/creator/src/plugins/cppeditor/baseeditordocumentparser.h:37:14: note: candidate 1: 'bool CppEditor::BaseEditorDocumentParser::Configuration::operator==(const CppEditor::BaseEditorDocumentParser::Configuration&)' /data/dev/creator/src/plugins/cppeditor/baseeditordocumentparser.h:37:14: note: candidate 2: 'bool CppEditor::BaseEditorDocumentParser::Configuration::operator==(const CppEditor::BaseEditorDocumentParser::Configuration&)' (reversed) /data/dev/creator/src/plugins/cppeditor/baseeditordocumentparser.h:37:14: note: try making the operator a 'const' member function Change-Id: I98ed9d907b673b9353f540bab2ff7239e018b4f2 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -34,11 +34,11 @@ public:
|
||||
QByteArray editorDefines;
|
||||
QString preferredProjectPartId;
|
||||
|
||||
bool operator==(const Configuration &other)
|
||||
friend bool operator==(const Configuration &left, const Configuration &right)
|
||||
{
|
||||
return usePrecompiledHeaders == other.usePrecompiledHeaders
|
||||
&& editorDefines == other.editorDefines
|
||||
&& preferredProjectPartId == other.preferredProjectPartId;
|
||||
return left.usePrecompiledHeaders == right.usePrecompiledHeaders
|
||||
&& left.editorDefines == right.editorDefines
|
||||
&& left.preferredProjectPartId == right.preferredProjectPartId;
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user