Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
b3d0aca
work
fdr400 Mar 3, 2026
74eab9c
work
fdr400 Mar 4, 2026
5770d7b
work
fdr400 Mar 5, 2026
54e003b
work
fdr400 Mar 5, 2026
c7f12be
fix no modules build
fdr400 Mar 5, 2026
c0b2efb
fix build both modules and headers
fdr400 Mar 5, 2026
af51004
empty
fdr400 Mar 5, 2026
62f5c50
rollback not required changes
fdr400 Mar 5, 2026
1d00450
rollback not required changes
fdr400 Mar 5, 2026
b838908
remove comment
fdr400 Mar 5, 2026
31680b1
rollback not required diff
fdr400 Mar 5, 2026
a64218c
format
fdr400 Mar 5, 2026
70d614e
remove not needed file
fdr400 Mar 5, 2026
981f133
remove not required directive
fdr400 Mar 5, 2026
8079e49
build modules in link mode
fdr400 Mar 5, 2026
de755c5
make dump independent
fdr400 Mar 14, 2026
5afba8d
build tests without boost test
fdr400 Mar 14, 2026
7d56a55
include dump in windows
fdr400 Mar 14, 2026
e3dc26c
compile dump for Windows
fdr400 Mar 15, 2026
7b6741f
link public with dump
fdr400 Mar 15, 2026
3a24d58
include config to resolve windows
fdr400 Mar 15, 2026
9e0203b
add link options for header_only
fdr400 Mar 15, 2026
c32114c
maybe fix macro for mac
fdr400 Mar 15, 2026
fb7b00e
fix cmake install
fdr400 Mar 15, 2026
40e19f1
link public with dump
fdr400 Mar 15, 2026
a69bb3d
build exception internal
fdr400 Mar 15, 2026
258e663
include only required
fdr400 Mar 15, 2026
bc00bc4
rollback to frame.hpp
fdr400 Mar 15, 2026
76a4f74
do not test torture with addr2line
fdr400 Mar 15, 2026
d3706ff
disable from_exception test on MacOS
fdr400 Mar 15, 2026
5556978
try add dump to b2
fdr400 Mar 15, 2026
fb044fa
propagate dump to dependencies
fdr400 Mar 15, 2026
13127be
Merge branch 'feature/stacktrace-dump-library' into feature/cxx20-mod…
fdr400 Mar 17, 2026
e5b8689
fix cmake
fdr400 Mar 17, 2026
4aa1334
fix test command name
fdr400 Mar 17, 2026
c0860e2
fix test command name
fdr400 Mar 17, 2026
68c7205
fix cmake
fdr400 Mar 17, 2026
3bd3767
add copyright
fdr400 Mar 17, 2026
aab9aa3
introduce stacktrace_config.hpp
fdr400 Mar 17, 2026
64535c3
add missing includes in module
Mar 17, 2026
7f4940c
add copyrights
fdr400 Mar 17, 2026
35b556e
add modules CI
fdr400 Mar 17, 2026
479d967
fix install
fdr400 Mar 17, 2026
d46cae6
save default backend
fdr400 Mar 18, 2026
6050000
skip not supported backend
fdr400 Mar 18, 2026
6a7b901
try install libbacktrace in CI
fdr400 Mar 18, 2026
9d52c9d
fix build clang++-19
fdr400 Mar 22, 2026
11118f4
try use libbacktrace in CI
fdr400 Mar 22, 2026
1a2120b
try use libbacktrace in CI
fdr400 Mar 22, 2026
b21de51
support import std
fdr400 Mar 25, 2026
f9ecb7a
add import std CI
fdr400 Mar 29, 2026
b140f0b
try fix noop module
fdr400 Mar 29, 2026
9c8eab0
bettern config name
fdr400 Apr 11, 2026
a8e80b0
ensure not missing includes
fdr400 Apr 11, 2026
8dfd0c1
ensure not missing includes in detail/
fdr400 Apr 11, 2026
bdca099
Merge branch 'feature/cxx20-modules' into feature/cxx20-modules-impor…
fdr400 Apr 11, 2026
801cad4
fix build
fdr400 Apr 11, 2026
5ef28a6
Merge branch 'develop' into feature/cxx20-modules
fdr400 Apr 28, 2026
f915a3b
rm build
fdr400 Apr 28, 2026
4fed6a0
rm vscode
fdr400 Apr 28, 2026
20d932c
fix conflict
fdr400 Apr 28, 2026
3f7c655
better
fdr400 Apr 28, 2026
a6860c4
fix addr2line module
fdr400 Apr 28, 2026
89e24a6
better
fdr400 Apr 28, 2026
ff00de6
better
fdr400 Apr 28, 2026
4bad025
Merge branch 'feature/cxx20-modules' into feature/cxx20-modules-impor…
fdr400 May 2, 2026
aa8294a
use env
fdr400 May 2, 2026
88c7001
better check
fdr400 May 2, 2026
3291c63
fix warning
fdr400 May 2, 2026
09b0090
Merge branch 'develop' into feature/cxx20-modules-import-std
fdr400 May 9, 2026
28ea4a1
fix build
fdr400 May 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,28 @@ jobs:
make -j"$(nproc)"
make install

