aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Decl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r--lib/AST/Decl.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp
index d97e0b33e5..e27015b7ef 100644
--- a/lib/AST/Decl.cpp
+++ b/lib/AST/Decl.cpp
@@ -368,9 +368,10 @@ FunctionDecl::~FunctionDecl() {
}
unsigned FunctionDecl::getNumParams() const {
- if (isa<FunctionTypeNoProto>(getCanonicalType()))
+ const FunctionType *FT = getType()->getAsFunctionType();
+ if (isa<FunctionTypeNoProto>(FT))
return 0;
- return cast<FunctionTypeProto>(getCanonicalType())->getNumArgs();
+ return cast<FunctionTypeProto>(FT)->getNumArgs();
}
void FunctionDecl::setParams(ParmVarDecl **NewParamInfo, unsigned NumParams) {