summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config.tests/common/c++11/c++11.cpp49
-rw-r--r--config.tests/common/c++11/c++11.pro3
-rwxr-xr-xconfigure6
-rw-r--r--src/corelib/global/qcompilerdetection.h6
-rw-r--r--tools/configure/configureapp.cpp7
5 files changed, 8 insertions, 63 deletions
diff --git a/config.tests/common/c++11/c++11.cpp b/config.tests/common/c++11/c++11.cpp
deleted file mode 100644
index 88b67b5bff..0000000000
--- a/config.tests/common/c++11/c++11.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the configuration of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__) || defined(__INTEL_CXX11_MODE__)
-// Compiler claims to support C++11, trust it
-#else
-# error "__cplusplus must be >= 201103L, or one of __GXX_EXPERIMENTAL_CXX0X__ or __INTEL_CXX11_MODE__ must be defined"
-#endif
-
-#include <utility>
-#include <initializer_list>
-
-int main(int, char **) { return std::move(0); }
diff --git a/config.tests/common/c++11/c++11.pro b/config.tests/common/c++11/c++11.pro
deleted file mode 100644
index 3620f99c71..0000000000
--- a/config.tests/common/c++11/c++11.pro
+++ /dev/null
@@ -1,3 +0,0 @@
-SOURCES = c++11.cpp
-CONFIG += c++11 console
-CONFIG -= qt
diff --git a/configure b/configure
index f2822503c4..0ba0c31e4a 100755
--- a/configure
+++ b/configure
@@ -4430,11 +4430,7 @@ fi
# Detect C++11 & up support
stdcxx_error=false
-if ! compileTest common/c++11 "C++11"; then
- echo "ERROR: Qt requires a C++11 compiler and yours does not seem to be that."
- echo "Please upgrade."
- exit 1
-elif [ "$CFG_STDCXX" = "c++11" ]; then
+if [ "$CFG_STDCXX" = "c++11" ]; then
: # CFG_STDCXX is correct
elif ! compileTest common/c++14 "C++14"; then
if [ "$CFG_STDCXX" != "auto" ]; then
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index e152786d3f..285931e794 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -557,6 +557,12 @@
* Q_COMPILER_RESTRICTED_VLA variable-length arrays, prior to __cpp_runtime_arrays
*/
+#ifdef __cplusplus
+# if __cplusplus < 201103L && !(defined(Q_CC_MSVC) && Q_CC_MSVC >= 1800)
+# error Qt requires a C++11 compiler and yours does not seem to be that.
+# endif
+#endif
+
#ifdef Q_CC_INTEL
# define Q_COMPILER_RESTRICTED_VLA
# define Q_COMPILER_VARIADIC_MACROS // C++11 feature supported as an extension in other modes, too
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp
index a89e66c377..0fa205bd98 100644
--- a/tools/configure/configureapp.cpp
+++ b/tools/configure/configureapp.cpp
@@ -2310,12 +2310,7 @@ void Configure::autoDetection()
detectArch();
if (dictionary["C++STD"] == "auto" && !dictionary["QMAKESPEC"].contains("msvc")) {
- if (!tryCompileProject("common/c++11")) {
- dictionary["DONE"] = "error";
- cout << "ERROR: Qt requires a C++11 compiler and yours does not seem to be that." << endl
- << "Please upgrade." << endl;
- return;
- } else if (!tryCompileProject("common/c++14")) {
+ if (!tryCompileProject("common/c++14")) {
dictionary["C++STD"] = "c++11";
} else if (!tryCompileProject("common/c++1z")) {
dictionary["C++STD"] = "c++14";