- name: Run modules tests
if: ${{matrix.toolset == 'clang-19'}}
run: |
cd ../boost-root/libs/$LIBRARY
cmake -S test/cmake_subdir_test \
-B build_module \
-GNinja \
-DBOOST_USE_MODULES=1 \
-DBUILD_TESTING=1 \
-DCMAKE_CXX_STANDARD=23 \
-DCMAKE_CXX_COMPILER=${{matrix.compiler}} \
-DCMAKE_CXX_FLAGS="-stdlib=libc++ -I$HOME/.local/include" \
-DCMAKE_EXE_LINKER_FLAGS="-L$HOME/.local" \
-DCMAKE_CXX_MODULE_STD=ON \
-DCMAKE_EXPERIMENTAL_CXX_IMPORT_STD=0e5b6991-d74f-4b3d-a41c-cf096e0b2508
cmake --build build_module
ctest --test-dir build_module -VV
rm -rf build_module

- name: Run modules tests without 'import std;'
if: ${{matrix.toolset == 'clang-19'}}
run: |
pwd
cd ../boost-root/libs/$LIBRARY
cmake -S test/cmake_subdir_test \
-B build_module \
Expand Down
48 changes: 34 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,24 @@ cmake_minimum_required(VERSION 3.8...4.20)

project(boost_stacktrace VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)

function(stacktrace_add_module name)
function(stacktrace_add_module name import_std)
target_sources(${name}
PUBLIC
FILE_SET CXX_MODULES
BASE_DIRS "${CMAKE_CURRENT_LIST_DIR}/modules"
FILES "${CMAKE_CURRENT_LIST_DIR}/modules/${name}.cppm"
)
target_compile_features(${name} PUBLIC cxx_std_20)
target_compile_definitions(${name} PUBLIC BOOST_USE_MODULES)

if(${import_std})
target_compile_features(${name} PUBLIC cxx_std_23)
target_compile_definitions(${name} PRIVATE BOOST_STACKTRACE_USE_STD_MODULE)
else()
target_compile_features(${name} PUBLIC cxx_std_20)
endif()
endfunction()

function(stacktrace_add_library suffix opt public_libs libs defs add_module)
function(stacktrace_add_library suffix opt public_libs libs defs add_module import_std)

if(NOT opt)
return()
Expand Down Expand Up @@ -50,7 +56,7 @@ function(stacktrace_add_library suffix opt public_libs libs defs add_module)
)

