Add assert_is_void_test2.cpp

This commit is contained in:
Peter Dimov
2026-06-27 15:49:44 +03:00
parent d82647a6c1
commit af978cfa53
2 changed files with 38 additions and 0 deletions
+1
View File
@@ -48,3 +48,4 @@ run source_location_test6.cpp ;
run assert_test3.cpp ;
run assert_test4.cpp ;
run assert_is_void_test2.cpp ;
+37
View File
@@ -0,0 +1,37 @@
// Copyright 2015 Ion Gaztanaga
// Copyright 2026 Peter Dimov
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
// BOOST_ENABLE_ASSERT_HANDLER, BOOST_ENABLE_ASSERT_DEBUG_HANDLER
#define BOOST_ENABLE_ASSERT_HANDLER
#define BOOST_ENABLE_ASSERT_DEBUG_HANDLER
#include <boost/assert.hpp>
#if defined(NDEBUG)
#ifndef BOOST_ASSERT_IS_VOID
#error "BOOST_ASSERT should be void if BOOST_ENABLE_ASSERT_HANDLER, BOOST_ENABLE_ASSERT_DEBUG_HANDLER, and NDEBUG are defined"
#endif
#else
#ifdef BOOST_ASSERT_IS_VOID
#error "BOOST_ASSERT should NOT be void if BOOST_ENABLE_ASSERT_HANDLER and BOOST_ENABLE_ASSERT_DEBUG_HANDLER are defined, but NDEBUG is not"
#endif
#endif
// +BOOST_DISABLE_ASSERTS
#define BOOST_DISABLE_ASSERTS
#include <boost/assert.hpp>
#ifndef BOOST_ASSERT_IS_VOID
#error "Error: BOOST_ASSERT should always be void with BOOST_DISABLE_ASSERTS"
#endif
int main()
{
}