[Interest] can't dump QStringList with qDebug()

Thiago Macieira thiago.macieira at intel.com
Tue Mar 7 18:15:20 CET 2023


On Monday, 6 March 2023 22:15:01 PST Hamish Moffatt via Interest wrote:
> ../../../../Qt6.4.2/6.4.2/gcc_64/include/QtCore/qdebug.h:217:53: note:
> candidate template ignored: requirement
> 'std::conjunction_v<std::disjunction<std::is_base_of<QList<QString>,
> QString>, QTypeTraits::has_ostream_operator<QDebug, QString, void>>>' was
> not satisfied [with T = QString]

This is the expected template and the compiler told us why it couldn't expand: 
it thinks that the QDebugIfHasDebugStreamContainer condition wasn't satisfied. 
That condition is 

std::is_base_of<Container, T> OR QTypeTraits::has_ostream_operator<Stream, T>

Obviously, QStringList is not a base class of QString; we're expecting the 
second check to be true, that there's an output streaming operator for QDebug-
QString

That of course is there; it's in QDebug itself.

So my conclusion is that your compiler has a bug and improperly parsed the C++ 
code. Does this problem happen with GCC 11 or 12?

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Cloud Software Architect - Intel DCAI Cloud Engineering
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5152 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20230307/6e637f89/attachment.bin>


More information about the Interest mailing list