diff --git a/src/FindTemplateTypes.cpp b/src/FindTemplateTypes.cpp index 99442b194..585a3db75 100644 --- a/src/FindTemplateTypes.cpp +++ b/src/FindTemplateTypes.cpp @@ -66,18 +66,18 @@ FindTemplateTypes::type_vector_t FindTemplateTypes::Enumerate( return template_types_; } + //type->dump(); TraverseType(QualType(type, 0)); return template_types_; } bool FindTemplateTypes::VisitType(Type *type) { QualType q{type->getCanonicalTypeInternal()}; - // cout << "\n###### Type: " << q.getAsString() << " \n" ; + //cout << "\n###### Type: " << q.getAsString() << " \n"; if (type->isBuiltinType()) { + //cout << " ==> builtin type: " << q.getAsString() << "\n"; template_types_.push_back(TemplateType(q.getAsString(), type)); - // template_types_.push_back( pair(q.getAsString(), - // type) ); - return true; + return false; } // Template for sc_stream_in and sc_stream_out @@ -88,15 +88,17 @@ bool FindTemplateTypes::VisitType(Type *type) { auto tunder{tn.getUnderlying()}; auto name{tunder.getAsTemplateDecl()->getNameAsString()}; template_types_.push_back(TemplateType(name, type)); + //cout << " ==> dependent type: " << name << "\n"; } - } - - CXXRecordDecl *p_cxx_record{type->getAsCXXRecordDecl()}; - if (p_cxx_record != nullptr) { - IdentifierInfo *info{p_cxx_record->getIdentifier()}; - // cout << "##### info; " << info->getNameStart() << "\n"; - if (info != nullptr) { - template_types_.push_back(TemplateType(info->getNameStart(), type)); + } else { + CXXRecordDecl *p_cxx_record{type->getAsCXXRecordDecl()}; + if (p_cxx_record != nullptr) { + IdentifierInfo *info{p_cxx_record->getIdentifier()}; + // cout << "##### info; " << info->getNameStart() << "\n"; + if (info != nullptr) { + template_types_.push_back(TemplateType(info->getNameStart(), type)); + //cout << " ==> CXXRecord type: " << info->getNameStart() << "\n"; + } } } return true;