summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-10-08 00:14:38 +0000
committerDouglas Gregor <dgregor@apple.com>2009-10-08 00:14:38 +0000
commite3dfd4826b6ae3b37527d0fb4a1bc41abd090423 (patch)
tree152d87f197da6c028bab0d32b0a9840ad107f672 /clang/lib/Sema/SemaExpr.cpp
parentdafd08ea7eab720156ae57deea97a0c6e6b01be7 (diff)
downloadbcm5719-llvm-e3dfd4826b6ae3b37527d0fb4a1bc41abd090423.tar.gz
bcm5719-llvm-e3dfd4826b6ae3b37527d0fb4a1bc41abd090423.zip
Only perform an implicit instantiation of a function if its template
specialization kind is TSK_ImplicitInstantiation. Previously, we would end up implicitly instantiating functions that had explicit specialization declarations or explicit instantiation declarations (with no corresponding definitions). llvm-svn: 83511
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index e7b074b43c3..3bd72d07d2e 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -6198,15 +6198,9 @@ void Sema::MarkDeclarationReferenced(SourceLocation Loc, Decl *D) {
if (FunctionDecl *Function = dyn_cast<FunctionDecl>(D)) {
// Implicit instantiation of function templates and member functions of
// class templates.
- if (!Function->getBody()) {
- // FIXME: distinguish between implicit instantiations of function
- // templates and explicit specializations (the latter don't get
- // instantiated, naturally).
- if (Function->getInstantiatedFromMemberFunction() ||
- Function->getPrimaryTemplate())
- PendingImplicitInstantiations.push_back(std::make_pair(Function, Loc));
- }
-
+ if (!Function->getBody() &&
+ Function->getTemplateSpecializationKind() == TSK_ImplicitInstantiation)
+ PendingImplicitInstantiations.push_back(std::make_pair(Function, Loc));
// FIXME: keep track of references to static functions
Function->setUsed(true);
OpenPOWER on IntegriCloud