Skip to content

Commit

Permalink
[mlir] Silence a few -Wunused-but-set-parameter warnings
Browse files Browse the repository at this point in the history
Some older versions of gcc hit false positives here:

/workdir/llvm-project/mlir/include/mlir/IR/Attributes.h:391:49: warning: parameter 'ty' set but not used [-Wunused-but-set-parameter]
  391 |   static inline bool isPossible(mlir::Attribute ty) {

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81676
  • Loading branch information
rkayaith committed Feb 15, 2023
1 parent 22f0c7a commit 82ae83a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions mlir/include/mlir/IR/Attributes.h
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@ struct CastInfo<To, From,
/// Return a constant true instead of a dynamic true when casting to self or
/// up the hierarchy.
if constexpr (std::is_base_of_v<To, From>) {
(void)ty;
return true;
} else {
return To::classof(ty);
Expand Down
1 change: 1 addition & 0 deletions mlir/include/mlir/IR/Types.h
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ struct CastInfo<
/// Return a constant true instead of a dynamic true when casting to self or
/// up the hierarchy.
if constexpr (std::is_base_of_v<To, From>) {
(void)ty;
return true;
} else {
return To::classof(ty);
Expand Down
1 change: 1 addition & 0 deletions mlir/include/mlir/IR/Value.h
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,7 @@ struct CastInfo<
/// Return a constant true instead of a dynamic true when casting to self or
/// up the hierarchy.
if constexpr (std::is_base_of_v<To, From>) {
(void)ty;
return true;
} else {
return To::classof(ty);
Expand Down

0 comments on commit 82ae83a

Please sign in to comment.