summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-10-09 01:23:45 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-10-09 01:23:45 +0000
commitcc4ca0a32476fa6090d212210168f7b7bc34dd23 (patch)
tree1b7c8beddcbb456058260a8fe2e1e9a2cf085caf /clang/lib/Sema
parentbb860bd2644a072b98423f7661c1e1ac10a7540c (diff)
downloadbcm5719-llvm-cc4ca0a32476fa6090d212210168f7b7bc34dd23.tar.gz
bcm5719-llvm-cc4ca0a32476fa6090d212210168f7b7bc34dd23.zip
When storing the C++ overridden methods, store them once for the
canonical method; avoid storing them again for an out-of-line definition. llvm-svn: 165472
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 09792285bc3..aec5f01a91a 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/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) {
OpenPOWER on IntegriCloud