Skip to content

Commit

Permalink
cxx: explicitly require c++11 and fix tests to conform
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Daniel Kolesa committed Nov 12, 2018
1 parent 1af272b commit ac95f38
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -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'
)

Expand Down
48 changes: 24 additions & 24 deletions src/tests/eolian_cxx/complex_cxx.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,27 +37,27 @@ struct test_param_type<void(T::*)(P), U>
static_assert(std::is_same<P, U>::value, "Wrong type");
};

test_param_type<typeof( & nonamespace::Complex::inclasscont ), efl::eina::range_list<efl::Object>> inclasscont;
test_param_type<typeof( & nonamespace::Complex::incontcont ), efl::eina::range_list<efl::eina::range_list<const int &> >> incontcont;
test_param_type<typeof( & nonamespace::Complex::incontcontown ), efl::eina::list<efl::eina::range_list<const int &> >const&> incontcontown;
test_param_type<typeof( & nonamespace::Complex::incontowncontown ), efl::eina::list<efl::eina::list<const int &> >const&> incontowncontown;
test_param_type<typeof( & nonamespace::Complex::incontowncont ), efl::eina::range_list<efl::eina::list<const int &> >> incontowncont;
test_param_type<typeof( & nonamespace::Complex::instringcont ), efl::eina::range_list<efl::eina::string_view>> instringcont;
test_param_type<typeof( & nonamespace::Complex::instringowncont ), efl::eina::range_list<efl::eina::string_view>> instringowncont;
test_param_type<typeof( & nonamespace::Complex::instringcontown ), efl::eina::list<efl::eina::string_view>const&> instringcontown;

test_param_type<typeof( & nonamespace::Complex::outclasscont ), efl::eina::range_list<efl::Object>&> outclasscont;
test_param_type<typeof( & nonamespace::Complex::outcontcont ), efl::eina::range_list<efl::eina::range_list<const int &> >&> outcontcont;
test_param_type<typeof( & nonamespace::Complex::outcontcontown ), efl::eina::list<efl::eina::range_list<const int &> >&> outcontcontown;
test_param_type<typeof( & nonamespace::Complex::outcontowncontown ), efl::eina::list<efl::eina::list<const int &> >&> outcontowncontown;
test_param_type<typeof( & nonamespace::Complex::outcontowncont ), efl::eina::range_list<efl::eina::list<const int &> >&> outcontowncont;
test_param_type<typeof( & nonamespace::Complex::outstringcont ), efl::eina::range_list<efl::eina::string_view>&> outstringcont;
test_param_type<typeof( & nonamespace::Complex::outstringowncont ), efl::eina::range_list<efl::eina::string_view>&> outstringowncont;
test_param_type<typeof( & nonamespace::Complex::outstringcontown ), efl::eina::list<efl::eina::string_view>&> outstringcontown;

test_param_type<typeof( & nonamespace::Complex::foo ), efl::eina::range_list<const int &> > foo;
test_return_type<typeof( & nonamespace::Complex::bar ), efl::eina::range_array<const int &> > bar;
test_return_type<typeof( & nonamespace::Complex::wrapper_r ), nonamespace::Complex> wrapper_r;
test_param_type<typeof( & nonamespace::Complex::wrapper_in ), nonamespace::Complex> wrapper_in;
test_param_type<typeof( & nonamespace::Complex::wrapper_inout ), nonamespace::Complex&> wrapper_inout;
test_param_type<typeof( & nonamespace::Complex::wrapper_out ), nonamespace::Complex&> wrapper_out;
test_param_type<decltype( & nonamespace::Complex::inclasscont ), efl::eina::range_list<efl::Object>> inclasscont;
test_param_type<decltype( & nonamespace::Complex::incontcont ), efl::eina::range_list<efl::eina::range_list<const int &> >> incontcont;
test_param_type<decltype( & nonamespace::Complex::incontcontown ), efl::eina::list<efl::eina::range_list<const int &> >const&> incontcontown;
test_param_type<decltype( & nonamespace::Complex::incontowncontown ), efl::eina::list<efl::eina::list<const int &> >const&> incontowncontown;
test_param_type<decltype( & nonamespace::Complex::incontowncont ), efl::eina::range_list<efl::eina::list<const int &> >> incontowncont;
test_param_type<decltype( & nonamespace::Complex::instringcont ), efl::eina::range_list<efl::eina::string_view>> instringcont;
test_param_type<decltype( & nonamespace::Complex::instringowncont ), efl::eina::range_list<efl::eina::string_view>> instringowncont;
test_param_type<decltype( & nonamespace::Complex::instringcontown ), efl::eina::list<efl::eina::string_view>const&> instringcontown;

test_param_type<decltype( & nonamespace::Complex::outclasscont ), efl::eina::range_list<efl::Object>&> outclasscont;
test_param_type<decltype( & nonamespace::Complex::outcontcont ), efl::eina::range_list<efl::eina::range_list<const int &> >&> outcontcont;
test_param_type<decltype( & nonamespace::Complex::outcontcontown ), efl::eina::list<efl::eina::range_list<const int &> >&> outcontcontown;
test_param_type<decltype( & nonamespace::Complex::outcontowncontown ), efl::eina::list<efl::eina::list<const int &> >&> outcontowncontown;
test_param_type<decltype( & nonamespace::Complex::outcontowncont ), efl::eina::range_list<efl::eina::list<const int &> >&> outcontowncont;
test_param_type<decltype( & nonamespace::Complex::outstringcont ), efl::eina::range_list<efl::eina::string_view>&> outstringcont;
test_param_type<decltype( & nonamespace::Complex::outstringowncont ), efl::eina::range_list<efl::eina::string_view>&> outstringowncont;
test_param_type<decltype( & nonamespace::Complex::outstringcontown ), efl::eina::list<efl::eina::string_view>&> outstringcontown;

test_param_type<decltype( & nonamespace::Complex::foo ), efl::eina::range_list<const int &> > foo;
test_return_type<decltype( & nonamespace::Complex::bar ), efl::eina::range_array<const int &> > bar;
test_return_type<decltype( & nonamespace::Complex::wrapper_r ), nonamespace::Complex> wrapper_r;
test_param_type<decltype( & nonamespace::Complex::wrapper_in ), nonamespace::Complex> wrapper_in;
test_param_type<decltype( & nonamespace::Complex::wrapper_inout ), nonamespace::Complex&> wrapper_inout;
test_param_type<decltype( & nonamespace::Complex::wrapper_out ), nonamespace::Complex&> wrapper_out;

0 comments on commit ac95f38

Please sign in to comment.