CppEditor: Do not add redundant access specifier

... when inserting a member function declaration for a definition.

Fixes: QTCREATORBUG-5591
Change-Id: Ie85b435a1595832d0085abdcc0a4187d939820e0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Christian Kandeler
2021-02-05 13:12:41 +01:00
parent 8cd9300eda
commit 33d2d736ea
4 changed files with 36 additions and 19 deletions

View File

@@ -3962,9 +3962,9 @@ protected:
const auto insertionPoint = m_headerInsertionPoints.find(spec);
if (insertionPoint != m_headerInsertionPoints.end())
return *insertionPoint;
const InsertionLocation loc = m_locator.methodDeclarationInClass(m_headerFile->fileName(),
m_class,
spec);
const InsertionLocation loc = m_locator.methodDeclarationInClass(
m_headerFile->fileName(), m_class, spec,
InsertionPointLocator::ForceAccessSpec::Yes);
m_headerInsertionPoints.insert(spec, loc);
return loc;
}