diff options
author | Gabor Greif <ggreif@gmail.com> | 2010-08-28 00:16:06 +0000 |
---|---|---|
committer | Gabor Greif <ggreif@gmail.com> | 2010-08-28 00:16:06 +0000 |
commit | 40181c4e587b8a988e691d7b46580b1a1212c535 (patch) | |
tree | 9a18a3573905c9b5ef5e949925bd1583cd6d786e | |
parent | 0133f525a23e18dd444880f7554f25fbcbd834e5 (diff) |
fix PR8007
reordering and redefinition issues still may linger,
I plan to nail them next
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112333 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 7 | ||||
-rw-r--r-- | test/SemaTemplate/inject-templated-friend.cpp | 1 |
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 { |