test-suite support for gcc-8 targeting C++11 and C++14

Some code in this test case is actually only supported in c++17...

cpp11_lambda_functions_wrap.cxx:275:87: error: the type ‘const<lambda(int, int)>’ of ‘constexpr’ variable ‘lambda18’ is not literal
 CONSTEXPR auto lambda18 = [] (int x, int y) mutable TESTCASE_THROW(int) { return x+y; };
                                                                                       ^
cpp11_lambda_functions_wrap.cxx:275:28: note: ‘<lambda(int, int)>’ is not literal because:
 CONSTEXPR auto lambda18 = [] (int x, int y) mutable TESTCASE_THROW(int) { return x+y; };
                            ^
cc1plus: note:   ‘<lambda(int, int)>’ is a closure type, which is only literal in C++17 and later
cpp11_lambda_functions_wrap.cxx:278:89: error: the type ‘const Space1::<lambda(int, int)>’ of ‘constexpr’ variable ‘Space1::lambda19’ is not literal
   CONSTEXPR auto lambda19 = [] (int x, int y) mutable TESTCASE_THROW(int) { return x+y; };
This commit is contained in:
William S Fulton 2018-05-04 07:09:43 +01:00
commit 7ecf6a71b0

View file

@ -67,12 +67,17 @@ auto lambda14 = [] () TESTCASE_THROW() {};
auto lambda15 = [] () mutable TESTCASE_THROW() {};
auto lambda16 = [] { return thing; };
auto lambda17 = [] { return thing; }();
constexpr auto lambda18 = [] (int x, int y) mutable TESTCASE_THROW(int) { return x+y; };
#if defined(SWIG) || (defined(__cplusplus) && __cplusplus >= 201703L)
#define CONSTEXPR constexpr
#else
#define CONSTEXPR
#endif
CONSTEXPR auto lambda18 = [] (int x, int y) mutable TESTCASE_THROW(int) { return x+y; };
namespace Space1 {
constexpr auto lambda19 = [] (int x, int y) mutable TESTCASE_THROW(int) { return x+y; };
CONSTEXPR auto lambda19 = [] (int x, int y) mutable TESTCASE_THROW(int) { return x+y; };
namespace Space2 {
constexpr auto lambda20 = [] (int x, int y) mutable TESTCASE_THROW(int) { return x+y; };
CONSTEXPR auto lambda20 = [] (int x, int y) mutable TESTCASE_THROW(int) { return x+y; };
}
}