Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions include/openPMD/backend/Attribute.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ class Attribute
template <typename T, typename U>
auto doConvert(T *pv) -> U
{
(void)pv;
if constexpr (std::is_convertible_v<T, U>)
{
return static_cast<U>(*pv);
Expand All @@ -132,7 +133,7 @@ auto doConvert(T *pv) -> U
typename T::value_type,
typename U::value_type>)
{
U res;
U res{};
res.reserve(pv->size());
std::copy(pv->begin(), pv->end(), std::back_inserter(res));
return res;
Expand All @@ -149,7 +150,7 @@ auto doConvert(T *pv) -> U
typename T::value_type,
typename U::value_type>)
{
U res;
U res{};
res.reserve(pv->size());
std::copy(pv->begin(), pv->end(), std::back_inserter(res));
return res;
Expand All @@ -167,7 +168,7 @@ auto doConvert(T *pv) -> U
typename T::value_type,
typename U::value_type>)
{
U res;
U res{};
if (res.size() != pv->size())
{
throw std::runtime_error(
Expand All @@ -189,7 +190,7 @@ auto doConvert(T *pv) -> U
{
if constexpr (std::is_convertible_v<T, typename U::value_type>)
{
U res;
U res{};
res.reserve(1);
res.push_back(static_cast<typename U::value_type>(*pv));
return res;
Expand All @@ -199,7 +200,6 @@ auto doConvert(T *pv) -> U
"getCast: no scalar to vector conversion possible.");
}

(void)pv;
throw std::runtime_error("getCast: no cast possible.");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to put these into an else branch, ICC seems to determine unreachable statements after resolving if constexpr

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah classic. a range of NVCC 11 minor releases does that as well

}

Expand Down
6 changes: 6 additions & 0 deletions test/SerialIOTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,11 @@ TEST_CASE("available_chunks_test_json", "[serial][json]")

TEST_CASE("multiple_series_handles_test", "[serial]")
{
/*
* clang also understands these pragmas.
*/
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
Copy link
Member

@ax3l ax3l Mar 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this one set, you can remove -Wno-deprecated-declarations from quite a few CI scripts in .github/workflows/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-> #1246

/*
* First test: No premature flushes through destructor when another copy
* is still around
Expand Down Expand Up @@ -456,6 +461,7 @@ TEST_CASE("multiple_series_handles_test", "[serial]")
*/
series_ptr->flush();
}
#pragma GCC diagnostic pop
}

void close_iteration_test(std::string file_ending)
Expand Down