data: fixed auto type

* fixed handling of non-deducible auto-type (e.g. when the auto-type depends on a template parameter).
This commit is contained in:
malte_langkabel
2016-01-15 12:29:43 +01:00
parent eecf8b95d2
commit ad3229ebb2
@@ -177,8 +177,17 @@ std::shared_ptr<DataType> CxxTypeNameResolver::typeToDataType(const clang::Type*
}
case clang::Type::Auto:
{
const clang::AutoType* autoType = clang::dyn_cast<clang::AutoType>(type);
dataType = qualTypeToDataType(autoType->getDeducedType());
clang::QualType deducedType = clang::dyn_cast<clang::AutoType>(type)->getDeducedType();
if (!deducedType.isNull())
{
dataType = qualTypeToDataType(deducedType);
}
else
{
NameHierarchy typeNameHerarchy;
typeNameHerarchy.push(std::make_shared<NameElement>("auto"));
dataType = std::make_shared<NamedDataType>(typeNameHerarchy);
}
break;
}
case clang::Type::Decltype: