forked from qt-creator/qt-creator
CPlusPlus: Do not try to qualify the names of template parameters
These always appear as written. Task-number: QTCREATORBUG-28186 Change-Id: Iea8cc99ee6c17c1320817977fdb96ae1f730bc45 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -189,6 +189,8 @@ LookupContext &LookupContext::operator=(const LookupContext &other)
|
||||
|
||||
QList<const Name *> LookupContext::fullyQualifiedName(Symbol *symbol, InlineNamespacePolicy policy)
|
||||
{
|
||||
if (symbol->asTypenameArgument())
|
||||
return {symbol->name()};
|
||||
QList<const Name *> qualifiedName = path(symbol->enclosingScope(), policy);
|
||||
addNames(symbol->name(), &qualifiedName, /*add all names*/ true);
|
||||
return qualifiedName;
|
||||
|
@@ -6869,6 +6869,28 @@ void QuickfixTest::testMoveFuncDefOutsideTemplate()
|
||||
QuickFixOperationTest(singleDocument(original, expected), &factory);
|
||||
}
|
||||
|
||||
void QuickfixTest::testMoveFuncDefOutsideMemberFunctionTemplate()
|
||||
{
|
||||
const QByteArray original = R"(
|
||||
struct S {
|
||||
template<typename In>
|
||||
void @foo(In in) { (void)in; }
|
||||
};
|
||||
)";
|
||||
const QByteArray expected = R"(
|
||||
struct S {
|
||||
template<typename In>
|
||||
void foo(In in);
|
||||
};
|
||||
|
||||
template<typename In>
|
||||
void S::foo(In in) { (void)in; }
|
||||
)";
|
||||
|
||||
MoveFuncDefOutside factory;
|
||||
QuickFixOperationTest(singleDocument(original, expected), &factory);
|
||||
}
|
||||
|
||||
void QuickfixTest::testMoveFuncDefOutsideTemplateSpecializedClass()
|
||||
{
|
||||
QByteArray original = R"(
|
||||
|
@@ -169,6 +169,7 @@ private slots:
|
||||
void testMoveFuncDefOutsideRespectWsInOperatorNames2();
|
||||
void testMoveFuncDefOutsideMacroUses();
|
||||
void testMoveFuncDefOutsideTemplate();
|
||||
void testMoveFuncDefOutsideMemberFunctionTemplate();
|
||||
void testMoveFuncDefOutsideTemplateSpecializedClass();
|
||||
void testMoveFuncDefOutsideUnnamedTemplate();
|
||||
void testMoveFuncDefOutsideMemberFuncToCppStatic();
|
||||
|
Reference in New Issue
Block a user