diff options
author | Przemyslaw Gorszkowski <pgorszkowski@gmail.com> | 2014-07-03 13:53:22 +0200 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@digia.com> | 2014-07-08 09:53:48 +0200 |
commit | 059cfde67737fb1d0d1a4c46ee62a387a07ca0b4 (patch) | |
tree | b82df1e89dc0ea79df821fee94429dae837ae0c3 /src/plugins/cpptools/cppcompletion_test.cpp | |
parent | ce4dc86d58507997d6611f7b4895c9d1cbf7aad0 (diff) | |
download | qt-creator-059cfde67737fb1d0d1a4c46ee62a387a07ca0b4.tar.gz |
C++: template base class and default argument for template class
Fix code completion for case:
struct Foo
{
int bar;
};
template <typename T>
struct Base
{
T t;
};
template <typename T1 = Foo>
struct Derived : Base<T1>
{};
int main()
{
Derived<> foo;
foo.t.// no code completion
return 0;
}
Task-number: QTCREATORBUG-12606
Change-Id: Iadf2fae172739d0a5844c6b437fd2686616e64e7
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Diffstat (limited to 'src/plugins/cpptools/cppcompletion_test.cpp')
-rw-r--r-- | src/plugins/cpptools/cppcompletion_test.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/plugins/cpptools/cppcompletion_test.cpp b/src/plugins/cpptools/cppcompletion_test.cpp index a55968da4a..e50a2a01b2 100644 --- a/src/plugins/cpptools/cppcompletion_test.cpp +++ b/src/plugins/cpptools/cppcompletion_test.cpp @@ -2281,6 +2281,20 @@ void CppToolsPlugin::test_completion_data() << QLatin1String("Derived") << QLatin1String("foo") << QLatin1String("Foo")); + + QTest::newRow("default_arguments_for_class_templates_and_template_base_class_QTCREATORBUG-12606") << _( + "struct Foo { int foo; };\n" + "template <typename T>\n" + "struct Base { T t; };\n" + "template <typename T = Foo>\n" + "struct Derived : Base<T> {};\n" + "void fun() {\n" + " Derived<> derived;\n" + " @\n" + "}\n" + ) << _("derived.t.") << (QStringList() + << QLatin1String("foo") + << QLatin1String("Foo")); } void CppToolsPlugin::test_completion_member_access_operator() |