[libcxx-commits] [libcxx] [libc++] Add missing %{flags} substitution to clang-tidy (PR #171689)
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Dec 11 09:32:49 PST 2025
https://github.com/ldionne updated https://github.com/llvm/llvm-project/pull/171689
>From 4be1d3ced8aabdaf381a0b7acd791eafa082c8af Mon Sep 17 00:00:00 2001
From: Louis Dionne <ldionne.2 at gmail.com>
Date: Wed, 10 Dec 2025 15:12:26 -0500
Subject: [PATCH 1/3] [libc++] Add missing %{flags} substitution to clang-tidy
Flags that should be used both for compiling and for linking
are provided through the %{flags} substitution. Our clang-tidy
tests should be using them, not only %{compile_flags}.
---
libcxx/test/libcxx/clang_tidy.gen.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libcxx/test/libcxx/clang_tidy.gen.py b/libcxx/test/libcxx/clang_tidy.gen.py
index 16c90c3ef7130..b46cc72c08dfd 100644
--- a/libcxx/test/libcxx/clang_tidy.gen.py
+++ b/libcxx/test/libcxx/clang_tidy.gen.py
@@ -27,7 +27,7 @@
{lit_header_undeprecations.get(header, '')}
// TODO: run clang-tidy with modules enabled once they are supported
-// RUN: %{{clang-tidy}} %s --warnings-as-errors=* -header-filter=.* --config-file=%{{libcxx-dir}}/.clang-tidy --load=%{{test-tools-dir}}/clang_tidy_checks/libcxx-tidy.plugin -- -Wweak-vtables %{{compile_flags}} -fno-modules
+// RUN: %{{clang-tidy}} %s --warnings-as-errors=* -header-filter=.* --config-file=%{{libcxx-dir}}/.clang-tidy --load=%{{test-tools-dir}}/clang_tidy_checks/libcxx-tidy.plugin -- -Wweak-vtables %{{flags}} %{{compile_flags}} -fno-modules
#include <{header}>
""")
>From 33156856613fd16bfb6dc02cd78e1d46985f11fe Mon Sep 17 00:00:00 2001
From: Louis Dionne <ldionne.2 at gmail.com>
Date: Thu, 11 Dec 2025 08:56:00 -0500
Subject: [PATCH 2/3] Add missing NODEBUG
---
libcxx/include/string | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libcxx/include/string b/libcxx/include/string
index 2b3ba6d2d9b62..8d49822f6fb39 100644
--- a/libcxx/include/string
+++ b/libcxx/include/string
@@ -756,7 +756,7 @@ public:
// external memory. In such cases, the destructor is responsible for unpoisoning
// the memory to avoid triggering false positives.
// Therefore it's crucial to ensure the destructor is called.
- using __trivially_relocatable = void;
+ using __trivially_relocatable _LIBCPP_NODEBUG = void;
# else
using __trivially_relocatable _LIBCPP_NODEBUG = __conditional_t<
__libcpp_is_trivially_relocatable<allocator_type>::value && __libcpp_is_trivially_relocatable<pointer>::value,
>From e9bf97a0c5a37e72b8c04967fab5a004e02986e1 Mon Sep 17 00:00:00 2001
From: Louis Dionne <ldionne.2 at gmail.com>
Date: Thu, 11 Dec 2025 12:32:36 -0500
Subject: [PATCH 3/3] Avoid ADL
---
libcxx/include/__cxx03/deque | 6 +++---
libcxx/include/deque | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/libcxx/include/__cxx03/deque b/libcxx/include/__cxx03/deque
index fcf9d606f408f..22b02af4ad60d 100644
--- a/libcxx/include/__cxx03/deque
+++ b/libcxx/include/__cxx03/deque
@@ -918,7 +918,7 @@ public:
// This function tests deque object annotations.
if (empty()) {
for (__map_const_iterator __it = __map_.begin(); __it != __map_.end(); ++__it) {
- if (!__sanitizer_verify_double_ended_contiguous_container(
+ if (!::__sanitizer_verify_double_ended_contiguous_container(
std::__to_address(*__it),
std::__to_address(*__it),
std::__to_address(*__it),
@@ -950,7 +950,7 @@ public:
// Is the block before or after deque blocks that contain elements?
if (__it < __first_mp || __it > __last_mp) {
- if (!__sanitizer_verify_double_ended_contiguous_container(
+ if (!::__sanitizer_verify_double_ended_contiguous_container(
std::__to_address(*__it),
std::__to_address(*__it),
std::__to_address(*__it),
@@ -960,7 +960,7 @@ public:
const void* __containers_buffer_beg = (__it == __first_mp) ? __p_beg : (const void*)std::__to_address(*__it);
const void* __containers_buffer_end =
(__it == __last_mp) ? __p_end : (const void*)std::__to_address(*__it + __block_size);
- if (!__sanitizer_verify_double_ended_contiguous_container(
+ if (!::__sanitizer_verify_double_ended_contiguous_container(
std::__to_address(*__it),
__containers_buffer_beg,
__containers_buffer_end,
diff --git a/libcxx/include/deque b/libcxx/include/deque
index befe27bb4282d..b64ec19df6a38 100644
--- a/libcxx/include/deque
+++ b/libcxx/include/deque
@@ -1119,7 +1119,7 @@ public:
// This function tests deque object annotations.
if (empty()) {
for (__map_const_iterator __it = __map_.begin(); __it != __map_.end(); ++__it) {
- if (!__sanitizer_verify_double_ended_contiguous_container(
+ if (!::__sanitizer_verify_double_ended_contiguous_container(
std::__to_address(*__it),
std::__to_address(*__it),
std::__to_address(*__it),
@@ -1151,7 +1151,7 @@ public:
// Is the block before or after deque blocks that contain elements?
if (__it < __first_mp || __it > __last_mp) {
- if (!__sanitizer_verify_double_ended_contiguous_container(
+ if (!::__sanitizer_verify_double_ended_contiguous_container(
std::__to_address(*__it),
std::__to_address(*__it),
std::__to_address(*__it),
@@ -1161,7 +1161,7 @@ public:
const void* __containers_buffer_beg = (__it == __first_mp) ? __p_beg : (const void*)std::__to_address(*__it);
const void* __containers_buffer_end =
(__it == __last_mp) ? __p_end : (const void*)std::__to_address(*__it + __block_size);
- if (!__sanitizer_verify_double_ended_contiguous_container(
+ if (!::__sanitizer_verify_double_ended_contiguous_container(
std::__to_address(*__it),
__containers_buffer_beg,
__containers_buffer_end,
More information about the libcxx-commits
mailing list