if (add_module)
stacktrace_add_module(boost_stacktrace_${suffix})
stacktrace_add_module(boost_stacktrace_${suffix} ${import_std})
else()
target_sources(boost_stacktrace_${suffix}
PRIVATE
Expand Down Expand Up @@ -129,23 +135,36 @@ else()
set(_enable_non_noop_backend FALSE)
endif()

if(NOT BOOST_USE_MODULES)
if(BOOST_USE_MODULES)
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 20)
endif()
if ((CMAKE_CXX_STANDARD IN_LIST CMAKE_CXX_COMPILER_IMPORT_STD) AND CMAKE_CXX_MODULE_STD)
message(STATUS "Using `import std;`")
set(__import_std ON)
else()
message(STATUS "`import std;` is not available")
set(__import_std OFF)
endif()
unset(__standard)
else()
set(BOOST_USE_MODULES OFF)
set(__import_std OFF)
endif()

stacktrace_add_library(dump ${_enable_non_noop_backend} "" "" "" ${BOOST_USE_MODULES})
stacktrace_add_library(noop ${BOOST_STACKTRACE_ENABLE_NOOP} "" "" "" ${BOOST_USE_MODULES})
stacktrace_add_library(backtrace ${BOOST_STACKTRACE_ENABLE_BACKTRACE} Boost::stacktrace_dump "backtrace;${CMAKE_DL_LIBS}" "" ${BOOST_USE_MODULES})
stacktrace_add_library(addr2line ${BOOST_STACKTRACE_ENABLE_ADDR2LINE} Boost::stacktrace_dump "${CMAKE_DL_LIBS}" "" ${BOOST_USE_MODULES})
stacktrace_add_library(basic ${BOOST_STACKTRACE_ENABLE_BASIC} Boost::stacktrace_dump "${CMAKE_DL_LIBS}" "" ${BOOST_USE_MODULES})
stacktrace_add_library(windbg ${BOOST_STACKTRACE_ENABLE_WINDBG} Boost::stacktrace_dump "dbgeng;ole32" "_GNU_SOURCE=1" ${BOOST_USE_MODULES})
stacktrace_add_library(windbg_cached ${BOOST_STACKTRACE_ENABLE_WINDBG_CACHED} Boost::stacktrace_dump "dbgeng;ole32" "_GNU_SOURCE=1" ${BOOST_USE_MODULES})
stacktrace_add_library(dump ${_enable_non_noop_backend} "" "" "" ${BOOST_USE_MODULES} ${__import_std})
stacktrace_add_library(noop ${BOOST_STACKTRACE_ENABLE_NOOP} "" "" "" ${BOOST_USE_MODULES} ${__import_std})
stacktrace_add_library(backtrace ${BOOST_STACKTRACE_ENABLE_BACKTRACE} Boost::stacktrace_dump "backtrace;${CMAKE_DL_LIBS}" "" ${BOOST_USE_MODULES} ${__import_std})
stacktrace_add_library(addr2line ${BOOST_STACKTRACE_ENABLE_ADDR2LINE} Boost::stacktrace_dump "${CMAKE_DL_LIBS}" "" ${BOOST_USE_MODULES} ${__import_std})
stacktrace_add_library(basic ${BOOST_STACKTRACE_ENABLE_BASIC} Boost::stacktrace_dump "${CMAKE_DL_LIBS}" "" ${BOOST_USE_MODULES} ${__import_std})
stacktrace_add_library(windbg ${BOOST_STACKTRACE_ENABLE_WINDBG} Boost::stacktrace_dump "dbgeng;ole32" "_GNU_SOURCE=1" ${BOOST_USE_MODULES} ${__import_std})
stacktrace_add_library(windbg_cached ${BOOST_STACKTRACE_ENABLE_WINDBG_CACHED} Boost::stacktrace_dump "dbgeng;ole32" "_GNU_SOURCE=1" ${BOOST_USE_MODULES} ${__import_std})

# boost_stacktrace, default library

if(BOOST_USE_MODULES)
add_library(boost_stacktrace)
stacktrace_add_module(boost_stacktrace boost_stacktrace)
stacktrace_add_module(boost_stacktrace ${__import_std})
set(__scope PUBLIC)

foreach(backend noop backtrace addr2line basic windbg windbg_cached)
Expand All @@ -157,6 +176,7 @@ else()
add_library(boost_stacktrace INTERFACE)
set(__scope INTERFACE)
endif()
unset(__import_std)

