summaryrefslogtreecommitdiff
path: root/src/libs/cplusplus/LookupContext.h
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/cplusplus/LookupContext.h
parentcc69195c6f4ee00475c5659fc3ff8a492224ced0 (diff)
downloadqt-creator-ba75725a7a6855538a1a5516786440e5ab189f93.tar.gz
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/cplusplus/LookupContext.h')
-rw-r--r--src/libs/cplusplus/LookupContext.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/libs/cplusplus/LookupContext.h b/src/libs/cplusplus/LookupContext.h
index 41b5ee9999..c7b556de43 100644
--- a/src/libs/cplusplus/LookupContext.h
+++ b/src/libs/cplusplus/LookupContext.h
@@ -119,12 +119,7 @@ private:
ClassOrNamespace *nestedType(const Name *name, ClassOrNamespace *origin);
private:
- struct CompareName: std::binary_function<const Name *, const Name *, bool> {
- bool operator()(const Name *name, const Name *other) const;
- };
-
-private:
- typedef std::map<const Name *, ClassOrNamespace *, CompareName> Table;
+ typedef std::map<const Name *, ClassOrNamespace *, Name::Compare> Table;
CreateBindings *_factory;
ClassOrNamespace *_parent;
QList<Symbol *> _symbols;
@@ -163,6 +158,11 @@ public:
/// \internal
QSharedPointer<Control> control() const;
+ bool expandTemplates() const
+ { return _expandTemplates; }
+ void setExpandTemplates(bool expandTemplates)
+ { _expandTemplates = expandTemplates; }
+
/// Searches in \a scope for symbols with the given \a name.
/// Store the result in \a results.
/// \internal
@@ -223,6 +223,7 @@ private:
QList<ClassOrNamespace *> _entities;
ClassOrNamespace *_globalNamespace;
ClassOrNamespace *_currentClassOrNamespace;
+ bool _expandTemplates;
};
class CPLUSPLUS_EXPORT LookupContext
@@ -265,6 +266,9 @@ public:
static const Name *minimalName(Symbol *symbol, ClassOrNamespace *target, Control *control);
+ void setExpandTemplates(bool expandTemplates)
+ { m_expandTemplates = expandTemplates; }
+
private:
// The current expression.
Document::Ptr _expressionDocument;
@@ -279,6 +283,8 @@ private:
mutable QSharedPointer<CreateBindings> _bindings;
QSharedPointer<Control> _control;
+
+ bool m_expandTemplates;
};
bool CPLUSPLUS_EXPORT compareName(const Name *name, const Name *other);