Skip to content

Commit ea05350

Browse files
committed
Update CanCheckCodeGenInfo to check function types as well.
1 parent 5ccac5b commit ea05350

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/CppParser/Parser.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2954,6 +2954,25 @@ bool Parser::CanCheckCodeGenInfo(clang::Sema& S, const clang::Type* Ty)
29542954
FinalType->isInstantiationDependentType() || FinalType->isUndeducedType())
29552955
return false;
29562956

2957+
if (FinalType->isFunctionType())
2958+
{
2959+
auto FTy = FinalType->getAs<clang::FunctionType>();
2960+
auto CanCheck = CanCheckCodeGenInfo(S, FTy->getReturnType().getTypePtr());
2961+
if (!CanCheck)
2962+
return false;
2963+
2964+
if (FinalType->isFunctionProtoType())
2965+
{
2966+
auto FPTy = FinalType->getAs<clang::FunctionProtoType>();
2967+
for (const auto& ParamType : FPTy->getParamTypes())
2968+
{
2969+
auto CanCheck = CanCheckCodeGenInfo(S, ParamType.getTypePtr());
2970+
if (!CanCheck)
2971+
return false;
2972+
}
2973+
}
2974+
}
2975+
29572976
if (auto RT = FinalType->getAs<clang::RecordType>())
29582977
if (!HasLayout(RT->getDecl()))
29592978
return false;

0 commit comments

Comments
 (0)