summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppcompletion_test.cpp
diff options
context:
space:
mode:
authorPrzemyslaw Gorszkowski <pgorszkowski@gmail.com>2014-03-14 11:39:11 +0100
committerNikolai Kosjar <nikolai.kosjar@digia.com>2014-03-25 15:52:39 +0100
commite3f59773113181e3f4ec0c3fd8caf5e7dd210ed7 (patch)
treeeb626ae908c69a4d50bd47849cff1f9ba68a21b1 /src/plugins/cpptools/cppcompletion_test.cpp
parent46c083c2eb556463a4b2c8c45faa379aea229b40 (diff)
downloadqt-creator-e3f59773113181e3f4ec0c3fd8caf5e7dd210ed7.tar.gz
C++: nested class in function
Case when nested class declaration contains object name for this class. Example: void fun() { struct S { int i; } s; s.i; } Fixes: * highlighting * completion * tests Task-number: QTCREATORBUG-11710 Change-Id: I32e234f57655c388a87a199edc8be750d7bf823f Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Przemyslaw Gorszkowski <pgorszkowski@gmail.com> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Diffstat (limited to 'src/plugins/cpptools/cppcompletion_test.cpp')
-rw-r--r--src/plugins/cpptools/cppcompletion_test.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/plugins/cpptools/cppcompletion_test.cpp b/src/plugins/cpptools/cppcompletion_test.cpp
index 742e0a99ee..bf8fb0f772 100644
--- a/src/plugins/cpptools/cppcompletion_test.cpp
+++ b/src/plugins/cpptools/cppcompletion_test.cpp
@@ -1441,6 +1441,19 @@ void CppToolsPlugin::test_completion_data()
<< QLatin1String("A")
<< QLatin1String("a"));
+ QTest::newRow("nested_class_declaration_with_object_name_inside_function") << _(
+ "int foo()\n"
+ "{\n"
+ " struct Nested\n"
+ " {\n"
+ " int i;\n"
+ " } n;\n"
+ " @;\n"
+ "}\n"
+ ) << _("n.") << (QStringList()
+ << QLatin1String("Nested")
+ << QLatin1String("i"));
+
QTest::newRow("nested_anonymous_class_QTCREATORBUG10876_1") << _(
"struct EnclosingStruct\n"
"{\n"