mirror of
https://github.com/boostorg/variant2.git
synced 2026-01-25 00:22:25 +01:00
Add variant_gcc_false_positive.cpp to reproduce GCC 12+ spurious -Wmaybe-uninitialized warnings when copying/moving variant containing non-trivially-copyable types like std::exception_ptr and std::string. Tests use boost::system::result which internally uses variant2, and include coroutine-based tests when C++20 coroutine support is available. The test uses -O3 optimization to trigger the aggressive inlining that exposes the false positive where GCC's dataflow analysis cannot prove the discriminator ensures only initialized alternatives are accessed. See https://github.com/boostorg/variant2/issues/33
12 lines
395 B
CMake
12 lines
395 B
CMake
# Copyright 2018, 2019 Peter Dimov
|
|
# Distributed under the Boost Software License, Version 1.0.
|
|
# See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
|
|
|
|
include(BoostTestJamfile OPTIONAL RESULT_VARIABLE HAVE_BOOST_TEST)
|
|
|
|
if(HAVE_BOOST_TEST)
|
|
|
|
boost_test_jamfile(FILE Jamfile LINK_LIBRARIES Boost::variant2 Boost::core Boost::container_hash Boost::system)
|
|
|
|
endif()
|