Fix lvalue references and rvalue reference incorrectly matching

Adds the comparison of isRvalueReference to make sure they get
difference entries.

Change-Id: I294205786f3d1322e542d3b308d61ab44647ecc9
Fixes: QTCREATORBUG-13839
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
Allan Sandfeld Jensen
2018-11-28 14:48:06 +01:00
parent 9fe8c46d15
commit 51bc18e6d5

View File

@@ -74,7 +74,11 @@ template <> struct Compare<ReferenceType>
{
bool operator()(const ReferenceType &ty, const ReferenceType &otherTy) const
{
return ty.elementType() < otherTy.elementType();
if (ty.elementType() < otherTy.elementType())
return true;
if (ty.elementType() == otherTy.elementType())
return (int)ty.isRvalueReference() < (int)otherTy.isRvalueReference();
return false;
}
};