~kubuntu-members/umbrello/4.11

Viewing all changes in revision 3939.

  • Committer: Ralf Habacker
  • Author(s): Raphael Kubo da Costa
  • Date: 2013-12-25 07:51:56 UTC
  • Revision ID: git-v1:cdd78feb9990007e111d9059814d6c973f9c55c1
kdevcppparser: Replace PositionFilename with a typedef to QString.

The C++ standard (98, 03 and 11) states that std::basic_string is supposed
to work only with POD-like types, which is not the case for QChar.

GCC's libstdc++'s std::basic_string implementation, though, does not use any
features present only in POD types, so the previous behavior of using
std::basic_string<QChar> has worked for most people using Linux, and some
workarounds were present for other compilers such as SunPro CC and MSVC.

Instead of adding yet another workaround to get things working with clang
with libc++, try to fix the problem in a different way by getting rid of the
need for std::basic_string in position.h altogether and using a plain
QString instead.

std::basic_string was used only to store the name of the source file being
processed, which was originally a QString anyway, so we can avoid the
QString -> std::basic_string -> QString conversions, as well as the need to
have a full-fledged PositionFilename class with a toString() method that
performed this conversion.

It also allows us to remove the MSVC/SunPro workarounds from the code and
the build system.

Reviewed-by: Andi Fischer <andi.fischer@hispeed.ch>
(cherry picked from commit 6bce76a6b91aaf11082743a9ca8493e43c3d9dcc)

Conflicts:
        umbrello/codeimport/kdevcppparser/position.h

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: