--===============2991830330254266658== Content-Type: multipart/alternative; boundary="===============7298455107041724473==" --===============7298455107041724473== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/115125/ ----------------------------------------------------------- (Updated Jan. 19, 2014, 6:19 p.m.) Status ------ This change has been marked as submitted. Review request for kwin and Martin Gräßlin. Repository: kde-workspace Description ------- Without the patch, compilation (with clang 3.3) fails with error: return type 'const QString' must match previous return type 'QString' when lambda expression has unspecified explicit return type For an explanation why this happens, see https://www.mail-archive.com/llvmbugs@cs.uiuc.edu/msg22245.html. GCC seems to simply remove the const. In the patch I'm using a const_cast to make the compiler happy, but maybe creating a new QString and returning that one would be clearer? The QString copy ctor is invoked anyway, as the deduced return type is QString, and the result of the cast is still a reference. Diffs ----- kwin/rules.cpp d09548b Diff: https://git.reviewboard.kde.org/r/115125/diff/ Testing ------- It still compiles with GCC; though I couldn't run the unit tests so far. Thanks, Fabian Kosmale --===============7298455107041724473== Content-Type: text/html; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit
This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/115125/

This change has been marked as submitted.


Review request for kwin and Martin Gräßlin.
By Fabian Kosmale.

Updated Jan. 19, 2014, 6:19 p.m.

Repository: kde-workspace

Description

Without the patch, compilation (with clang 3.3) fails with
error: return type 'const QString' must match previous return type 'QString' when lambda expression has
      unspecified explicit return type
For an explanation why this happens, see https://www.mail-archive.com/llvmbugs@cs.uiuc.edu/msg22245.html. GCC seems to simply remove the const.
In the patch I'm using a const_cast<QString &> to make the compiler happy, but maybe creating a new QString and returning that one would be clearer? The QString copy ctor is invoked anyway, as the deduced return type is QString, and the result of the cast is still a reference.

Testing

It still compiles with GCC; though I couldn't run the unit tests so far.

Diffs

  • kwin/rules.cpp (d09548b)

View Diff

--===============7298455107041724473==-- --===============2991830330254266658== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kwin mailing list kwin@kde.org https://mail.kde.org/mailman/listinfo/kwin --===============2991830330254266658==--