Skip to content

Commit

Permalink
Parser.cpp: fix TypeLoc::Elaborated wrapped inside TypeLoc::Qualified
Browse files Browse the repository at this point in the history
  • Loading branch information
deadlocklogic committed Jan 2, 2024
1 parent 4b6b3ca commit 3a202a8
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/CppParser/Parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2643,13 +2643,12 @@ Type* Parser::WalkType(clang::QualType QualType, const clang::TypeLoc* TL,
if (LocValid)
{
TypeLoc UTL, ETL, ITL;
auto TypeLocClass = TL->getTypeLocClass();
if (TypeLocClass == TypeLoc::Qualified)
if (TL->getTypeLocClass() == TypeLoc::Qualified)
{
UTL = TL->getUnqualifiedLoc();
TL = &UTL;
}
else if (TypeLocClass == TypeLoc::Elaborated)
if (TL->getTypeLocClass() == TypeLoc::Elaborated)
{
ETL = TL->getAs<ElaboratedTypeLoc>();
ITL = ETL.getNextTypeLoc();
Expand Down Expand Up @@ -2692,13 +2691,12 @@ Type* Parser::WalkType(clang::QualType QualType, const clang::TypeLoc* TL,
if (LocValid)
{
TypeLoc UTL, ETL, ITL;
auto TypeLocClass = TL->getTypeLocClass();
if (TypeLocClass == TypeLoc::Qualified)
if (TL->getTypeLocClass() == TypeLoc::Qualified)
{
UTL = TL->getUnqualifiedLoc();
TL = &UTL;
}
else if (TypeLocClass == TypeLoc::Elaborated)
if (TL->getTypeLocClass() == TypeLoc::Elaborated)
{
ETL = TL->getAs<ElaboratedTypeLoc>();
ITL = ETL.getNextTypeLoc();
Expand Down Expand Up @@ -2747,7 +2745,7 @@ Type* Parser::WalkType(clang::QualType QualType, const clang::TypeLoc* TL,
UTL = TL->getUnqualifiedLoc();
TL = &UTL;
}
else if (TypeLocClass == TypeLoc::Elaborated)
if (TypeLocClass == TypeLoc::Elaborated)
{
ETL = TL->getAs<ElaboratedTypeLoc>();
ITL = ETL.getNextTypeLoc();
Expand Down

0 comments on commit 3a202a8

Please sign in to comment.