[clang] [clang] Improve diagnostic if intrin.h used in incompatible environments (PR #234114)

via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 21 01:52:22 PDT 2026


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 cpp,h -- clang/test/Headers/intrin-non-windows.cpp clang/lib/Headers/intrin.h --diff_from_common_commit
``````````

: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/intrin.h b/clang/lib/Headers/intrin.h
index 7396e476d..4026d9c34 100644
--- a/clang/lib/Headers/intrin.h
+++ b/clang/lib/Headers/intrin.h
@@ -9,7 +9,8 @@
 
 /* Only include this if we're compiling for the windows platform. */
 #if !defined(_WIN32)
-#error "<intrin.h> is a Windows-only header and is not available on this platform"
+#error                                                                         \
+    "<intrin.h> is a Windows-only header and is not available on this platform"
 #elif !defined(_MSC_VER)
 #include_next <intrin.h>
 #else

``````````

</details>


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


More information about the cfe-commits mailing list