diff options
author | Filipp <ozinov@quantion.ru> | 2014-08-18 15:53:59 +0400 |
---|---|---|
committer | Nikolai Kosjar <nikolai.kosjar@digia.com> | 2014-08-20 10:26:11 +0200 |
commit | 077bbf6803d4f3d81622720c9452a7e1a00c81fb (patch) | |
tree | b9a50f1a2333501347dbe2aca127707c712c396b /src/plugins/cpptools/cppcompletion_test.cpp | |
parent | fa4e839bbe9667bec913bf15175237549a5fa55b (diff) | |
download | qt-creator-077bbf6803d4f3d81622720c9452a7e1a00c81fb.tar.gz |
search for partial specialization for arrays
A<int[]> now prefer second specialization for
template<typename T> class A
template<typename T> class A<[]>
Change-Id: I32e874f78b2f5b363d088fbab6a8897e42e44035
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
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() |