[clang] [Clang][Sema] clang generates incorrect fix-its for API_AVAILABLE (PR #105855)

via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 23 09:56:06 PDT 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff a2d8743cc86f96f6b1cbd85798328bd3fb2bf4de 4cbf377e71fe7bd3503fc51c0217d5bb3ae6355e --extensions cpp -- clang/lib/Sema/SemaAvailability.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/Sema/SemaAvailability.cpp b/clang/lib/Sema/SemaAvailability.cpp
index bd6e85110e..11f5a9a985 100644
--- a/clang/lib/Sema/SemaAvailability.cpp
+++ b/clang/lib/Sema/SemaAvailability.cpp
@@ -502,12 +502,13 @@ static void DoEmitAvailabilityWarning(Sema &S, AvailabilityResult K,
       // API_AVAILABLE(ios(17.0))
       // __attribute__((availability(__API_AVAILABLE_PLATFORM_ios(17.0)))
       // __attribute__((availability(ios,introduced=17.0)))
-      // In other words, the platform name in API_AVAILABLE has to be backed by an
+      // In other words, the platform name in API_AVAILABLE has to be backed by
+      // an
       // __API_AVAILABLE_PLATFORM_ macro. The __API_AVAILABLE_PLATFORM_ macros
-      // aren't consistent with using the canonical platform name, source spelling
-      // name, or one of the other supported names (i.e. one of the keys in
-      // canonicalizePlatformName that's neither). Look for a macro matching any
-      // of the supported attribute names.
+      // aren't consistent with using the canonical platform name, source
+      // spelling name, or one of the other supported names (i.e. one of the
+      // keys in canonicalizePlatformName that's neither). Look for a macro
+      // matching any of the supported attribute names.
       llvm::Twine MacroPrefix = "__API_AVAILABLE_PLATFORM_";
       StringRef AvailabilityPlatform = {};
       for (StringRef EquivalentPlatform :

``````````

</details>


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


More information about the cfe-commits mailing list