[llvm] [ADT] Fix implicit reliance on cassert in StringTable.h (PR #169324)
Danila Malyutin via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 24 04:54:46 PST 2025
https://github.com/danilaml created https://github.com/llvm/llvm-project/pull/169324
Adds an explicit include of <cassert> in StringTable.h rather than relying on the one in StringRef.h. Fixes potential compile errors if assert() was undef'ed between StringRef.h and StringTable.h inclusion.
Noticed the issue after c9f573463ebd7b4e46da4877802f2364f700e54a.
>From caa7a9ef9912e62867a6fcc3fdb0d6d469291843 Mon Sep 17 00:00:00 2001
From: Danila Malyutin <dmalyutin at azul.com>
Date: Mon, 24 Nov 2025 16:39:20 +0400
Subject: [PATCH] [ADT] Fix implicit reliance on cassert in StringTable.h
Adds an explicit include of <cassert> in StringTable.h rather than
relying on the one in StringRef.h. Fixes potential compile errors if
assert() was undef'ed between StringRef.h and StringTable.h inclusion.
---
llvm/include/llvm/ADT/StringTable.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/llvm/include/llvm/ADT/StringTable.h b/llvm/include/llvm/ADT/StringTable.h
index 9422a6da1ce8e..3a08e56e8f501 100644
--- a/llvm/include/llvm/ADT/StringTable.h
+++ b/llvm/include/llvm/ADT/StringTable.h
@@ -11,6 +11,7 @@
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/iterator.h"
+#include <cassert>
#include <iterator>
#include <limits>
More information about the llvm-commits
mailing list