Project

General

Profile

Bug #328 ยป 0034-Fix-C-20-capture-this-semantics-configure-check.patch

Marko Lindqvist, 03/20/2024 03:05 PM

View differences:

m4/c++20.m4
CXXFLAGS="$CXXFLAGS $WERROR_CXX_TEST_FLAGS"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[class me {
void top(); };
void me::top() { [=, this]() {}; };
void me::top() { (void) [=, this]() { this->top(); }; };
]])],
[ac_cv_cxx20_capture_this=yes], [ac_cv_cxx20_capture_this=no])
CXXFLAGS="$_CXXFLAGS"
meson.build
if cxx_build and cxx_compiler.compiles('''
class me {
void top(); };
void me::top() { [=, this]() {}; };
void me::top() { (void) [=, this]() { this->top(); }; };
''',
name: 'C++20 capture this',
args: ['-Werror', '-Wall'])
    (1-1/1)