Browse Source

Improved type loc handling when walking types.

We now keep desugaring them until we get to the proper type loc class.
pull/254/merge
triton 11 years ago
parent
commit
51b8d74e61
  1. 12
      src/CppParser/Parser.cpp

12
src/CppParser/Parser.cpp

@ -1623,6 +1623,12 @@ Type* Parser::WalkType(clang::QualType QualType, clang::TypeLoc* TL, @@ -1623,6 +1623,12 @@ Type* Parser::WalkType(clang::QualType QualType, clang::TypeLoc* TL,
TypeLoc RL;
if (TL && !TL->isNull())
{
while (TL->getTypeLocClass() != TypeLoc::FunctionProto)
{
auto Next = TL->getNextTypeLoc();
TL = &Next;
}
FTL = TL->getAs<FunctionProtoTypeLoc>();
RL = FTL.getReturnLoc();
}
@ -1752,6 +1758,12 @@ Type* Parser::WalkType(clang::QualType QualType, clang::TypeLoc* TL, @@ -1752,6 +1758,12 @@ Type* Parser::WalkType(clang::QualType QualType, clang::TypeLoc* TL,
TL = &ITL;
}
while (TL->getTypeLocClass() != TypeLoc::TemplateTypeParm)
{
auto Next = TL->getNextTypeLoc();
TL = &Next;
}
assert(TL->getTypeLocClass() == TypeLoc::TemplateTypeParm);
auto TTTL = TL->getAs<TemplateTypeParmTypeLoc>();

Loading…
Cancel
Save