Details
-
Bug
-
Resolution: Fixed
-
P3: Somewhat important
-
Qt Creator 5.0.0-beta1
Description
Steps to reproduce:
- open qtbase's CMakeLists.txt (it happened in Qt 5 too)
- open qstring.cpp
- locate the declaration of qLastIndexOf, around line 150
- modify the code as follows:
// internal qsizetype qFindStringBoyerMoore(QStringView haystack, qsizetype from, QStringView needle, Qt::CaseSensitivity cs); static inline qsizetype qFindChar(QStringView str, QChar ch, qsizetype from, Qt::CaseSensitivity cs) noexcept; void f() { } template <typename Haystack> static inline qsizetype qLastIndexOf(Haystack haystack, QChar needle, qsizetype from, Qt::CaseSensitivity cs) noexcept; void g() { } template <> inline qsizetype qLastIndexOf(QString haystack, QChar needle, qsizetype from, Qt::CaseSensitivity cs) noexcept = delete; // unwanted, would detach
If you move your cursor to the "f" function, the function locator at the top shows "f":
Screenshot_20210414_140832.png
If you then move the cursor to g, the locator shows nothing:
Screenshot_20210414_141050.png
The locator is a symptom of a larger problem, in which the contents of qstring.cpp between the declaration of qLastIndexOf (around line 150) and its definition (around line 10237) are improperly parsed. Some functionality works and some doesn't. That's over 95% of qstring.cpp, arguably one of the most important files in Qt.