target_include_directories(boost_stacktrace ${__scope} "${CMAKE_CURRENT_LIST_DIR}/include")
add_library(Boost::stacktrace ALIAS boost_stacktrace)
Expand All @@ -182,7 +202,7 @@ target_link_libraries(boost_stacktrace ${__scope} Boost::stacktrace_${__default_

# Boost::stacktrace_from_exception is never the default
if(_enable_non_noop_backend)
stacktrace_add_library(from_exception ${BOOST_STACKTRACE_ENABLE_FROM_EXCEPTION} Boost::stacktrace_dump "${CMAKE_DL_LIBS}" "" FALSE)
stacktrace_add_library(from_exception ${BOOST_STACKTRACE_ENABLE_FROM_EXCEPTION} Boost::stacktrace_dump "${CMAKE_DL_LIBS}" "" FALSE FALSE)
endif()
unset(_enable_non_noop_backend)

Expand Down
4 changes: 2 additions & 2 deletions include/boost/stacktrace/detail/addr_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
# pragma once
#endif

#if !defined(BOOST_STACKTRACE_INTERFACE_UNIT)
#if !defined(BOOST_STACKTRACE_INTERFACE_UNIT) && !defined(BOOST_STACKTRACE_USE_STD_MODULE)
#include <fstream>
#include <sstream>
#include <cstdint>
#include <cstdlib>
#endif // !defined(BOOST_STACKTRACE_INTERFACE_UNIT)
#endif // !defined(BOOST_STACKTRACE_INTERFACE_UNIT) && !defined(BOOST_STACKTRACE_USE_STD_MODULE)

namespace boost { namespace stacktrace { namespace detail {

Expand Down
4 changes: 2 additions & 2 deletions include/boost/stacktrace/detail/frame_decl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
# pragma once
#endif

#if !defined(BOOST_STACKTRACE_INTERFACE_UNIT)
#if !defined(BOOST_STACKTRACE_INTERFACE_UNIT) && !defined(BOOST_STACKTRACE_USE_STD_MODULE)
#include <string>
#endif // !defined(BOOST_STACKTRACE_INTERFACE_UNIT)
#endif // !defined(BOOST_STACKTRACE_INTERFACE_UNIT) && !defined(BOOST_STACKTRACE_USE_STD_MODULE)

#if !defined(BOOST_USE_MODULES)
#include <boost/stacktrace/safe_dump_to.hpp>
Expand Down
2 changes: 2 additions & 0 deletions include/boost/stacktrace/detail/frame_unwind.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
#if !defined(BOOST_STACKTRACE_INTERFACE_UNIT)
#include <boost/core/demangle.hpp>

#if !defined(BOOST_STACKTRACE_USE_STD_MODULE)
#include <cstdio>
#endif // !defined(BOOST_STACKTRACE_USE_STD_MODULE)
#endif // !defined(BOOST_STACKTRACE_INTERFACE_UNIT)

#include <boost/stacktrace/frame.hpp>
Expand Down
4 changes: 2 additions & 2 deletions include/boost/stacktrace/detail/to_dec_array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
# pragma once
#endif

#if !defined(BOOST_STACKTRACE_INTERFACE_UNIT)
#if !defined(BOOST_STACKTRACE_INTERFACE_UNIT) && !defined(BOOST_STACKTRACE_USE_STD_MODULE)
#include <array>
#include <cstddef> // std::size_t
#endif // !defined(BOOST_STACKTRACE_INTERFACE_UNIT)
#endif // !defined(BOOST_STACKTRACE_INTERFACE_UNIT) && !defined(BOOST_STACKTRACE_USE_STD_MODULE)

namespace boost { namespace stacktrace { namespace detail {

Expand Down
4 changes: 2 additions & 2 deletions include/boost/stacktrace/detail/to_hex_array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
# pragma once
#endif

#if !defined(BOOST_STACKTRACE_INTERFACE_UNIT)
#if !defined(BOOST_STACKTRACE_INTERFACE_UNIT) && !defined(BOOST_STACKTRACE_USE_STD_MODULE)
#include <array>
#include <type_traits>
#endif // !defined(BOOST_STACKTRACE_INTERFACE_UNIT)
#endif // !defined(BOOST_STACKTRACE_INTERFACE_UNIT) && !defined(BOOST_STACKTRACE_USE_STD_MODULE)

namespace boost { namespace stacktrace { namespace detail {

Expand Down
4 changes: 2 additions & 2 deletions include/boost/stacktrace/detail/void_ptr_cast.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
# pragma once
#endif

#if !defined(BOOST_STACKTRACE_INTERFACE_UNIT)
#if !defined(BOOST_STACKTRACE_INTERFACE_UNIT) && !defined(BOOST_STACKTRACE_USE_STD_MODULE)
#include <type_traits>
#endif // !defined(BOOST_STACKTRACE_INTERFACE_UNIT)
#endif // !defined(BOOST_STACKTRACE_INTERFACE_UNIT) && !defined(BOOST_STACKTRACE_USE_STD_MODULE)

#if defined(__GNUC__) && defined(__GNUC_MINOR__) && (__GNUC__ * 100 + __GNUC_MINOR__ > 301)
# pragma GCC system_header
Expand Down
4 changes: 2 additions & 2 deletions include/boost/stacktrace/frame.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
# pragma once
#endif

#if !defined(BOOST_STACKTRACE_INTERFACE_UNIT)
#if !defined(BOOST_STACKTRACE_INTERFACE_UNIT) && !defined(BOOST_STACKTRACE_USE_STD_MODULE)
#include <iosfwd>
#include <string>
#endif // !defined(BOOST_STACKTRACE_INTERFACE_UNIT)
#endif // !defined(BOOST_STACKTRACE_INTERFACE_UNIT) && !defined(BOOST_STACKTRACE_USE_STD_MODULE)

#include <boost/stacktrace/detail/frame_decl.hpp>
#include <boost/stacktrace/detail/push_options.h>
Expand Down
3 changes: 3 additions & 0 deletions include/boost/stacktrace/safe_dump_to.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@
#endif

#if !defined(BOOST_STACKTRACE_INTERFACE_UNIT)

#if !defined(BOOST_STACKTRACE_USE_STD_MODULE)
#include <cstddef>
#endif // !defined(BOOST_STACKTRACE_USE_STD_MODULE)

#if defined(BOOST_WINDOWS)
#include <boost/winapi/config.hpp>
Expand Down
2 changes: 2 additions & 0 deletions include/boost/stacktrace/stacktrace.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@
#include <boost/core/no_exceptions_support.hpp>
#include <boost/container_hash/hash_fwd.hpp>

#if !defined(BOOST_STACKTRACE_USE_STD_MODULE)
#include <iosfwd>
#include <string>
#include <vector>

#ifndef BOOST_NO_CXX11_HDR_TYPE_TRAITS
# include <type_traits>
#endif
#endif // !defined(BOOST_STACKTRACE_USE_STD_MODULE)
#endif // !defined(BOOST_STACKTRACE_INTERFACE_UNIT)

#include <boost/stacktrace/stacktrace_fwd.hpp>
Expand Down
4 changes: 2 additions & 2 deletions include/boost/stacktrace/stacktrace_fwd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@

#if !defined(BOOST_USE_MODULES) || defined(BOOST_STACKTRACE_INTERFACE_UNIT)

#if !defined(BOOST_STACKTRACE_INTERFACE_UNIT)
#if !defined(BOOST_STACKTRACE_INTERFACE_UNIT) && !defined(BOOST_STACKTRACE_USE_STD_MODULE)
#include <cstddef>
#include <memory>
#endif // !defined(BOOST_STACKTRACE_INTERFACE_UNIT)
#endif // !defined(BOOST_STACKTRACE_INTERFACE_UNIT) && !defined(BOOST_STACKTRACE_USE_STD_MODULE)

/// @file stacktrace_fwd.hpp This header contains only forward declarations of
/// boost::stacktrace::frame, boost::stacktrace::basic_stacktrace, boost::stacktrace::stacktrace
Expand Down
6 changes: 6 additions & 0 deletions modules/boost_stacktrace_addr2line.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ module;
#include <boost/container_hash/hash_fwd.hpp>
#include <boost/predef.h>

#if !defined(BOOST_STACKTRACE_USE_STD_MODULE)
#include <vector>
#include <fstream>
#include <sstream>
#include <cxxabi.h>
#endif

#include <sys/types.h>
#include <sys/wait.h>
Expand All @@ -34,6 +36,10 @@ module;

export module boost.stacktrace.addr2line;

#if defined(BOOST_STACKTRACE_USE_STD_MODULE)
import std;
#endif

import boost.stacktrace.dump;

#ifdef __clang__
Expand Down
6 changes: 6 additions & 0 deletions modules/boost_stacktrace_backtrace.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ module;

#include <backtrace.h>

#if !defined(BOOST_STACKTRACE_USE_STD_MODULE)
#include <vector>
#include <fstream>
#include <sstream>
#include <cxxabi.h>
#endif

#include <dlfcn.h>

Expand All @@ -32,6 +34,10 @@ module;

export module boost.stacktrace.backtrace;

#if defined(BOOST_STACKTRACE_USE_STD_MODULE)
import std;
#endif

import boost.stacktrace.dump;

#ifdef __clang__
Expand Down
6 changes: 6 additions & 0 deletions modules/boost_stacktrace_basic.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ module;
#include <boost/container_hash/hash_fwd.hpp>
#include <boost/predef.h>

#if !defined(BOOST_STACKTRACE_USE_STD_MODULE)
#include <vector>
#include <fstream>
#include <sstream>
#include <cxxabi.h>
#endif

#include <dlfcn.h>

Expand All @@ -30,6 +32,10 @@ module;

export module boost.stacktrace.basic;

#if defined(BOOST_STACKTRACE_USE_STD_MODULE)
import std;
#endif

import boost.stacktrace.dump;

#ifdef __clang__
Expand Down
9 changes: 8 additions & 1 deletion modules/boost_stacktrace_dump.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,23 @@ module;
#include <boost/config.hpp>
#include <boost/predef.h>

#if !defined(BOOST_STACKTRACE_USE_STD_MODULE)
#include <stdio.h>
#endif

#include <fcntl.h>
#include <unwind.h>
#include <stdio.h>
#include <sys/stat.h>

#define BOOST_STACKTRACE_INTERFACE_UNIT
#define BOOST_STACKTRACE_LINK

export module boost.stacktrace.dump;

#if defined(BOOST_STACKTRACE_USE_STD_MODULE)
import std;
#endif

#ifdef __clang__
# pragma clang diagnostic ignored "-Winclude-angled-in-module-purview"
#endif
Expand Down
6 changes: 6 additions & 0 deletions modules/boost_stacktrace_noop.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,20 @@ module;
#include <boost/core/no_exceptions_support.hpp>
#include <boost/container_hash/hash_fwd.hpp>

#if !defined(BOOST_STACKTRACE_USE_STD_MODULE)
#include <vector>
#include <memory>
#endif

#define BOOST_STACKTRACE_INTERFACE_UNIT
#define BOOST_STACKTRACE_LINK

export module boost.stacktrace.noop;

#if defined(BOOST_STACKTRACE_USE_STD_MODULE)
import std;
#endif

#ifdef __clang__
# pragma clang diagnostic ignored "-Winclude-angled-in-module-purview"
#endif
Expand Down
5 changes: 3 additions & 2 deletions modules/samples/usage_sample_from_exception.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// http://www.boost.org/LICENSE_1_0.txt)

#include <iostream>
#include <stdexcept>
#include <map>

#include <boost/config.hpp>

Expand All @@ -15,7 +15,8 @@
namespace {

BOOST_NOINLINE void foo() {
throw std::logic_error{"Foo"};
std::map<int, int> m;
std::ignore = m.at(1);
}

BOOST_NOINLINE void bar() {
Expand Down
Loading