C++ insert def: Fix bug when minimizing name.

Constructors would not get the correct name before. Now rewriting the
function's name is not done by going through the 'rewrite type' func-
tionality but rather by minimizing the symbol's name directly.

Task-number: QTCREATORBUG-6223
Change-Id: I3c25e414337937f5dd0f54570c899ca2ca21d2ef
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
This commit is contained in:
Christian Kamm
2011-10-31 12:09:27 +01:00
parent e202e4b8e0
commit 0021c4c3ee
4 changed files with 30 additions and 78 deletions

View File

@@ -261,13 +261,7 @@ public:
FullySpecifiedType tn = rewriteType(m_decl->type(), &env, control);
// rewrite the function name
QString name;
const FullySpecifiedType nametype = rewriteType(control->namedType(m_decl->name()), &env, control);
if (NamedType *nt = nametype.type()->asNamedType()) {
name = oo(nt->name());
} else {
name = oo(LookupContext::fullyQualifiedName(m_decl));
}
QString name = oo(LookupContext::minimalName(m_decl, targetCoN, control));
QString defText = oo.prettyType(tn, name) + "\n{\n}";