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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44661 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/AST/Decl.cpp b/AST/Decl.cpp
index 16233b1..cebd295 100644
--- a/AST/Decl.cpp
+++ b/AST/Decl.cpp
@@ -242,8 +242,8 @@
 }
 
 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) {