@@ -62,8 +62,7 @@ std::string TypeTranslator::TranslateFunctionPointer(const clang::QualType& qtpe
62
62
}
63
63
}
64
64
65
- std::string TypeTranslator::TranslatePointer (const clang::PointerType* ptr, const std::string* avoid){
66
- const clang::QualType& pte = ptr->getPointeeType ();
65
+ std::string TypeTranslator::TranslatePointer (const clang::QualType& pte, const std::string* avoid){
67
66
68
67
if (pte->isBuiltinType ()){
69
68
const clang::BuiltinType* as = pte->getAs <clang::BuiltinType>();
@@ -147,7 +146,7 @@ std::string TypeTranslator::Translate(const clang::QualType& qtpe, const std::st
147
146
return TranslateFunctionPointer (qtpe, avoid);
148
147
149
148
} else if (tpe->isPointerType ()){
150
- return TranslatePointer (tpe->getAs <clang::PointerType>(), avoid);
149
+ return TranslatePointer (tpe->getAs <clang::PointerType>()-> getPointeeType () , avoid);
151
150
152
151
} else if (qtpe->isStructureType () || qtpe->isUnionType ()){
153
152
return TranslateStructOrUnion (qtpe);
@@ -157,7 +156,8 @@ std::string TypeTranslator::Translate(const clang::QualType& qtpe, const std::st
157
156
158
157
} else if (qtpe->isConstantArrayType ()){
159
158
return TranslateConstantArray (ctx->getAsConstantArrayType (qtpe), avoid);
160
-
159
+ } else if (qtpe->isArrayType ()){
160
+ return TranslatePointer (ctx->getAsArrayType (qtpe)->getElementType (), avoid);
161
161
} else {
162
162
163
163
auto found = typeMap.find (qtpe.getUnqualifiedType ().getAsString ());
0 commit comments