summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppcompletion_test.cpp
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2015-06-28 22:28:44 +0300
committerOrgad Shaneh <orgads@gmail.com>2015-06-29 09:09:16 +0000
commitf8544bbc42e8afcdc6202905225fcbb20e42252f (patch)
treeb83b749c61e3b26c22d536c4e472178fa6e984ed /src/plugins/cpptools/cppcompletion_test.cpp
parent1faf2bd1ef5f3928e0db3e92e240d8c9378c77fa (diff)
downloadqt-creator-f8544bbc42e8afcdc6202905225fcbb20e42252f.tar.gz
C++: Resolve function-scope typedef inside lambda
Use-case: struct Foo { int bar; }; void func() { typedef Foo F; []() { F f; f.bar; // bar not highlighted }; } Change-Id: Ifaee2d125931d993acad69f03031a675c6180858 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.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/plugins/cpptools/cppcompletion_test.cpp b/src/plugins/cpptools/cppcompletion_test.cpp
index c743e0ed7d..2bbeb4f294 100644
--- a/src/plugins/cpptools/cppcompletion_test.cpp
+++ b/src/plugins/cpptools/cppcompletion_test.cpp
@@ -2547,6 +2547,21 @@ void CppToolsPlugin::test_completion_data()
) << _("ar") << (QStringList()
<< QLatin1String("arg1"));
+ QTest::newRow("local_typedef_access_in_lambda") << _(
+ "struct Foo { int bar; };\n"
+ "\n"
+ "void func()\n"
+ "{\n"
+ " typedef Foo F;\n"
+ " []() {\n"
+ " F f;\n"
+ " @\n"
+ " };\n"
+ "}\n"
+ ) << _("f.") << (QStringList()
+ << QLatin1String("Foo")
+ << QLatin1String("bar"));
+
QTest::newRow("default_arguments_for_class_templates_and_base_class_QTCREATORBUG-12605") << _(
"struct Foo { int foo; };\n"
"template <typename T = Foo>\n"