aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Sema/SemaExpr.cpp7
-rw-r--r--test/SemaTemplate/inject-templated-friend.cpp1
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 21c7e44544..c699623882 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -7709,7 +7709,12 @@ void Sema::MarkDeclarationReferenced(SourceLocation Loc, Decl *D) {
else
PendingInstantiations.push_back(std::make_pair(Function, Loc));
}
- }
+ } else // Walk redefinitions, as some of them may be instantiable.
+ for (FunctionDecl::redecl_iterator i(Function->redecls_begin()),
+ e(Function->redecls_end()); i != e; ++i) {
+ if (i->isImplicitlyInstantiable())
+ MarkDeclarationReferenced(Loc, *i);
+ }
// FIXME: keep track of references to static functions
diff --git a/test/SemaTemplate/inject-templated-friend.cpp b/test/SemaTemplate/inject-templated-friend.cpp
index 67da8342f2..56feae5d26 100644
--- a/test/SemaTemplate/inject-templated-friend.cpp
+++ b/test/SemaTemplate/inject-templated-friend.cpp
@@ -1,5 +1,4 @@
// RUN: %clang %s -S -emit-llvm -o - | grep -e "define linkonce_odr.*_ZN6pr8007lsERNS_11std_ostreamERKNS_8StreamerINS_3FooEEE"
-// XFAIL: *
namespace pr8007 {