diff options
-rw-r--r-- | AST/Decl.cpp | 4 | ||||
-rw-r--r-- | test/Sema/ast-print.c | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/AST/Decl.cpp b/AST/Decl.cpp index 16233b1d82..cebd29525d 100644 --- a/AST/Decl.cpp +++ b/AST/Decl.cpp @@ -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) { diff --git a/test/Sema/ast-print.c b/test/Sema/ast-print.c index 97ee84f4a6..34b0411cfe 100644 --- a/test/Sema/ast-print.c +++ b/test/Sema/ast-print.c @@ -3,4 +3,6 @@ typedef void func_typedef(); func_typedef xxx; +typedef void func_t(int x); +func_t a; |