diff options
author | Nikolai Kosjar <nikolai.kosjar@theqtcompany.com> | 2016-04-15 10:40:33 +0200 |
---|---|---|
committer | Nikolai Kosjar <nikolai.kosjar@qt.io> | 2016-04-19 12:01:59 +0000 |
commit | 211894d3482180356cbde2ab233afd863b4f59c3 (patch) | |
tree | 2d7cf87746b8aa9e4ef542fcfabc8eddb7d3ff10 /tests/unit | |
parent | bb8f8b56f130c16b63a0da6c644ae8f3a3b158d9 (diff) | |
download | qt-creator-211894d3482180356cbde2ab233afd863b4f59c3.tar.gz |
Clang: Tests: Fix compilation with clang-3.6 using stdlib
When using stdlib (default on Linux) and compiling with "-std=c++14", errors
like the following occurr. Avoid them by not requiring c++14.
$ clang --version
Ubuntu clang version 3.6.0-2ubuntu1~trusty1 (tags/RELEASE_360/final) (based on LLVM 3.6.0)
Target: x86_64-pc-linux-gnu
Thread model: posix
$ cat clangtest.cpp
#include <random>
$ clang -std=c++11 -fsyntax-only clangtest.cpp # Fine with c++11/stdlibc++
$ clang -std=c++14 -fsyntax-only clangtest.cpp # Ops with c++14/stdlibc++
In file included from clangtest.cpp:1:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/algorithm:62:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/stl_algo.h:65:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/random:39:
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/cstdio:120:11: error: no member named 'gets' in the global namespace
using ::gets;
~~^
1 error generated.
$ clang -std=c++14 -stdlib=libc++ -fsyntax-only clangtest.cpp # Fine with c++14/libc++
See also https://llvm.org/bugs/show_bug.cgi?id=18402.
Change-Id: I2ab3ea837b80196b51d8816ee8aa26a4a531e939
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Diffstat (limited to 'tests/unit')
-rw-r--r-- | tests/unit/echoserver/echoserver.pro | 2 | ||||
-rw-r--r-- | tests/unit/unittest/unittest.pro | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/tests/unit/echoserver/echoserver.pro b/tests/unit/echoserver/echoserver.pro index 39a280db11..ad2a02ad11 100644 --- a/tests/unit/echoserver/echoserver.pro +++ b/tests/unit/echoserver/echoserver.pro @@ -3,7 +3,7 @@ QT += core network QT -= gui TARGET = echo -CONFIG += console c++14 +CONFIG += console c++11 CONFIG -= app_bundle TEMPLATE = app diff --git a/tests/unit/unittest/unittest.pro b/tests/unit/unittest/unittest.pro index 577e7fc359..922354975f 100644 --- a/tests/unit/unittest/unittest.pro +++ b/tests/unit/unittest/unittest.pro @@ -6,7 +6,7 @@ include(creator_dependency.pri) include(benchmark_dependency.pri) QT += core network testlib widgets -CONFIG += console c++14 testcase object_parallel_to_source +CONFIG += console c++11 testcase object_parallel_to_source CONFIG -= app_bundle OBJECTS_DIR = $$OUT_PWD/obj # workaround for qmake bug in object_parallel_to_source |