From 7e57cace5dacceaa31e983fdc2d1e279d36f1dca Mon Sep 17 00:00:00 2001 From: James Beach Date: Mon, 4 May 2020 14:21:21 +0100 Subject: [PATCH] Exclude std::abort from compilation when compiling CUDA with Clang (#1661) --- include/fmt/format-inl.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/fmt/format-inl.h b/include/fmt/format-inl.h index 258b3ae1..7836255f 100644 --- a/include/fmt/format-inl.h +++ b/include/fmt/format-inl.h @@ -15,6 +15,7 @@ #include #include // for std::memmove #include +#include #include "format.h" #if !defined(FMT_STATIC_THOUSANDS_SEPARATOR) @@ -47,7 +48,9 @@ namespace internal { FMT_FUNC void assert_fail(const char* file, int line, const char* message) { print(stderr, "{}:{}: assertion failed: {}", file, line, message); - std::abort(); + // Chosen instead of std::abort to satisfy Clang in CUDA mode during device + // code pass. + std::terminate(); } #ifndef _MSC_VER