diff --git a/src/libs/cplusplus/LookupContext.cpp b/src/libs/cplusplus/LookupContext.cpp index 95001fbc310..dc96c304a59 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 cc98254c760..82a58d4760f 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 struct s { float f; };\n" + "template struct s { int i; };\n" + "\n" + "void f()\n" + "{\n" + " s 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"