Qt-AutoUnexpectedQStringbuilder

Finds questionable places where QStringBuilder is deduced instead of QString

Required inputs: IR

Finds places where QStringBuilder is deduced instead of QString for auto or lambda return values.

Example:

#define QT_USE_QSTRINGBUILDER
#include <QtCore/QString>
(...)
const auto path = "hello " +  QString::fromLatin1("world");
qDebug() << path; // CRASH

This rule is based on clazy rule auto-unexpected-qstringbuilder

Possible Messages

Key

Text

Severity

Disabled

auto_qstringbuilder

Type for “auto” is deduced to be QStringBuilder. Check if an explicit type QString is better.

None

False

lambda_return_qstringbuilder

Lambda return type is deduced to be QStringBuilder. Check if an explicit type QString is better.

None

False

Options

level

level : int = 1

Importance level of the rule as given for clazy. 0 is most desirable, higher values fall off in quality.