https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104173

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |ppalka at gcc dot 
gnu.org

--- Comment #2 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Interestingly, here's a non-template variant of the testcase that seems to be
rejected by every GCC version:

struct QString {
  QString toLower() const& = delete;
  QString toLower() &&;
};

struct QCoreApplication {
  static QCoreApplication *instance();
  static QString applicationName();
};

int main() {
  QCoreApplication::instance()
    ->applicationName().toLower();
}

Overload resolution for the call to toLower() incorrectly chooses the deleted
const& overload instead of the && overloaded.

Reply via email to