Skip to content
Snippets Groups Projects
Commit d448c1ba authored by Sean Callanan's avatar Sean Callanan
Browse files

Fixes for array handling and dynamic type casting

errors pointed out by John McCall.

llvm-svn: 106665
parent fc40f0a1
No related branches found
No related tags found
No related merge requests found
......@@ -112,15 +112,14 @@ clang::NamedDecl *NameSearchContext::AddFunDecl(void *type) {
QualType QT = QualType::getFromOpaquePtr(type);
clang::Type *T = QT.getTypePtr();
const FunctionProtoType *FPT = T->getAs<FunctionProtoType>();
if (T->isFunctionProtoType())
{
FunctionProtoType *FPT = dyn_cast<FunctionProtoType>(T);
if (FPT)
{
unsigned NumArgs = FPT->getNumArgs();
unsigned ArgIndex;
ParmVarDecl *ParmVarDecls[NumArgs];
ParmVarDecl **ParmVarDecls = new ParmVarDecl*[NumArgs];
for (ArgIndex = 0; ArgIndex < NumArgs; ++ArgIndex)
{
......@@ -138,6 +137,8 @@ clang::NamedDecl *NameSearchContext::AddFunDecl(void *type) {
}
Decl->setParams(ParmVarDecls, NumArgs);
delete [] ParmVarDecls;
}
Decls.push_back(Decl);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment