From 7ca54ce5d964646a141acac82f468476f2d66c35 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 1 Oct 2014 13:22:02 +0200 Subject: 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 Reviewed-by: Olivier Goffart Reviewed-by: Thiago Macieira --- src/corelib/tools/qstring.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/corelib/tools/qstring.h') 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; \ }()) \ /**/ -- cgit v1.2.3