Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
6.1.2
-
None
-
macOS 11.2.3
-
-
878b2047b52c93e904eb46ef1044819a8b5614ab (qt/qtbase/dev) 8b65905e4b8c12040373cc36ec29dbe2861c24a9 (qt/qtbase/6.2)
Description
The following code compiles with Qt 5.15 but fails to compile with Qt 6.1.2:
auto foo(QList<int>::const_iterator p, std::ptrdiff_t n) { return p + n; }
The error is:
test.cpp:9:14: error: use of overloaded operator '+' is ambiguous (with operand types 'QList<int>::const_iterator' and 'ptrdiff_t' (aka 'long')) return p + n; ~ ^ ~ Qt/6.1.2/macos/lib/QtCore.framework/Headers/qlist.h:198:31: note: candidate function inline const_iterator operator+(qsizetype j) const { return const_iterator(i+j); } ^ test.cpp:9:14: note: built-in candidate operator+(const int *, long) return p + n; ^