diff options
-rw-r--r-- | src/corelib/configure.cmake | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/src/corelib/configure.cmake b/src/corelib/configure.cmake index 80e6d93193..18c09d2241 100644 --- a/src/corelib/configure.cmake +++ b/src/corelib/configure.cmake @@ -430,6 +430,34 @@ const auto backtrace = std::stacktrace::current(); CXX_STANDARD 23 ) +# <future> +qt_config_compile_test(cxx_std_async_noncopyable + LABEL "std::async() NonCopyable" + CODE +"// Calling std::async with lambda which takes non-copyable argument causes compilation error on +// some platforms (VxWorks 24.03 and older with C++17-compatibility for example) +#include <future> + +class NonCopyable { +public: + NonCopyable(const NonCopyable&) = delete; + NonCopyable(NonCopyable&&) = default; + + NonCopyable(int value) + :value (value) + {} + + int value; +}; + +int main(int argc, char** argv) { + return std::async( + std::launch::deferred, + [](NonCopyable value) { return value.value; }, + NonCopyable(argc - 1)).get(); +} +") + #### Features qt_feature("clock-gettime" PRIVATE @@ -458,7 +486,7 @@ qt_feature("system-doubleconversion" PRIVATE ) qt_feature("cxx11_future" PUBLIC LABEL "C++11 <future>" - CONDITION NOT VXWORKS + CONDITION TEST_cxx_std_async_noncopyable ) qt_feature("cxx17_filesystem" PUBLIC LABEL "C++17 <filesystem>" |