summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppcompletion_test.cpp
diff options
context:
space:
mode:
authorNikolai Kosjar <nikolai.kosjar@theqtcompany.com>2015-08-20 16:20:59 +0200
committerNikolai Kosjar <nikolai.kosjar@theqtcompany.com>2015-08-21 10:25:15 +0000
commite0594fc9b906a32f5c8ac70265490cf86044676f (patch)
tree825e2b1361f529855c54b1a1529331cab057d97e /src/plugins/cpptools/cppcompletion_test.cpp
parent87df7c409235a44b8b7e0147dcb549a39ca88cb0 (diff)
downloadqt-creator-e0594fc9b906a32f5c8ac70265490cf86044676f.tar.gz
C++: Fix expensive lookup for boost
With this patch, CheckSymbols takes about 200ms for processing the boost/proto hello world example [1]. Before, it needed about 11 seconds (timer in CheckSymbols::run). Same goes for including <boost/fusion/include/zip.hpp>. The custom ProcessedSet object was added to support "completion for typedefs for templates in namespaces", but apparently that's not needed anymore, as the added test proves. [1] http://www.boost.org/doc/libs/1_58_0/doc/html/proto/users_guide.html#boost_proto.users_guide.getting_started.hello_world Task-numer: QTCREATORBUG-14889 Task-numer: QTCREATORBUG-14741 Change-Id: I90454e8970a9d04033d56beeb0c6d7a0d4e6cc62 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/plugins/cpptools/cppcompletion_test.cpp')
-rw-r--r--src/plugins/cpptools/cppcompletion_test.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/plugins/cpptools/cppcompletion_test.cpp b/src/plugins/cpptools/cppcompletion_test.cpp
index b7ede1021c..4a5763cc10 100644
--- a/src/plugins/cpptools/cppcompletion_test.cpp
+++ b/src/plugins/cpptools/cppcompletion_test.cpp
@@ -3235,6 +3235,24 @@ void CppToolsPlugin::test_completion_data()
<< QLatin1String("Foo")
<< QLatin1String("bar"));
+ QTest::newRow("typedef for templates in namespace") << _(
+ "namespace N {\n"
+ "\n"
+ "struct Data { int x; };\n"
+ "template <typename T> struct Foo { T member; };\n"
+ "typedef Foo<Data> Bar;\n"
+ "\n"
+ "} // N\n"
+ "\n"
+ "\n"
+ "void f()\n"
+ "{\n"
+ " N::Bar o;\n"
+ " @\n"
+ "}\n"
+ ) << _("o.member.") << (QStringList()
+ << QLatin1String("Data")
+ << QLatin1String("x"));
}
void CppToolsPlugin::test_completion_member_access_operator()