Skip to content

Commit 02256c8

Browse files
committed
Do not use std::source_location::current under nvcc. Fixes boostorg#32.
1 parent f10ddd6 commit 02256c8

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

include/boost/assert/source_location.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,10 @@ template<class E, class T> std::basic_ostream<E, T> & operator<<( std::basic_ost
161161

162162
# define BOOST_CURRENT_LOCATION ::boost::source_location(__FILE__, BOOST_CURRENT_LOCATION_IMPL_1(__LINE__), "")
163163

164-
#elif defined(__cpp_lib_source_location) && __cpp_lib_source_location >= 201907L
164+
#elif defined(__cpp_lib_source_location) && __cpp_lib_source_location >= 201907L && !defined(__NVCC__)
165+
166+
// Under nvcc, __builtin_source_location is not constexpr
167+
// https://github.com/boostorg/assert/issues/32
165168

166169
# define BOOST_CURRENT_LOCATION ::boost::source_location(::std::source_location::current())
167170

0 commit comments

Comments
 (0)