Skip to content

Commit

Permalink
Use maybe_unused to workaround the clang bug of mis-reporting unused …
Browse files Browse the repository at this point in the history
…type alias
  • Loading branch information
zanmato1984 committed Jan 24, 2025
1 parent d37672e commit 0f740aa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cpp/src/arrow/testing/generator.h
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,9 @@ template <typename T = uint32_t>
ARROW_TESTING_EXPORT std::shared_ptr<ArrayGenerator> Step(T start = 0, T step = 1) {
class StepGenerator : public ArrayGenerator {
public:
using ArrowType = typename CTypeTraits<T>::ArrowType;
// Use [[maybe_unused]] to avoid a compiler warning in Clang versions before 15 that
// incorrectly reports 'unused type alias'.
using ArrowType [[maybe_unused]] = typename CTypeTraits<T>::ArrowType;
static_assert(is_number_type<ArrowType>::value,
"Step generator only supports numeric types");

Expand Down

0 comments on commit 0f740aa

Please sign in to comment.