C++: fix typedef resolving

Fix a case:
struct A
{
  int a;
};

typedef A B;
typedef B* Bptr;
Bptr b;
b->

Task-number: QTCREATORBUG-10021
Change-Id: Ibf5ca801dbdb72744416924c0b8fc03daad5948a
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
Przemyslaw Gorszkowski
2014-04-03 12:16:15 +02:00
parent c79413a4bd
commit faca3333b5
2 changed files with 40 additions and 21 deletions

View File

@@ -2355,4 +2355,28 @@ void CppToolsPlugin::test_completion_member_access_operator_data()
<< QLatin1String("S")
<< QLatin1String("m"))
<< true;
QTest::newRow("typedef_of_pointer_of_type_replace_access_operator") << _(
"struct S { int m; };\n"
"typedef struct S SType;\n"
"typedef struct SType *STypePtr;\n"
"STypePtr p;\n"
"@\n"
"}\n"
) << _("p.") << (QStringList()
<< QLatin1String("S")
<< QLatin1String("m"))
<< true;
QTest::newRow("typedef_of_pointer_of_type_no_replace_access_operator") << _(
"struct S { int m; };\n"
"typedef struct S SType;\n"
"typedef struct SType *STypePtr;\n"
"STypePtr p;\n"
"@\n"
"}\n"
) << _("p->") << (QStringList()
<< QLatin1String("S")
<< QLatin1String("m"))
<< false;
}