diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-11-28 14:48:06 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-11-29 11:34:25 +0000 |
commit | 51bc18e6d5f44268c86d3b18559cebedae67722b (patch) | |
tree | 405fdae1b4396f63e6e508d8de5228924c33ee08 | |
parent | 9fe8c46d15c9685a744df0f32feb3459a37ee623 (diff) | |
download | qt-creator-51bc18e6d5f44268c86d3b18559cebedae67722b.tar.gz |
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>
-rw-r--r-- | src/libs/3rdparty/cplusplus/Control.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libs/3rdparty/cplusplus/Control.cpp b/src/libs/3rdparty/cplusplus/Control.cpp index afdd679056..a5601bf620 100644 --- a/src/libs/3rdparty/cplusplus/Control.cpp +++ b/src/libs/3rdparty/cplusplus/Control.cpp @@ -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; } }; |