Qt-AutoUnexpectedQStringbuilder

Finds places where QStringBuilder is deduced instead of QString, which introduces crashes

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” deduced to be QStringBuilder instead of QString. Possible crash.

None

False

lambda_return_qstringbuilder

Lambda return type deduced to be QStringBuilder instead of QString. Possible crash.

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.