mirror of
https://github.com/JakeHillion/object-introspection.git
synced 2024-11-12 21:56:54 +00:00
TypeIdentifier: Preserve container types
Pass-through-types represent classes to be turned into containers. We don't want these to turn these containers into Dummy's on a second run of TypeIdentifier.
This commit is contained in:
parent
9c45e0f22a
commit
8cb082372e
@ -61,7 +61,8 @@ void TypeIdentifier::visit(Container& c) {
|
||||
for (size_t i = 0; i < c.templateParams.size(); i++) {
|
||||
const auto& param = c.templateParams[i];
|
||||
if (dynamic_cast<Dummy*>(param.type()) ||
|
||||
dynamic_cast<DummyAllocator*>(param.type())) {
|
||||
dynamic_cast<DummyAllocator*>(param.type()) ||
|
||||
dynamic_cast<Container*>(param.type())) {
|
||||
// In case the TypeIdentifier pass is run multiple times, we don't want to
|
||||
// replace dummies again as the context of the original replacement has
|
||||
// been lost.
|
||||
|
@ -177,7 +177,9 @@ TEST(TypeIdentifierTest, ContainerNotReplaced) {
|
||||
Param
|
||||
Primitive: int32_t
|
||||
Param
|
||||
Dummy (size: 0, align: 8)
|
||||
[1] Container: std::allocator (size: 1)
|
||||
Param
|
||||
Primitive: int32_t
|
||||
)");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user