mirror of
https://github.com/MaskRay/ccls.git
synced 2025-11-10 16:39:13 +00:00
indexer: Resolve the type alias correctly (#988)
The struct derived from an alias is missing from type hierarchy before this fix:
```cpp
struct Base {};
struct Derived : Base {};
using BaseAlias = Base;
struct DerivedAlias : BaseAlias {};
```
```
Derive from
Base
└╸Derived
```
The expected output is:
```
Derive from
Base
├╸Derived
└╸DerivedAlias
```
This commit is contained in:
parent
5660367c77
commit
5caa190a92
@ -325,6 +325,9 @@ try_again:
|
|||||||
switch (tp->getTypeClass()) {
|
switch (tp->getTypeClass()) {
|
||||||
case Type::Typedef:
|
case Type::Typedef:
|
||||||
d = cast<TypedefType>(tp)->getDecl();
|
d = cast<TypedefType>(tp)->getDecl();
|
||||||
|
tp = cast<TypedefType>(tp)->getDecl()->getUnderlyingType().getTypePtrOrNull();
|
||||||
|
if (tp)
|
||||||
|
goto try_again;
|
||||||
break;
|
break;
|
||||||
case Type::ObjCObject:
|
case Type::ObjCObject:
|
||||||
d = cast<ObjCObjectType>(tp)->getInterface();
|
d = cast<ObjCObjectType>(tp)->getInterface();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user