From 02256c84fd0cd58a139d9dc1b25b5019ca976ada Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 22 Jun 2023 18:11:58 +0300 Subject: [PATCH] Do not use std::source_location::current under nvcc. Fixes #32. --- include/boost/assert/source_location.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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())