summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-12-01 17:35:23 +0000
committerDouglas Gregor <dgregor@apple.com>2009-12-01 17:35:23 +0000
commit6be3de3fa79430dd378c422a879c15d0c58d024d (patch)
treea5e387911a64803eaeedcb8654dfcef4e57a1ae7 /clang/lib/Sema/SemaDecl.cpp
parent21920e375805cf0b45b0e78f577502ef0229dd1d (diff)
downloadbcm5719-llvm-6be3de3fa79430dd378c422a879c15d0c58d024d.tar.gz
bcm5719-llvm-6be3de3fa79430dd378c422a879c15d0c58d024d.zip
Funtion templates and function template specializations do not
override virtual functions. Also, eliminate a (now redundant) call to AddOverriddenMethods. llvm-svn: 90242
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 49be3408738..5d62ace9070 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -3259,8 +3259,11 @@ void Sema::CheckFunctionDeclaration(FunctionDecl *NewFD,
}
// Find any virtual functions that this function overrides.
- if (CXXMethodDecl *Method = dyn_cast<CXXMethodDecl>(NewFD))
- AddOverriddenMethods(Method->getParent(), Method);
+ if (CXXMethodDecl *Method = dyn_cast<CXXMethodDecl>(NewFD)) {
+ if (!Method->isFunctionTemplateSpecialization() &&
+ !Method->getDescribedFunctionTemplate())
+ AddOverriddenMethods(Method->getParent(), Method);
+ }
// Extra checking for C++ overloaded operators (C++ [over.oper]).
if (NewFD->isOverloadedOperator() &&
OpenPOWER on IntegriCloud