diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-10-09 01:23:45 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-10-09 01:23:45 +0000 |
commit | 38eb1e161f602ee810dfb8a5a0d8462572f22689 (patch) | |
tree | 345174136d4e13da0ce4dfaa3fe952932f9bb43a /lib/Sema/SemaDecl.cpp | |
parent | 3ef38eea7ce400718e4ab523b4704ae1fd8f940f (diff) |
When storing the C++ overridden methods, store them once for the
canonical method; avoid storing them again for an out-of-line definition.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165472 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 09792285bc..aec5f01a91 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -6038,7 +6038,8 @@ bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD, // Find any virtual functions that this function overrides. if (CXXMethodDecl *Method = dyn_cast<CXXMethodDecl>(NewFD)) { if (!Method->isFunctionTemplateSpecialization() && - !Method->getDescribedFunctionTemplate()) { + !Method->getDescribedFunctionTemplate() && + Method->isCanonicalDecl()) { if (AddOverriddenMethods(Method->getParent(), Method)) { // If the function was marked as "static", we have a problem. if (NewFD->getStorageClass() == SC_Static) { |