[PATCH] D80531: [clang-tidy]: Added modernize-replace-disallow-copy-and-assign-macro
Konrad Wilhelm Kleine via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue May 26 03:11:50 PDT 2020
kwk marked 2 inline comments as done.
kwk added a comment.
@njames93 I've implemented everything you've mentioned. This simplified a lot.
================
Comment at: clang-tools-extra/docs/clang-tidy/checks/modernize-replace-disallow-copy-and-assign-macro.rst:41
+
+.. option:: FinalizeWithSemicolon
+
----------------
njames93 wrote:
> This option should be removed and instead infer the value dynamically by checking the token directly after the macro use to see if its a semi-colon.
>
> Something like this in the PPCallback should get you there
> ```
> bool shouldAppendSemi(SourceRange MacroLoc) {
> llvm::Optional<Token> Next =
> Lexer::findNextToken(MacroLoc.getEnd(), SM, PP.getLangOpts());
> return !(Next && Next->is(tok::semi));
> }```
Thank you so much for this!
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D80531/new/
https://reviews.llvm.org/D80531
More information about the cfe-commits
mailing list