Fix a bug handling typedefs of functions, patch by Nuno Lopes!

llvm-svn: 44661
This commit is contained in:
Chris Lattner 2007-12-06 17:20:20 +00:00
parent 8393dc7378
commit b36a98e9a3
2 changed files with 4 additions and 2 deletions

View File

@ -242,8 +242,8 @@ FunctionDecl::~FunctionDecl() {
}
unsigned FunctionDecl::getNumParams() const {
if (isa<FunctionTypeNoProto>(getType())) return 0;
return cast<FunctionTypeProto>(getType())->getNumArgs();
if (isa<FunctionTypeNoProto>(getCanonicalType())) return 0;
return cast<FunctionTypeProto>(getCanonicalType())->getNumArgs();
}
void FunctionDecl::setParams(ParmVarDecl **NewParamInfo, unsigned NumParams) {

View File

@ -3,4 +3,6 @@
typedef void func_typedef();
func_typedef xxx;
typedef void func_t(int x);
func_t a;