Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.5.3
-
None
-
Gentoo Linux
-
9e5df4ae5 (dev), bab635fea (6.6), 47eb8b332 (6.5)
Description
The documentation QStringDecoder and QStringEncoder incorrectly states that the encoding methods return a QByteArray and the decoding methods return a QString, where they instead return some other undocumented structures. This causes code like the following to fail to compile:
[](QByteArray const & v) { QStringDecoder decoder("UTF-8"); auto result = decoder(v); if (!decoder.hasError()) return result; return QString("huh?"); }(input);
with errors like:
main.cpp: In lambda function: main.cpp:9:15: error: inconsistent types 'QStringDecoder::EncodedData<const QByteArray&>' and 'QString' deduced for lambda return type 9 | return QString("huh?"); | ^~~~~~~~~~~~~~~ main.cpp:9:29: error: no matching function for call to 'QStringDecoder::EncodedData<const QByteArray&>::EncodedData(QString)' 9 | return QString("huh?"); | ^