This is an archive of the discontinued LLVM Phabricator instance.

Eliminate gcc7 compiler warnings
ClosedPublic

Authored by lipracer on Mar 26 2022, 6:50 AM.

Details

Summary

we will get warning:`parameter ‘op’ set but not used``` when template function with empty template parameter list.

Diff Detail

Event Timeline

lipracer created this revision.Mar 26 2022, 6:50 AM
Herald added a project: Restricted Project. · View Herald Transcript
lipracer requested review of this revision.Mar 26 2022, 6:50 AM
This revision is now accepted and ready to land.Mar 26 2022, 9:13 AM
lipracer added a comment.EditedMar 26 2022, 10:34 AM

Thanks for the review.
If we use c++20, we can write verify function like this:

if constexpr (!std::tuple_size<TraitTupleT>()) const {

return success();

} else {

verifyTraits(op);

}
Unfortunately we now need to use SFINAE or Template Specialization. Maybe we can also pass Operation& with side effect instead of Operation* .
I'm not sure this change is necessary.

This revision was automatically updated to reflect the committed changes.