curdeius added inline comments.
================ Comment at: clang-tidy/modernize/UseNodiscardCheck.cpp:65 +void UseNodiscardCheck::registerMatchers(MatchFinder *Finder) { + // If we are using C++17 attributes we are going to need c++17 + if (NoDiscardMacro == "[[nodiscard]]") { ---------------- I'd suggets: ` // If we use [[nodiscard]] attribute, we require at least C++17.` ================ Comment at: clang-tidy/modernize/UseNodiscardCheck.cpp:73 + // c++17 compilers. + if (!getLangOpts().CPlusPlus) + return; ---------------- I'd move this if to the bottom of the function as it's the most general one and fix the comment above: e.g. `// Ignore non-C++ code.`. ================ Comment at: clang-tidy/modernize/UseNodiscardCheck.cpp:92 + SourceLocation Loc = MatchedDecl->getLocation(); + if (!Loc.isValid() || Loc.isMacroID()) + return; ---------------- You can simplify `!Loc.isValid()` to `Loc.isInvalid()`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55433/new/ https://reviews.llvm.org/D55433 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits