diff options
Diffstat (limited to 'clang/lib/AST/DeclBase.cpp')
-rw-r--r-- | clang/lib/AST/DeclBase.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp index 46adad6c3c3..288d66a205a 100644 --- a/clang/lib/AST/DeclBase.cpp +++ b/clang/lib/AST/DeclBase.cpp @@ -159,11 +159,12 @@ bool Decl::isParameterPack() const { return isTemplateParameterPack(); } -bool Decl::isFunctionOrFunctionTemplate() const { - if (const UsingShadowDecl *UD = dyn_cast<UsingShadowDecl>(this)) - return UD->getTargetDecl()->isFunctionOrFunctionTemplate(); - - return isa<FunctionDecl>(this) || isa<FunctionTemplateDecl>(this); +FunctionDecl *Decl::getAsFunction() { + if (FunctionDecl *FD = dyn_cast<FunctionDecl>(this)) + return FD; + if (const FunctionTemplateDecl *FTD = dyn_cast<FunctionTemplateDecl>(this)) + return FTD->getTemplatedDecl(); + return 0; } bool Decl::isTemplateDecl() const { |