forked from qt-creator/qt-creator
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>
This commit is contained in:
committed by
Orgad Shaneh
parent
57e3714db4
commit
de68ac5407
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user