[Mlir-commits] [llvm] [mlir] eliminating g++ warnings (PR #105520)
Jakub Kuderski
llvmlistbot at llvm.org
Wed Aug 21 09:32:53 PDT 2024
================
@@ -1593,7 +1593,8 @@ foldTrait(Operation *, ArrayRef<Attribute>, SmallVectorImpl<OpFoldResult> &) {
/// Given a tuple type containing a set of traits, return the result of folding
/// the given operation.
template <typename... Ts>
-static LogicalResult foldTraits(Operation *op, ArrayRef<Attribute> operands,
+static LogicalResult foldTraits([[maybe_unused]] Operation *op,
+ [[maybe_unused]] ArrayRef<Attribute> operands,
----------------
kuhar wrote:
another workaround is to add a base case and then the rest of the parameter pack:
```c++
template <typename First, typename... Rest>
static LogicalResult foldTraits([[maybe_unused]] Operation *op,
[[maybe_unused]] ArrayRef<Attribute> operands,
SmallVectorImpl<OpFoldResult> &results) {
return success((succeeded(foldTrait<First>(op, operands, results) || succeeded(foldTrait<Rest>(op, operands, results)) || ...));
}
```
https://github.com/llvm/llvm-project/pull/105520
More information about the Mlir-commits
mailing list