-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds patch for nvcc error with
using namespace std
and fmt
Bugfix adapted from Ryan Quinlan's solution Co-Authored-By: Ryan Quinlan <[email protected]>
- Loading branch information
1 parent
c4024d4
commit 332f3d7
Showing
3 changed files
with
56 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
diff --git a/src/thirdparty/axom/fmt/format-inl.h b/src/thirdparty/axom/fmt/format-inl.h | ||
index ff6e6323f..efdbeb40a 100644 | ||
--- a/src/thirdparty/axom/fmt/format-inl.h | ||
+++ b/src/thirdparty/axom/fmt/format-inl.h | ||
@@ -121,11 +121,17 @@ template <typename Char> AXOM_FMT_FUNC Char decimal_point_impl(locale_ref) { | ||
AXOM_FMT_API AXOM_FMT_FUNC format_error::~format_error() noexcept = default; | ||
#endif | ||
|
||
-AXOM_FMT_FUNC std::system_error vsystem_error(int error_code, string_view format_str, | ||
+// BEGIN AXOM BUGFIX | ||
+// NVCC's preprocessor converts 'std::error_code' to `class std::error_code' | ||
+// and then complains that `return class std::error_code' isn't valid! | ||
+using axom_fmt_system_error = std::system_error; | ||
+ | ||
+AXOM_FMT_FUNC axom_fmt_system_error vsystem_error(int error_code, string_view format_str, | ||
format_args args) { | ||
auto ec = std::error_code(error_code, std::generic_category()); | ||
- return std::system_error(ec, vformat(format_str, args)); | ||
+ return axom_fmt_system_error(ec, vformat(format_str, args)); | ||
} | ||
+// END AXOM BUGFIX | ||
|
||
namespace detail { | ||
|
||
@@ -1449,16 +1455,18 @@ AXOM_FMT_FUNC detail::utf8_to_utf16::utf8_to_utf16(string_view s) { | ||
buffer_.push_back(0); | ||
} | ||
|
||
+// BEGIN AXOM BUGFIX | ||
AXOM_FMT_FUNC void format_system_error(detail::buffer<char>& out, int error_code, | ||
const char* message) noexcept { | ||
AXOM_FMT_TRY { | ||
auto ec = std::error_code(error_code, std::generic_category()); | ||
- write(std::back_inserter(out), std::system_error(ec, message).what()); | ||
+ write(std::back_inserter(out), axom_fmt_system_error(ec, message).what()); | ||
return; | ||
} | ||
AXOM_FMT_CATCH(...) {} | ||
format_error_code(out, error_code, message); | ||
} | ||
+// END AXOM BUGFIX | ||
|
||
AXOM_FMT_FUNC void report_system_error(int error_code, | ||
const char* message) noexcept { |