summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libs/cplusplus/LookupContext.cpp3
-rw-r--r--src/plugins/cpptools/cppcompletion_test.cpp14
2 files changed, 17 insertions, 0 deletions
diff --git a/src/libs/cplusplus/LookupContext.cpp b/src/libs/cplusplus/LookupContext.cpp
index 95001fbc31..dc96c304a5 100644
--- a/src/libs/cplusplus/LookupContext.cpp
+++ b/src/libs/cplusplus/LookupContext.cpp
@@ -1212,6 +1212,9 @@ LookupScopePrivate *LookupScopePrivate::findSpecialization(
}
}
}
+
+ if (specializationTemplateArgument == initializationTemplateArgument)
+ return cit->second;
}
}
}
diff --git a/src/plugins/cpptools/cppcompletion_test.cpp b/src/plugins/cpptools/cppcompletion_test.cpp
index cc98254c76..82a58d4760 100644
--- a/src/plugins/cpptools/cppcompletion_test.cpp
+++ b/src/plugins/cpptools/cppcompletion_test.cpp
@@ -2623,6 +2623,20 @@ void CppToolsPlugin::test_completion_data()
) << _("s.") << (QStringList()
<< QLatin1String("S"));
+ QTest::newRow("partial_specialization") << _(
+ "struct b {};\n"
+ "template<class X, class Y> struct s { float f; };\n"
+ "template<class X> struct s<X, b> { int i; };\n"
+ "\n"
+ "void f()\n"
+ "{\n"
+ " s<int, b> var;\n"
+ " @\n"
+ "}\n"
+ ) << _("var.") << (QStringList()
+ << QLatin1String("i")
+ << QLatin1String("s"));
+
QTest::newRow("auto_declaration_in_if_condition") << _(
"struct Foo { int bar; };\n"
"void fun() {\n"