Skip to content

Commit d4cdeeb

Browse files
committed
-Wno-unused-but-set-parameter for gcc<14; no [[maybe-unused]] for related cases
1 parent dcf6b98 commit d4cdeeb

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

mlir/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ append_if(C_SUPPORTS_WERROR_MISMATCHED_TAGS "-Werror=mismatched-tags" CMAKE_CXX_
8888
# cases, by marking SelectedCase as used. See
8989
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85827 for details. The issue is
9090
# fixed in GCC 10.
91-
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "10.0")
91+
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "14.0")
9292
check_cxx_compiler_flag("-Wno-unused-but-set-parameter" CXX_SUPPORTS_WNO_UNUSED_BUT_SET_PARAMETER)
9393
append_if(CXX_SUPPORTS_WNO_UNUSED_BUT_SET_PARAMETER "-Wno-unused-but-set-parameter" CMAKE_CXX_FLAGS)
9494
endif()

mlir/include/mlir/IR/OpDefinition.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1593,8 +1593,7 @@ foldTrait(Operation *, ArrayRef<Attribute>, SmallVectorImpl<OpFoldResult> &) {
15931593
/// Given a tuple type containing a set of traits, return the result of folding
15941594
/// the given operation.
15951595
template <typename... Ts>
1596-
static LogicalResult foldTraits([[maybe_unused]] Operation *op,
1597-
[[maybe_unused]] ArrayRef<Attribute> operands,
1596+
static LogicalResult foldTraits(Operation *op, ArrayRef<Attribute> operands,
15981597
SmallVectorImpl<OpFoldResult> &results) {
15991598
return success((succeeded(foldTrait<Ts>(op, operands, results)) || ...));
16001599
}
@@ -1650,7 +1649,7 @@ verifyRegionTrait(Operation *) {
16501649
/// Given a set of traits, return the result of verifying the regions of the
16511650
/// given operation.
16521651
template <typename... Ts>
1653-
LogicalResult verifyRegionTraits([[maybe_unused]] Operation *op) {
1652+
LogicalResult verifyRegionTraits(Operation *op) {
16541653
return success((succeeded(verifyRegionTrait<Ts>(op)) && ...));
16551654
}
16561655
} // namespace op_definition_impl

0 commit comments

Comments
 (0)