[Lldb-commits] [lldb] [lldb] Fix TestSBValueSetTypeSyntheticOverride with libstdc++ (PR #210495)

David Mentler via lldb-commits lldb-commits at lists.llvm.org
Sat Jul 18 00:24:55 PDT 2026


https://github.com/mentlerd created https://github.com/llvm/llvm-project/pull/210495

My test added in #209056 assumed that a `CXXSyntheticChildren` implementation for `std::vector` is readily available on all platforms, that is not the case.

Do the safe thing and skip that part of the test if conditions are not right.

>From bca867faafed4d2fd1fb83b27f75133a73fbb3d2 Mon Sep 17 00:00:00 2001
From: mentlerd <mentlerd at gmail.com>
Date: Sat, 18 Jul 2026 09:16:27 +0200
Subject: [PATCH] Fix bad assumption about std::vectors SCP being implemented
 in C++

This is not necessarily true across all configurations, particularly
with gnu libstdc++
---
 .../TestSBValueSetTypeSyntheticOverride.py                 | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lldb/test/API/python_api/sbvalue_set_type_synthetic_override/TestSBValueSetTypeSyntheticOverride.py b/lldb/test/API/python_api/sbvalue_set_type_synthetic_override/TestSBValueSetTypeSyntheticOverride.py
index e5e8f29ba0e75..907d1af956219 100644
--- a/lldb/test/API/python_api/sbvalue_set_type_synthetic_override/TestSBValueSetTypeSyntheticOverride.py
+++ b/lldb/test/API/python_api/sbvalue_set_type_synthetic_override/TestSBValueSetTypeSyntheticOverride.py
@@ -18,8 +18,11 @@ def test(self):
 
         # CXX runtime synthetic can be overridden
         vec = frame.FindVariable("vec")
-        self.assertTrue(vec.IsSynthetic())
-        self.checkOverride(vec, before=None)
+
+        # GNU libstdc++'s std::vector doesn't have a CXXSyntheticChildren implementation
+        # Use the fact that GetTypeSynthetic() only returns scripted SCPs to filter
+        if vec.IsSynthetic() and vec.GetTypeSynthetic() is None:
+            self.checkOverride(vec, before=None)
 
         # Python synthetic can be overridden
         foo = frame.FindVariable("foo")



More information about the lldb-commits mailing list