aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/3rdparty/cplusplus/Name.cpp
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@digia.com>2012-10-08 13:23:21 +0200
committerErik Verbruggen <erik.verbruggen@digia.com>2012-10-11 16:13:32 +0200
commitba75725a7a6855538a1a5516786440e5ab189f93 (patch)
tree513e654894d0f7be4444a37ea57b93d12e37e2cd /src/libs/3rdparty/cplusplus/Name.cpp
parentcc69195c6f4ee00475c5659fc3ff8a492224ced0 (diff)
C++: fix member rewriting when doing template instantiation.
Task-number: QTCREATORBUG-7964 Change-Id: Icc7d87bb4f2d1ab0560a6c06187d9c23da9fe3e9 Reviewed-by: David Schulz <david.schulz@digia.com>
Diffstat (limited to 'src/libs/3rdparty/cplusplus/Name.cpp')
-rw-r--r--src/libs/3rdparty/cplusplus/Name.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/libs/3rdparty/cplusplus/Name.cpp b/src/libs/3rdparty/cplusplus/Name.cpp
index 6c1240b279..8fec45f5c0 100644
--- a/src/libs/3rdparty/cplusplus/Name.cpp
+++ b/src/libs/3rdparty/cplusplus/Name.cpp
@@ -18,10 +18,13 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
+#include "Literals.h"
#include "Name.h"
#include "Names.h"
#include "NameVisitor.h"
+#include <cstring>
+
using namespace CPlusPlus;
Name::Name()
@@ -65,4 +68,16 @@ void Name::accept(const Name *name, NameVisitor *visitor)
name->accept(visitor);
}
+bool Name::Compare::operator()(const Name *name, const Name *other) const
+{
+ if (name == 0)
+ return other != 0;
+ if (other == 0)
+ return false;
+ if (name == other)
+ return false;
+ const Identifier *id = name->identifier();
+ const Identifier *otherId = other->identifier();
+ return std::strcmp(id->chars(), otherId->chars()) < 0;
+}