diff options
author | Kai Koehne <kai.koehne@digia.com> | 2014-10-01 13:22:02 +0200 |
---|---|---|
committer | Kai Koehne <kai.koehne@digia.com> | 2014-10-01 17:06:02 +0200 |
commit | 7ca54ce5d964646a141acac82f468476f2d66c35 (patch) | |
tree | f2d6c4a6acf858445bd415dbec02754a5c6de2df | |
parent | 7f18406878764d56cbb5b681650b6911c439a280 (diff) |
Avoid naming clashes with QStringLiteral local variable
MSVC 2013 complains about the use of 's' if a variable 's' is already
defined in the context:
error C2373: 's' : redefinition; different type modifiers
error C3493: 's' cannot be implicitly captured because no default capture
mode has been specified
This looks like a compiler bug. Anyhow, it's easy to avoid the clash in
most cases by using a more distinctive name ...
Task-number: QTBUG-41706
Change-Id: Iaff1b6d37897fa8cf9e4913effa0498f9fd7bb07
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r-- | src/corelib/tools/qstring.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h index 3985bc76fe..52b382985e 100644 --- a/src/corelib/tools/qstring.h +++ b/src/corelib/tools/qstring.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtCore module of the Qt Toolkit. @@ -167,8 +167,8 @@ Q_STATIC_ASSERT_X(sizeof(qunicodechar) == 2, Q_STATIC_STRING_DATA_HEADER_INITIALIZER(Size), \ QT_UNICODE_LITERAL(str) }; \ QStringDataPtr holder = { qstring_literal.data_ptr() }; \ - const QString s(holder); \ - return s; \ + const QString qstring_literal_temp(holder); \ + return qstring_literal_temp; \ }()) \ /**/ |