diff options
author | Nikolai Kosjar <nikolai.kosjar@theqtcompany.com> | 2015-11-19 13:49:26 +0100 |
---|---|---|
committer | Nikolai Kosjar <nikolai.kosjar@theqtcompany.com> | 2015-11-19 14:48:38 +0000 |
commit | 0498fb68ff76adc39c8744ff354d5dcc5ab94da8 (patch) | |
tree | bc0c26904e3cc144d879e4d522c1ce2bf1bbca7b /src/plugins/cppeditor/cppquickfixes.cpp | |
parent | c2a2883c4a982e52947e73ca97ba646fda54e6e2 (diff) | |
download | qt-creator-0498fb68ff76adc39c8744ff354d5dcc5ab94da8.tar.gz |
C++: Revert lookup to 3.4.2
...which was least buggy.
The bugs fixed by the changes we revert here (highlighting/completion
for code involving templates) were minor compared to ones we currently
have. Those bugs will be addressed by the clang code model anyway.
Relevant commits were collected via:
$ cd ${QTC}/src/libs/cplusplus
$ git log \
--no-merges \
--format=oneline \
v3.4.2..HEAD \
-- LookupContext.* ResolveExpression.* TypeResolver.* TypeOfExpression.* \
../../plugins/cpptools/cppcompletion_test.cpp
From this list the following were skipped due to irrelevance:
88c5b47e535d91f3db99882d5b50b263b46f223c # CppTools: Minor cleanup in completion tests
e5255a1f5cac284c4f0d4a85203878c84da86e85 # CppTools: Add a test for ObjC not replacing dot with arrow
5b12c8d63a30e281274cdc267efabead2c736bd8 # CppTools: Support ObjC in member access operator tests
9fef4fb9ca4e65e20ff13b98bcf15e3c6232fdfb # CPlusPlus: Fix warnings about overriding visit(...) methods
There were only minor conflicts while reverting those.
This changes touches so many files because there were quite some
cleanups and renames after the 3.4.2 release.
Task-number: QTCREATORBUG-14889
Task-number: QTCREATORBUG-15211
Task-number: QTCREATORBUG-15213
Task-number: QTCREATORBUG-15257
Task-number: QTCREATORBUG-15264
Task-number: QTCREATORBUG-15291
Task-number: QTCREATORBUG-15329
Change-Id: I01f759f8f35ecb4228928a4f22086e279c1a5435
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
Diffstat (limited to 'src/plugins/cppeditor/cppquickfixes.cpp')
-rw-r--r-- | src/plugins/cppeditor/cppquickfixes.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/plugins/cppeditor/cppquickfixes.cpp b/src/plugins/cppeditor/cppquickfixes.cpp index 176afcb7f9..9ef84adad2 100644 --- a/src/plugins/cppeditor/cppquickfixes.cpp +++ b/src/plugins/cppeditor/cppquickfixes.cpp @@ -219,7 +219,7 @@ Class *isMemberFunction(const LookupContext &context, Function *function) if (!q->base()) return 0; - if (LookupScope *binding = context.lookupType(q->base(), enclosingScope)) { + if (ClassOrNamespace *binding = context.lookupType(q->base(), enclosingScope)) { foreach (Symbol *s, binding->symbols()) { if (Class *matchingClass = s->asClass()) return matchingClass; @@ -257,7 +257,7 @@ Namespace *isNamespaceFunction(const LookupContext &context, Function *function) if (!q->base()) return 0; - if (LookupScope *binding = context.lookupType(q->base(), enclosingScope)) { + if (ClassOrNamespace *binding = context.lookupType(q->base(), enclosingScope)) { foreach (Symbol *s, binding->symbols()) { if (Namespace *matchingNamespace = s->asNamespace()) return matchingNamespace; @@ -1331,7 +1331,7 @@ void TranslateStringLiteral::match(const CppQuickFixInterface &interface, for (int i = path.size() - 1; i >= 0; --i) { if (FunctionDefinitionAST *definition = path.at(i)->asFunctionDefinition()) { Function *function = definition->symbol; - LookupScope *b = interface.context().lookupType(function); + ClassOrNamespace *b = interface.context().lookupType(function); if (b) { // Do we have a tr function? foreach (const LookupItem &r, b->find(trName)) { @@ -1592,7 +1592,7 @@ public: SubstitutionEnvironment env; env.setContext(context()); env.switchScope(result.first().scope()); - LookupScope *con = typeOfExpression.context().lookupType(scope); + ClassOrNamespace *con = typeOfExpression.context().lookupType(scope); if (!con) con = typeOfExpression.context().globalNamespace(); UseMinimalNames q(con); @@ -2284,7 +2284,7 @@ Enum *findEnum(const QList<LookupItem> &results, const LookupContext &ctxt) if (Enum *e = type->asEnumType()) return e; if (const NamedType *namedType = type->asNamedType()) { - if (LookupScope *con = ctxt.lookupType(namedType->name(), result.scope())) { + if (ClassOrNamespace *con = ctxt.lookupType(namedType->name(), result.scope())) { const QList<Enum *> enums = con->unscopedEnums(); const Name *referenceName = namedType->name(); if (const QualifiedNameId *qualifiedName = referenceName->asQualifiedNameId()) @@ -2581,7 +2581,7 @@ public: Document::Ptr targetDoc = targetFile->cppDocument(); Scope *targetScope = targetDoc->scopeAt(m_loc.line(), m_loc.column()); LookupContext targetContext(targetDoc, snapshot()); - LookupScope *targetCoN = targetContext.lookupType(targetScope); + ClassOrNamespace *targetCoN = targetContext.lookupType(targetScope); if (!targetCoN) targetCoN = targetContext.globalNamespace(); @@ -3215,7 +3215,7 @@ public: SubstitutionEnvironment env; env.setContext(context()); env.switchScope(refFunc); - LookupScope *targetCoN = context().lookupType(refFunc->enclosingScope()); + ClassOrNamespace *targetCoN = context().lookupType(refFunc->enclosingScope()); if (!targetCoN) targetCoN = context().globalNamespace(); UseMinimalNames subs(targetCoN); @@ -4644,7 +4644,7 @@ QString definitionSignature(const CppQuickFixInterface *assist, QTC_ASSERT(func, return QString()); LookupContext cppContext(targetFile->cppDocument(), assist->snapshot()); - LookupScope *cppCoN = cppContext.lookupType(scope); + ClassOrNamespace *cppCoN = cppContext.lookupType(scope); if (!cppCoN) cppCoN = cppContext.globalNamespace(); SubstitutionEnvironment env; @@ -5125,7 +5125,7 @@ public: SubstitutionEnvironment env; env.setContext(context()); env.switchScope(result.first().scope()); - LookupScope *con = typeOfExpression.context().lookupType(scope); + ClassOrNamespace *con = typeOfExpression.context().lookupType(scope); if (!con) con = typeOfExpression.context().globalNamespace(); UseMinimalNames q(con); @@ -5724,7 +5724,7 @@ PointerType *determineConvertedType(NamedType *namedType, const LookupContext &c { if (!namedType) return 0; - if (LookupScope *binding = context.lookupType(namedType->name(), scope)) { + if (ClassOrNamespace *binding = context.lookupType(namedType->name(), scope)) { if (Symbol *objectClassSymbol = skipForwardDeclarations(binding->symbols())) { if (Class *klass = objectClassSymbol->asClass()) { for (auto it = klass->memberBegin(), end = klass->memberEnd(); it != end; ++it) { @@ -5782,7 +5782,7 @@ Class *senderOrReceiverClass(const CppQuickFixInterface &interface, NamedType *objectType = objectTypeBase->asNamedType(); QTC_ASSERT(objectType, return 0); - LookupScope *objectClassCON = context.lookupType(objectType->name(), objectPointerScope); + ClassOrNamespace *objectClassCON = context.lookupType(objectType->name(), objectPointerScope); QTC_ASSERT(objectClassCON, return 0); QTC_ASSERT(!objectClassCON->symbols().isEmpty(), return 0); @@ -5834,7 +5834,7 @@ bool findConnectReplacement(const CppQuickFixInterface &interface, // Minimize qualification Control *control = context.bindings()->control().data(); - LookupScope *functionCON = context.lookupParent(scope); + ClassOrNamespace *functionCON = context.lookupParent(scope); const Name *shortName = LookupContext::minimalName(method, functionCON, control); if (!shortName->asQualifiedNameId()) shortName = control->qualifiedNameId(classOfMethod->name(), shortName); |