diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2022-11-30 16:47:48 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2022-12-01 10:48:32 +0000 |
commit | 4e7adc24628a75312541516d18a11ed9cda924d3 (patch) | |
tree | cbd614922c4e6e4db5b8da16a9d5d88a0d3c467f /src/plugins/cppeditor/cppquickfix_test.cpp | |
parent | 5f4a5802cc0c9c316b5e816501b356686a47e32f (diff) | |
download | qt-creator-4e7adc24628a75312541516d18a11ed9cda924d3.tar.gz |
CppEditor: Another name minimalization fix
... involving using declarations.
See also aae3ce15aa72631e290b4eb6d0e163706b10390b.
Fixes: QTCREATORBUG-28386
Change-Id: I4171dce7b4e34b41c4a894e3bb34b3f62f82ac0f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/cppeditor/cppquickfix_test.cpp')
-rw-r--r-- | src/plugins/cppeditor/cppquickfix_test.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/plugins/cppeditor/cppquickfix_test.cpp b/src/plugins/cppeditor/cppquickfix_test.cpp index 1aaa4c8a5c..a464efedc4 100644 --- a/src/plugins/cppeditor/cppquickfix_test.cpp +++ b/src/plugins/cppeditor/cppquickfix_test.cpp @@ -4555,6 +4555,39 @@ D::D() )"; testDocuments << CppTestDocument::create("file.cpp", original, expected); QuickFixOperationTest(testDocuments, &factory); + + testDocuments.clear(); + original = R"( +namespace ns1 { template<typename T> class span {}; } + +namespace ns { +using ns1::span; +class foo +{ + void @bar(ns::span<int>); +}; +} +)"; + expected = R"( +namespace ns1 { template<typename T> class span {}; } + +namespace ns { +using ns1::span; +class foo +{ + void bar(ns::span<int>); +}; + +void foo::bar(ns::span<int>) +{ + +} + +} +)"; + // TODO: Unneeded namespace gets inserted in RewriteName::visit(const QualifiedNameId *) + testDocuments << CppTestDocument::create("file.cpp", original, expected); + QuickFixOperationTest(testDocuments, &factory); } /// Find right implementation file. (QTCREATORBUG-10728) |