From 1faf2bd1ef5f3928e0db3e92e240d8c9378c77fa Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Sun, 28 Jun 2015 23:21:02 +0300 Subject: C++: Fix resolving of using in enclosing scope Use-case: namespace Ns { namespace Nested { struct Foo { void func(); int bar; }; } } using namespace Ns::Nested; namespace Ns { void Foo::func() { bar; // bar not highlighted } } Change-Id: I6e667d63eb40511d65532c4d6d317aa4028a87a4 Reviewed-by: Nikolai Kosjar --- src/plugins/cpptools/cppcompletion_test.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/plugins/cpptools/cppcompletion_test.cpp') diff --git a/src/plugins/cpptools/cppcompletion_test.cpp b/src/plugins/cpptools/cppcompletion_test.cpp index 3bf0904c65..c743e0ed7d 100644 --- a/src/plugins/cpptools/cppcompletion_test.cpp +++ b/src/plugins/cpptools/cppcompletion_test.cpp @@ -1551,6 +1551,29 @@ void CppToolsPlugin::test_completion_data() << QLatin1String("C") << QLatin1String("m")); + QTest::newRow("type_and_using_declaration: type in nested namespace and using in global") << _( + "namespace Ns {\n" + "namespace Nested {\n" + "struct Foo\n" + "{\n" + " void func();\n" + " int m_bar;\n" + "};\n" + "}\n" + "}\n" + "\n" + "using namespace Ns::Nested;\n" + "\n" + "namespace Ns\n" + "{\n" + "void Foo::func()\n" + "{\n" + " @\n" + "}\n" + "}\n" + ) << _("m_") << (QStringList() + << QLatin1String("m_bar")); + QTest::newRow("instantiate_template_with_anonymous_class") << _( "template \n" "struct S\n" -- cgit v1.2.1