diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2021-02-08 16:24:39 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2021-02-09 16:56:12 +0000 |
commit | e740295b8d3251eb149ff469da252de861d70376 (patch) | |
tree | 6821a944220cd5dfaae3197190db7355c5c6bb48 /src/plugins/cppeditor/cppquickfix_test.cpp | |
parent | cb5977fbad51d035d05f441e78204f591a5a916f (diff) | |
download | qt-creator-e740295b8d3251eb149ff469da252de861d70376.tar.gz |
CplusPlus: Fix minimal name construction
... when creating the constructor implementation for a derived class.
We would erroneously strip off the class name.
Amends aae3ce15aa.
Change-Id: I62c800d490626e8cb9416829633f9ef7b0c666cd
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 | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/plugins/cppeditor/cppquickfix_test.cpp b/src/plugins/cppeditor/cppquickfix_test.cpp index 5ba0101b39..1c55c7cc0a 100644 --- a/src/plugins/cppeditor/cppquickfix_test.cpp +++ b/src/plugins/cppeditor/cppquickfix_test.cpp @@ -4408,6 +4408,32 @@ void func(const N1::S &s) )"; testDocuments << QuickFixTestDocument::create("file.cpp", original, expected); QuickFixOperationTest(testDocuments, &factory); + + // No using declarations here, but the code model has one. No idea why. + testDocuments.clear(); + original = R"( +class B {}; +class D : public B { + @D(); +}; +)"; + expected = original; + testDocuments << QuickFixTestDocument::create("file.h", original, expected); + + // Source File + original = R"( +#include "file.h" +)"; + expected = R"( +#include "file.h" + +D::D() +{ + +} +)"; + testDocuments << QuickFixTestDocument::create("file.cpp", original, expected); + QuickFixOperationTest(testDocuments, &factory); } /// Find right implementation file. (QTCREATORBUG-10728) |