[clang] [Clang][Headers] Fix tgmath.h incompatibility with Glibc (PR #161301)

via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 1 16:48:28 PDT 2025


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 origin/main HEAD --extensions h -- clang/lib/Headers/tgmath.h
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

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

``````````diff
diff --git a/clang/lib/Headers/tgmath.h b/clang/lib/Headers/tgmath.h
index e79e84b1c..594e44d55 100644
--- a/clang/lib/Headers/tgmath.h
+++ b/clang/lib/Headers/tgmath.h
@@ -17,7 +17,8 @@
  * platforms. This is done after #include <math.h> to avoid depcycle conflicts
  * between libcxx and darwin in C++ modules builds.
  */
-#if (defined(__APPLE__) && __STDC_HOSTED__ && __has_include_next(<tgmath.h>)) || defined(__GLIBC__)
+#if (defined(__APPLE__) && __STDC_HOSTED__ &&                                  \
+     __has_include_next(<tgmath.h>)) || defined(__GLIBC__)
 #  include_next <tgmath.h>
 #else
 

``````````

</details>


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


More information about the cfe-commits mailing list