It seems prefereable to get a hard error if this file is built
incorrectly, rather than failing to define any symbols.
libstdc++-v3/ChangeLog:
* src/experimental/contract26.cc: Use #error if built without
contracts support enabled.
* include/std/source_location: Remove stray whitespace.
constexpr source_location (const void *__t)
: _M_impl (static_cast <const __impl*>(__t)) {}
-
+
#ifdef __cpp_lib_contracts
/* To enable use of the source __impl*. */
friend class std::contracts::contract_violation;
#include <contracts>
-#ifdef __cpp_lib_contracts
+#ifndef __cpp_lib_contracts
+# error "This file requires C++26 contracts support to be enabled"
+#endif
+
#if _GLIBCXX_HOSTED && _GLIBCXX_VERBOSE
# include <iostream>
# include <cxxabi.h>
{ invoke_default_contract_violation_handler(violation); }
#endif
-#endif // __cpp_lib_contracts