Clang: partial workaround for parsing default arg values skipping macros

CCBUG: 369546
parent 83259448
Pipeline #13412 passed with stage
in 47 minutes and 36 seconds
......@@ -198,8 +198,16 @@ QVector<QString> ClangUtils::getDefaultArguments(CXCursor cursor, DefaultArgumen
const QString result = info.stringParts.join(QString());
if (mode == FixedSize) {
arguments.replace(i, result);
} else if (!result.isEmpty()) {
arguments << result;
} else {
if (!result.isEmpty()) {
arguments << result;
} else if (!arguments.isEmpty()) {
// TODO: paramVisitor fails to report macros like INT_MAX or QStringLiteral as default values,
// only returns an empty string. To not have the order of default values
// not match the order of arguments, insert a placeholder for now
// See https://bugs.kde.org/show_bug.cgi?id=369546
arguments << QStringLiteral("<KDEV TODO>");
}
}
}
return arguments;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment