summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/AST/Decl.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp
index d97e0b33e5c..e27015b7efd 100644
--- a/clang/lib/AST/Decl.cpp
+++ b/clang/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) {
OpenPOWER on IntegriCloud