]> granicus.if.org Git - clang/commitdiff
fix PR8007
authorGabor Greif <ggreif@gmail.com>
Sat, 28 Aug 2010 00:16:06 +0000 (00:16 +0000)
committerGabor Greif <ggreif@gmail.com>
Sat, 28 Aug 2010 00:16:06 +0000 (00:16 +0000)
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

lib/Sema/SemaExpr.cpp
test/SemaTemplate/inject-templated-friend.cpp

index 21c7e4454444e4b90f216b5597ba8f2dbf4fe18c..c699623882f867896f9464d1c3b8d7f995934ecd 100644 (file)
@@ -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
 
index 67da8342f26b42b081fbdec54785ed194268c885..56feae5d263743b9682acecef64856ce04b5d7d8 100644 (file)
@@ -1,5 +1,4 @@
 // RUN: %clang %s -S -emit-llvm -o - | grep -e "define linkonce_odr.*_ZN6pr8007lsERNS_11std_ostreamERKNS_8StreamerINS_3FooEEE"
-// XFAIL: *
 
 namespace pr8007 {