From 211894d3482180356cbde2ab233afd863b4f59c3 Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Fri, 15 Apr 2016 10:40:33 +0200 Subject: [PATCH] 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 $ 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 --- tests/unit/echoserver/echoserver.pro | 2 +- 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 39a280db112..ad2a02ad113 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 577e7fc3592..922354975f7 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