aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/3rdparty/cplusplus/Name.h
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@me.com>2014-03-24 16:06:39 +0100
committerErik Verbruggen <erik.verbruggen@digia.com>2014-03-27 13:46:55 +0100
commitb0618281ecaa71a99dea7235c3c955b2135cc127 (patch)
tree100f2aee0d2bf17637508b468df150a017f2206e /src/libs/3rdparty/cplusplus/Name.h
parent186570a25999964e338e55eed08e5a0843a74650 (diff)
C++: Do type and name equality checking in a safe manner.
Change the TypeMatcher to also match names, and use two "block" lists in SafeMatcher to prevent infinite recursion. Task-number: QTCREATORBUG-11240 Change-Id: I0367ae795ee6be579b83aeb8d46723c877e4aa75 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Diffstat (limited to 'src/libs/3rdparty/cplusplus/Name.h')
-rw-r--r--src/libs/3rdparty/cplusplus/Name.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/libs/3rdparty/cplusplus/Name.h b/src/libs/3rdparty/cplusplus/Name.h
index 9d19748471..ce6c7b336d 100644
--- a/src/libs/3rdparty/cplusplus/Name.h
+++ b/src/libs/3rdparty/cplusplus/Name.h
@@ -53,7 +53,9 @@ public:
virtual const QualifiedNameId *asQualifiedNameId() const { return 0; }
virtual const SelectorNameId *asSelectorNameId() const { return 0; }
- virtual bool isEqualTo(const Name *other) const = 0;
+ virtual bool isEqualTo(const Name *other) const = 0; // TODO: remove me
+
+ static bool match(const Name *name, const Name *otherName, Matcher *matcher);
void accept(NameVisitor *visitor) const;
static void accept(const Name *name, NameVisitor *visitor);
@@ -65,6 +67,10 @@ public:
protected:
virtual void accept0(NameVisitor *visitor) const = 0;
+
+protected: // for Matcher
+ friend Matcher;
+ virtual bool match0(const Name *otherName, Matcher *matcher) const = 0;
};
} // namespace CPlusPlus