diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2020-07-16 15:09:34 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2020-07-20 08:24:06 +0000 |
commit | 3b14051db50f65f0e6c1319adad2224bfa6e3871 (patch) | |
tree | 70d3e4cf4d3471eb9ca4f22eebf98a6505220cec /src/plugins/cppeditor/cppfunctiondecldeflink.cpp | |
parent | 9026dd00331bd108367e64703c67cdda3e120352 (diff) | |
download | qt-creator-3b14051db50f65f0e6c1319adad2224bfa6e3871.tar.gz |
CPlusPlus: Do not ignore namespaces
... when comparing type names. For instance, this is relevant when
deciding whether to offer the "Apply signature changes" refactoring
action.
Add fallback code for function lookups, which was relying on the relaxed
semantics for parameter types.
Fixes: QTCREATORBUG-9856
Change-Id: I2001b77034ff15e96a23e3359d19654d0f43f60b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/cppeditor/cppfunctiondecldeflink.cpp')
-rw-r--r-- | src/plugins/cppeditor/cppfunctiondecldeflink.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/cppeditor/cppfunctiondecldeflink.cpp b/src/plugins/cppeditor/cppfunctiondecldeflink.cpp index 537664023d..0582dad58e 100644 --- a/src/plugins/cppeditor/cppfunctiondecldeflink.cpp +++ b/src/plugins/cppeditor/cppfunctiondecldeflink.cpp @@ -794,8 +794,9 @@ ChangeSet FunctionDeclDefLink::changes(const Snapshot &snapshot, int targetOffse renamedTargetParameters[targetParam] = overview.prettyName(replacementName); // need to change the type (and name)? + FullySpecifiedType replacementType = rewriteType(newParam->type(), &env, control); if (!newParam->type().match(sourceParam->type()) - && !newParam->type().match(targetParam->type())) { + && !replacementType.match(targetParam->type())) { const int parameterTypeStart = targetFile->startOf(targetParamAst); int parameterTypeEnd = 0; if (targetParamAst->declarator) @@ -805,7 +806,6 @@ ChangeSet FunctionDeclDefLink::changes(const Snapshot &snapshot, int targetOffse else parameterTypeEnd = targetFile->startOf(targetParamAst); - FullySpecifiedType replacementType = rewriteType(newParam->type(), &env, control); newTargetParam = targetFile->textOf(parameterStart, parameterTypeStart); newTargetParam += overview.prettyType(replacementType, replacementName); newTargetParam += targetFile->textOf(parameterTypeEnd, parameterEnd); |