Use -std=c++03 with GCC and clang
authorPyry Haulos <phaulos@google.com>
Thu, 30 Mar 2017 23:59:27 +0000 (16:59 -0700)
committerPyry Haulos <phaulos@google.com>
Mon, 3 Apr 2017 17:30:59 +0000 (10:30 -0700)
dEQP currently maintains minimum requirement of c++03 support from
toolchains. Use of c++11 or newer is not allowed

GCC 6.1 enables c++14 mode by default and developers might accidentally
use features from it unless we specify c++03 version.

Change-Id: If9ed0f009310b63b29b6a8a355969030b45139ba
Components: Framework

external/vulkancts/modules/vulkan/shaderexecutor/vktShaderBuiltinPrecisionTests.cpp
framework/delibs/cmake/CFlags.cmake
modules/glshared/glsBuiltinPrecisionTests.cpp

index dc335b5..22106d7 100644 (file)
@@ -1064,10 +1064,10 @@ const ExprP<Void>& voidP (void)
 template <typename T0 = Void, typename T1 = Void, typename T2 = Void, typename T3 = Void>
 struct Tuple4
 {
-       explicit Tuple4 (const T0& e0 = T0(),
-                                        const T1& e1 = T1(),
-                                        const T2& e2 = T2(),
-                                        const T3& e3 = T3())
+       explicit Tuple4 (const T0 e0 = T0(),
+                                        const T1 e1 = T1(),
+                                        const T2 e2 = T2(),
+                                        const T3 e3 = T3())
                : a     (e0)
                , b     (e1)
                , c     (e2)
index 0df0f43..8a4b9ad 100644 (file)
@@ -46,8 +46,8 @@ if (DE_COMPILER_IS_GCC OR DE_COMPILER_IS_CLANG)
        # \note Remove -Wno-sign-conversion for more warnings
        set(WARNING_FLAGS                       "-Wall -Wextra -Wno-long-long -Wshadow -Wundef -Wconversion -Wno-sign-conversion")
 
-       set(CMAKE_C_FLAGS                       "${CMAKE_C_FLAGS} ${TARGET_FLAGS} ${WARNING_FLAGS} -ansi -pedantic ")
-       set(CMAKE_CXX_FLAGS                     "${CMAKE_CXX_FLAGS} ${TARGET_FLAGS} ${WARNING_FLAGS} -Wno-delete-non-virtual-dtor")
+       set(CMAKE_C_FLAGS                       "${TARGET_FLAGS} ${WARNING_FLAGS} ${CMAKE_C_FLAGS} -std=c90 -pedantic ")
+       set(CMAKE_CXX_FLAGS                     "${TARGET_FLAGS} ${WARNING_FLAGS} ${CMAKE_CXX_FLAGS} -std=c++03 -Wno-delete-non-virtual-dtor")
 
        # Force compiler to generate code where integers have well defined overflow
        # Turn on -Wstrict-overflow=5 and check all warnings before removing
index 76d83c8..da69f89 100644 (file)
@@ -1085,10 +1085,10 @@ const ExprP<Void>& voidP (void)
 template <typename T0 = Void, typename T1 = Void, typename T2 = Void, typename T3 = Void>
 struct Tuple4
 {
-       explicit Tuple4 (const T0& e0 = T0(),
-                                        const T1& e1 = T1(),
-                                        const T2& e2 = T2(),
-                                        const T3& e3 = T3())
+       explicit Tuple4 (const T0 e0 = T0(),
+                                        const T1 e1 = T1(),
+                                        const T2 e2 = T2(),
+                                        const T3 e3 = T3())
                : a     (e0)
                , b     (e1)
                , c     (e2)