Skip to content

Commit

Permalink
Adds using namespace std to fmt's smoke test
Browse files Browse the repository at this point in the history
This generates a compiler error w/ nvcc. It's preprocessor replaces
`std:runtime_error` with `class std::runtime_error' and then complains
that `return class std::runtime_error' is invalid.

Credit: Ryan Quinlan provided this simple reproducer and the key to a simple fix

Co-Authored-By: Ryan Quinlan <[email protected]>
  • Loading branch information
kennyweiss and Ryan Quinlan committed Jan 24, 2023
1 parent 4b5166f commit bc691ca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/thirdparty/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,14 @@ endif()
#------------------------------------------------------------------------------
# Smoke test for fmt third party library
#------------------------------------------------------------------------------
set(fmt_smoke_dependencies fmt gtest)
blt_list_append( TO fmt_smoke_dependencies ELEMENTS cuda IF ENABLE_CUDA)

blt_add_executable(
NAME fmt_smoke_test
SOURCES fmt_smoke.cpp
OUTPUT_DIR ${TEST_OUTPUT_DIRECTORY}
DEPENDS_ON fmt gtest
DEPENDS_ON ${fmt_smoke_dependencies}
FOLDER axom/thirdparty/tests )

axom_add_test(NAME fmt_smoke
Expand Down
4 changes: 4 additions & 0 deletions src/thirdparty/tests/fmt_smoke.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@

#include "gtest/gtest.h"

// Note: The following line generates an error with nvcc on [email protected]
// Axom has a patch to workaround this error.
using namespace std;

//-----------------------------------------------------------------------------
TEST(fmt_smoke, basic_use)
{
Expand Down

0 comments on commit bc691ca

Please sign in to comment.