Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(495)

Unified Diff: lib/Sema/SemaTemplateInstantiateDecl.cpp

Issue 184973004: Prep for merging 3.4: Undo changes from 3.3 branch (Closed) Base URL: http://git.chromium.org/native_client/pnacl-clang.git@master
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/Lex/PPMacroExpansion.cpp ('k') | test/CodeGen/linux-arm-atomic.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/Sema/SemaTemplateInstantiateDecl.cpp
diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp
index d1428c51a4f97cae11f8c520c356ebc518141174..42e1757bcbe80279cdad40f547180cbd5a9f4b4d 100644
--- a/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -1558,36 +1558,10 @@ TemplateDeclInstantiator::VisitCXXMethodDecl(CXXMethodDecl *D,
Constructor->isExplicit(),
Constructor->isInlineSpecified(),
false, Constructor->isConstexpr());
-
// Claim that the instantiation of a constructor or constructor template
// inherits the same constructor that the template does.
- if (CXXConstructorDecl *Inh = const_cast<CXXConstructorDecl *>(
- Constructor->getInheritedConstructor())) {
- // If we're instantiating a specialization of a function template, our
- // "inherited constructor" will actually itself be a function template.
- // Instantiate a declaration of it, too.
- if (FunctionTemplate) {
- assert(!TemplateParams && Inh->getDescribedFunctionTemplate() &&
- !Inh->getParent()->isDependentContext() &&
- "inheriting constructor template in dependent context?");
- Sema::InstantiatingTemplate Inst(SemaRef, Constructor->getLocation(),
- Inh);
- if (Inst)
- return 0;
- Sema::ContextRAII SavedContext(SemaRef, Inh->getDeclContext());
- LocalInstantiationScope LocalScope(SemaRef);
-
- // Use the same template arguments that we deduced for the inheriting
- // constructor. There's no way they could be deduced differently.
- MultiLevelTemplateArgumentList InheritedArgs;
- InheritedArgs.addOuterTemplateArguments(TemplateArgs.getInnermost());
- Inh = cast_or_null<CXXConstructorDecl>(
- SemaRef.SubstDecl(Inh, Inh->getDeclContext(), InheritedArgs));
- if (!Inh)
- return 0;
- }
+ if (const CXXConstructorDecl *Inh = Constructor->getInheritedConstructor())
cast<CXXConstructorDecl>(Method)->setInheritedConstructor(Inh);
- }
} else if (CXXDestructorDecl *Destructor = dyn_cast<CXXDestructorDecl>(D)) {
Method = CXXDestructorDecl::Create(SemaRef.Context, Record,
StartLoc, NameInfo, T, TInfo,
« no previous file with comments | « lib/Lex/PPMacroExpansion.cpp ('k') | test/CodeGen/linux-arm-atomic.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698