njames93 removed reviewers: artem.tamazov, yaxunl, carlosgalvezp, MaskRay, mstorsjo, balazske. njames93 added a comment. This revision now requires review to proceed.
What is the motivation for requiring these to be the arguments of call or construct expressions? Would be nice to add a note with an embedded fixit to silence this warning. Something like this, though you may need to use the Lexer to get the correct location to insert the `)`. auto Note = diag(MatchedExpr->getBeginLoc(), "insert an explicit cast to silence this warning", DiagnosticIDs::Note); if (Result.Context->getLangOpts().CPlusPlus11) Note << FixItHint::CreateInsertion(MatchedExpr->getBeginLoc(), "static_cast<int>(") << FixItHint::CreateInsertion(MatchedExpr->getEndLoc().getLocWithOffset(1), ")"); else Note << FixItHint::CreateInsertion(MatchedExpr->getBeginLoc(), "(int)"); ================ Comment at: clang-tools-extra/clang-tidy/bugprone/EnumToIntCheck.cpp:28 +void EnumToIntCheck::check(const MatchFinder::MatchResult &Result) { + // FIXME: Add callback implementation. + const auto *MatchedExpr = Result.Nodes.getNodeAs<Expr>("x"); ---------------- Remove this. ================ Comment at: clang-tools-extra/clang-tidy/bugprone/EnumToIntCheck.h:18 + +/// FIXME: Write a short description. +/// ---------------- FIXME CHANGES SINCE LAST ACTION https://reviews.llvm.org/D129570/new/ https://reviews.llvm.org/D129570 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits