[llvm] [ADT] Fix FoldingSetIterator::operator* pointer adjustment for multiple inheritance (PR #219349)

Wenju He via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 27 21:58:47 PDT 2026


================
@@ -272,6 +272,23 @@ TEST(FoldingSetTest, Iterator) {
   EXPECT_NE(It, ItCopy);
 }
 
+// FoldingSetNode has a non-zero offset here, so operator* must adjust it.
+struct PolymorphicBase {
+  virtual ~PolymorphicBase() = default;
----------------
wenju-he wrote:

> nit: Would `int Dummy = 0;` be simpler to ensure that `PolymorphicBase` is non-empty?

done, thanks for the suggestion

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


More information about the llvm-commits mailing list