diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-12-01 17:35:23 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-12-01 17:35:23 +0000 |
commit | 6be3de3fa79430dd378c422a879c15d0c58d024d (patch) | |
tree | a5e387911a64803eaeedcb8654dfcef4e57a1ae7 /clang/lib/Sema/SemaDecl.cpp | |
parent | 21920e375805cf0b45b0e78f577502ef0229dd1d (diff) | |
download | bcm5719-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.cpp | 7 |
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() && |