diff options
Diffstat (limited to 'src/plugins/cpptools/cppcompletion_test.cpp')
-rw-r--r-- | src/plugins/cpptools/cppcompletion_test.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/plugins/cpptools/cppcompletion_test.cpp b/src/plugins/cpptools/cppcompletion_test.cpp index a49b1cd3d8..19d262ae69 100644 --- a/src/plugins/cpptools/cppcompletion_test.cpp +++ b/src/plugins/cpptools/cppcompletion_test.cpp @@ -2353,6 +2353,45 @@ void CppToolsPlugin::test_completion_data() ) << _("arr[0]->") << (QStringList() << QLatin1String("foo") << QLatin1String("Foo")); + + QTest::newRow("template_specialization_with_array1") << _( + "template <typename T>\n" + "struct S {};\n" + "template <typename T>\n" + "struct S<T[]> { int foo; };\n" + "void fun() {\n" + " S<int[]> s;\n" + " @\n" + "}\n" + ) << _("s.") << (QStringList() + << QLatin1String("foo") + << QLatin1String("S")); + + QTest::newRow("template_specialization_with_array2") << _( + "template <typename T>\n" + "struct S {};\n" + "template <typename T, size_t N>\n" + "struct S<T[N]> { int foo; };\n" + "void fun() {\n" + " S<int[3]> s;\n" + " @\n" + "}\n" + ) << _("s.") << (QStringList() + << QLatin1String("foo") + << QLatin1String("S")); + + QTest::newRow("template_specialization_with_array3") << _( + "struct Bar {};\n" + "template <typename T>\n" + "struct S {};\n" + "template <>\n" + "struct S<Bar[]> { int foo; };\n" + "void fun() {\n" + " S<int[]> s;\n" + " @\n" + "}\n" + ) << _("s.") << (QStringList() + << QLatin1String("S")); } void CppToolsPlugin::test_completion_member_access_operator() |