[Interest] can't dump QStringList with qDebug()
thiago.macieira at intel.com
Wed Mar 8 07:11:13 CET 2023
On Tuesday, 7 March 2023 21:20:02 PST Hamish Moffatt via Interest wrote:
> I confirm that my test code compiles in 6.5.0-beta3.
And I can reproduce the error with GCC 13 if I check out the 6.4.2 headers.
GCC 13 says:
note: candidate: ‘template<class T> QDebugIfHasDebugStreamContainer<QList<T>,
T> operator<<(QDebug, const QList<T>&)’
note: template argument deduction/substitution failed
qdebug.h:217:53: required by substitution of ‘template<class T>
QDebugIfHasDebugStreamContainer<QList<T>, T> operator<<(QDebug, const
QList<T>&) [with T = QString]’
type_traits:2594:11: error: no type named ‘type’ in ‘struct
This is GCC speak for "condition evaluated to false"
By moving the constraint from the return type to a static_assert inside the
function, I can prove that the ostream test fails:
qdebug.h:219:5: error: static assertion failed due to requirement
But that test is:
and if I copy that expression to the function, it does compile.
Moreover, the changes to qdebug.h and qtypeinfo.h don't seem related.
So I have no clue *why* the check fails and *how* it was fixed.
This is template black magic. It works right now and I've spent enough time
Thiago Macieira - thiago.macieira (AT) intel.com
Cloud Software Architect - Intel DCAI Cloud Engineering
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 5152 bytes
Desc: not available
More information about the Interest