[llvm-branch-commits] [clang-tidy] Add FixIts for libc namespace macros (PR #99681)

Julian Schmidt via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sat Jul 20 10:00:22 PDT 2024


================
@@ -51,7 +78,9 @@ void ImplementationInNamespaceCheck::check(
   // instead.
   if (NS->getVisibility() != Visibility::HiddenVisibility) {
     diag(NS->getLocation(), "the '%0' macro should start with '%1'")
-        << RequiredNamespaceDeclMacroName << RequiredNamespaceDeclStart;
+        << RequiredNamespaceDeclMacroName << RequiredNamespaceDeclStart
+        << FixItHint::CreateReplacement(NS->getLocation(),
+                                        RequiredNamespaceDeclMacroName);
----------------
5chmidti wrote:

You probably would want to add an include in this case as well, given that you're adding the same macro as above.

https://github.com/llvm/llvm-project/pull/99681


More information about the llvm-branch-commits mailing list