[libcxx-commits] [libcxx] [libc++] Add __assertion_handler as forwarding header (PR #134351)

Takuto Ikuta via libcxx-commits libcxx-commits at lists.llvm.org
Tue Apr 8 01:01:44 PDT 2025


https://github.com/atetubou updated https://github.com/llvm/llvm-project/pull/134351

>From 13d936d561e14a0e015387b9dcb81aacf9037004 Mon Sep 17 00:00:00 2001
From: Takuto Ikuta <tikuta at google.com>
Date: Tue, 8 Apr 2025 17:00:09 +0900
Subject: [PATCH] [libc++] Add __assertion_handler as forwarding header

After https://github.com/llvm/llvm-project/pull/131031, Clang modules build
fails in chromium as we use libcxx directory directly like below.

```
stderr:
../../third_party/libc++/src/include/module.modulemap:2325:12: error: header '__assertion_handler' not found
 2325 |     header "__assertion_handler" // generated via CMake
      |            ^
1 error generated.
```

To fix this error, I added `__assertion_handler` as a forward header for our usage.
---
 libcxx/include/__assertion_handler | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 libcxx/include/__assertion_handler

diff --git a/libcxx/include/__assertion_handler b/libcxx/include/__assertion_handler
new file mode 100644
index 0000000000000..6307c6bf88594
--- /dev/null
+++ b/libcxx/include/__assertion_handler
@@ -0,0 +1,19 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ASSERTION_HANDLER
+#define _LIBCPP___ASSERTION_HANDLER
+
+#include_next <__assertion_handler> // Note: this include is generated by CMake and is potentially vendor-provided.
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+
+#endif // _LIBCPP___ASSERTION_HANDLER



More information about the libcxx-commits mailing list