aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/cpptools/cppcompletion_test.cpp
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2015-05-18 23:19:32 +0300
committerOrgad Shaneh <orgads@gmail.com>2015-05-20 10:45:31 +0000
commitde68ac54073cc3389abcc4cdaa0131bca7a44874 (patch)
treeb47119b05b81694b142188b7164d8492ff092e85 /src/plugins/cpptools/cppcompletion_test.cpp
parent57e3714db45920287118dddb9bc5d9df691110ec (diff)
C++: fix code completion for decltyped type
example: struct Foo { int bar; }; Foo foo() { return Foo; } typedef decltype(foo()) TypedefedFooWithDecltype; void fun() { decltype(foo()) decltypeFoo; decltypeFoo.;// code completion should work here TypedefedFooWithDecltype typedefedFooWithDecltype; typedefedFooWithDecltype.;// code completion should work here } Started-by: Przemyslaw Gorszkowski <pgorszkowski@gmail.com> Task-number: QTCREATORBUG-14483 Change-Id: I296ceed9d896c68cf0651265afb08a1fc42f9a68 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
Diffstat (limited to 'src/plugins/cpptools/cppcompletion_test.cpp')
-rw-r--r--src/plugins/cpptools/cppcompletion_test.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/plugins/cpptools/cppcompletion_test.cpp b/src/plugins/cpptools/cppcompletion_test.cpp
index 8554ec391f..f8daef6d71 100644
--- a/src/plugins/cpptools/cppcompletion_test.cpp
+++ b/src/plugins/cpptools/cppcompletion_test.cpp
@@ -2940,6 +2940,29 @@ void CppToolsPlugin::test_completion_data()
) << _("p.") << (QStringList()
<< QLatin1String("Nested2")
<< QLatin1String("bar"));
+
+ QTest::newRow("simple_decltype_declaration") << _(
+ "struct Foo { int bar; };\n"
+ "Foo foo;\n"
+ "void fun() {\n"
+ " decltype(foo) s;\n"
+ " @\n"
+ "}\n"
+ ) << _("s.") << (QStringList()
+ << QLatin1String("Foo")
+ << QLatin1String("bar"));
+
+ QTest::newRow("typedefed_decltype_declaration") << _(
+ "struct Foo { int bar; };\n"
+ "Foo foo;\n"
+ "typedef decltype(foo) TypedefedFooWithDecltype;\n"
+ "void fun() {\n"
+ " TypedefedFooWithDecltype s;\n"
+ " @\n"
+ "}\n"
+ ) << _("s.") << (QStringList()
+ << QLatin1String("Foo")
+ << QLatin1String("bar"));
}
void CppToolsPlugin::test_completion_member_access_operator()