diff --git a/include/boost/assert/source_location.hpp b/include/boost/assert/source_location.hpp index 0d76858..09770f7 100644 --- a/include/boost/assert/source_location.hpp +++ b/include/boost/assert/source_location.hpp @@ -161,7 +161,10 @@ template std::basic_ostream & operator<<( std::basic_ost # define BOOST_CURRENT_LOCATION ::boost::source_location(__FILE__, BOOST_CURRENT_LOCATION_IMPL_1(__LINE__), "") -#elif defined(__cpp_lib_source_location) && __cpp_lib_source_location >= 201907L +#elif defined(__cpp_lib_source_location) && __cpp_lib_source_location >= 201907L && !defined(__NVCC__) + +// Under nvcc, __builtin_source_location is not constexpr +// https://github.com/boostorg/assert/issues/32 # define BOOST_CURRENT_LOCATION ::boost::source_location(::std::source_location::current())