Skip to content

don't auto deduce QStringBuilder

Harald Sitter requested to merge work/no-auto-qstringbuild into release/21.08

see 'auto QString(Builder) considered VERY HARMFUL' thread on kde-devel https://markmail.org/message/mbrp5ypyhcfk7zjn

What happens is that the type of str ends up being QStringBuilder instead of QString. The QStringBuilder is destroyed after the semicolon, and all access to "str" produces undefined behavior.

Never use auto for QString concatenation!

BUG: 439877

Merge request reports

Loading