forked from qt-creator/qt-creator
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>
This commit is contained in:
committed by
Erik Verbruggen
parent
186570a259
commit
b0618281ec
8
src/libs/3rdparty/cplusplus/Name.h
vendored
8
src/libs/3rdparty/cplusplus/Name.h
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user