When importing classes and structs with anonymous structs, it is critical that distinct anonymous structs remain distinct despite having similar layout.
This is already ensured by distinguishing based on their placement in the parent struct, using the function findAnonymousStructOrUnionIndex.
The problem is that this function only handles
class Foo { struct { int a; } }
and not
class Foo { struct { int a; } var; }
Both need to be handled, and this patch fixes that. The test case ensures that this functionality doesn't regress.
Use const auto * here?