summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
diff options
context:
space:
mode:
authorAlexis Hunt <alercah@gmail.com>2011-05-23 21:07:59 +0000
committerAlexis Hunt <alercah@gmail.com>2011-05-23 21:07:59 +0000
commit1fb4e7621889aeaef0ca9073672360dee81aa329 (patch)
tree7dd63984ad5d0875ee17bfd67c55db241aedc3a4 /clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
parent6c4a3190889bc3b7ce842fc4429fa5dc3436e0a3 (diff)
downloadbcm5719-llvm-1fb4e7621889aeaef0ca9073672360dee81aa329.tar.gz
bcm5719-llvm-1fb4e7621889aeaef0ca9073672360dee81aa329.zip
Correctly propagate defaultedness across template instantiation. This
fixes PR9965, but we're not out of the water yet, as we do not successfully handle out-of-line definitions, due to my utter misunderstanding of how we manage templates. llvm-svn: 131920
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaTemplateInstantiateDecl.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
index f6cce0bbf9c..fb34d9f1dad 100644
--- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -1264,6 +1264,7 @@ Decl *TemplateDeclInstantiator::VisitFunctionDecl(FunctionDecl *D,
PrincipalDecl->isInIdentifierNamespace(Decl::IDNS_Ordinary))
PrincipalDecl->setNonMemberOperator();
+ assert(!D->isDefaulted() && "only methods should be defaulted");
return Function;
}
@@ -1496,7 +1497,14 @@ TemplateDeclInstantiator::VisitCXXMethodDecl(CXXMethodDecl *D,
else
Owner->addDecl(DeclToAdd);
}
-
+
+ if (D->isExplicitlyDefaulted()) {
+ SemaRef.SetDeclDefaulted(Method, Method->getLocation());
+ } else {
+ assert(!D->isDefaulted() &&
+ "should not implicitly default uninstantiated function");
+ }
+
return Method;
}
OpenPOWER on IntegriCloud