[PATCH] D116378: [clang-tidy] Disable clang-tidy warnings from system macros

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 6 11:03:04 PST 2022


aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.

LGTM aside from a minor nit, thanks! This was a good catch.



================
Comment at: clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeVarargCheck.cpp:32-33
+      Check->diag(MacroNameTok.getLocation(),
+                  "do not use va_arg to define c-style vararg functions; "
+                  "use variadic templates instead");
+    }
----------------
Rather than duplicate the diagnostic text, I think we should hoist the text into a constant string that's used in both places.

That makes it easier to fix the diagnostic (in a follow up) to properly quote `va_arg` and convert the grammar to singular form instead of plural (e.g, `do not use 'va_arg' to define a C-style vararg function; use a variadic template instead`).


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116378/new/

https://reviews.llvm.org/D116378



More information about the cfe-commits mailing list