zanmato1984 commented on code in PR #45345:
URL: https://github.com/apache/arrow/pull/45345#discussion_r1928997718
##########
cpp/src/arrow/testing/generator.h:
##########
@@ -301,12 +302,48 @@ ARROW_TESTING_EXPORT std::shared_ptr<DataGenerator> Gen(
/// make a generator that returns a constant value
ARROW_TESTING_EXPORT std::shared_ptr<ArrayGenerator> Constant(
std::shared_ptr<Scalar> value);
+
/// make a generator that returns an incrementing value
///
/// Note: overflow is not prevented standard unsigned integer overflow applies
-ARROW_TESTING_EXPORT std::shared_ptr<ArrayGenerator> Step(uint32_t start = 0,
- uint32_t step = 1,
- bool signed_int =
false);
+template <typename T = uint32_t>
+ARROW_TESTING_EXPORT std::shared_ptr<ArrayGenerator> Step(T start = 0, T step
= 1) {
+ class StepGenerator : public ArrayGenerator {
+ public:
+ // Use [[maybe_unused]] to avoid a compiler warning in Clang versions
before 15 that
Review Comment:
This is weird but it seems to be a clang bug.
CI failure:
https://github.com/apache/arrow/actions/runs/12952919478/job/36131370510?pr=45345
```
/arrow/cpp/src/arrow/testing/generator.h:313:11: error: unused type alias
'ArrowType' [-Werror,-Wunused-local-typedef]
using ArrowType = typename CTypeTraits<T>::ArrowType;
^
```
A SO thread:
https://stackoverflow.com/questions/50205243/clang-emits-an-unused-type-alias-warning-for-a-type-alias-that-is-used
Reproduction on Clang 14: https://godbolt.org/z/hsnh6cGh8
Clang 15 (works fine): https://godbolt.org/z/x5zTe7j64
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]