summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2018-09-12 02:13:47 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2018-09-12 02:13:47 +0000
commitc457766c6d739ba717f881b36a76ff60d3b75809 (patch)
tree294731666a45d2531fbf35de0720e1585d01ccde /clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
parent20fbdb347cf6324e6e8d3f4aa1d0b1ab02f70e8d (diff)
downloadbcm5719-llvm-c457766c6d739ba717f881b36a76ff60d3b75809.tar.gz
bcm5719-llvm-c457766c6d739ba717f881b36a76ff60d3b75809.zip
Consistently create a new declaration when merging a pre-existing but
hidden definition with a would-be-parsed redefinition. This permits a bunch of cleanups. In particular, we no longer need to take merged definitions into account when checking declaration visibility, only when checking definition visibility, which makes certain visibility checks take linear instead of quadratic time. We could also now remove the UPD_DECL_EXPORTED update record and track on each declaration whether it was demoted from a definition (as we already do for variables), but I'm not doing that in this patch to keep the changes here simpler. llvm-svn: 342018
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaTemplateInstantiateDecl.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
index 3ed9eeed16e..2c29b8cbcc1 100644
--- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -1228,7 +1228,7 @@ Decl *TemplateDeclInstantiator::VisitClassTemplateDecl(ClassTemplateDecl *D) {
}
TemplateParameterList *PrevParams
- = PrevClassTemplate->getTemplateParameters();
+ = PrevClassTemplate->getMostRecentDecl()->getTemplateParameters();
// Make sure the parameter lists match.
if (!SemaRef.TemplateParameterListsAreEqual(InstParams, PrevParams,
OpenPOWER on IntegriCloud