Details
-
Bug
-
Resolution: Fixed
-
P3: Somewhat important
-
Qt Creator 4.13.2
Description
When I have a code that uses different methods with the same name (e.g. string()) but different reference qualifiers (const & vs const &&), the tooltip shows the right method declaration if I hover of the code where the specific method is called.
But if I put the cursor in the specific method and press "F2" to get to the specific definition it always jumps to one definition, but never the other.
Example (full code attached):
// part of base.cpp const QString& Base::string() const & { qDebug() << Q_FUNC_INFO; return _string; } // THIS IS THE METHOD WHERE "F2" JUMPS TO QString Base::string() const && { qDebug() << Q_FUNC_INFO; return std::move(_string); } // part of main.cpp Base baseFactory() { Base result; result._string = "factorized"; return result; } int main(int , char *[]) { Base myBase1; qDebug() << "\ndebug output string from simple base"; qDebug() << myBase1.string(); // put cursor in string() and press "F2" qDebug() << "\ndebug output string from factory result"; qDebug() << baseFactory().string(); // put cursor in string() and press "F2" return 0; }
I would expect to jump the respective definition.
As a side note:
Refactoring one string() method to get getString() proposes both string() declarations/definitions to be changed.
Should this be a different issue or has this the same reason?