From ac95f38d1b06ac6977ea6d8b9f14f9405396858f Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Mon, 12 Nov 2018 15:43:13 +0100 Subject: [PATCH] cxx: explicitly require c++11 and fix tests to conform We weren't setting a C++ version for build previously, which would result in compiler specific default being used, most likely C++11 with GNU extensions on modern compilers and C++03 with GNU exts on old compilers. This is bad because it potentially breaks build on older toolchains that don't default to a modern C++. Now we enable pure C++11 without GNU exts; this resulted in some of the build breaking because of use of typeof() GNU C/C++ ext in tests code, so fix that to use standard decltype() from C++11. @fix --- meson.build | 2 +- src/tests/eolian_cxx/complex_cxx.cc | 44 ++++++++++++++--------------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/meson.build b/meson.build index 6e1a574ca8..9c090149fa 100644 --- a/meson.build +++ b/meson.build @@ -1,6 +1,6 @@ project('efl', ['c','cpp'], version: '1.21.99', - default_options : ['buildtype=plain'], + default_options : ['buildtype=plain', 'cpp_std=c++11'], meson_version : '>=0.47' ) diff --git a/src/tests/eolian_cxx/complex_cxx.cc b/src/tests/eolian_cxx/complex_cxx.cc index da92b5cb08..37e9661400 100644 --- a/src/tests/eolian_cxx/complex_cxx.cc +++ b/src/tests/eolian_cxx/complex_cxx.cc @@ -37,27 +37,27 @@ struct test_param_type static_assert(std::is_same::value, "Wrong type"); }; -test_param_type> inclasscont; -test_param_type >> incontcont; -test_param_type >const&> incontcontown; -test_param_type >const&> incontowncontown; -test_param_type >> incontowncont; -test_param_type> instringcont; -test_param_type> instringowncont; -test_param_typeconst&> instringcontown; +test_param_type> inclasscont; +test_param_type >> incontcont; +test_param_type >const&> incontcontown; +test_param_type >const&> incontowncontown; +test_param_type >> incontowncont; +test_param_type> instringcont; +test_param_type> instringowncont; +test_param_typeconst&> instringcontown; -test_param_type&> outclasscont; -test_param_type >&> outcontcont; -test_param_type >&> outcontcontown; -test_param_type >&> outcontowncontown; -test_param_type >&> outcontowncont; -test_param_type&> outstringcont; -test_param_type&> outstringowncont; -test_param_type&> outstringcontown; +test_param_type&> outclasscont; +test_param_type >&> outcontcont; +test_param_type >&> outcontcontown; +test_param_type >&> outcontowncontown; +test_param_type >&> outcontowncont; +test_param_type&> outstringcont; +test_param_type&> outstringowncont; +test_param_type&> outstringcontown; -test_param_type > foo; -test_return_type > bar; -test_return_type wrapper_r; -test_param_type wrapper_in; -test_param_type wrapper_inout; -test_param_type wrapper_out; +test_param_type > foo; +test_return_type > bar; +test_return_type wrapper_r; +test_param_type wrapper_in; +test_param_type wrapper_inout; +test_param_type wrapper_out;