PR lto/42320
* lto-symtab.c (lto_symtab_resolve_can_prevail_p): Properly
detect non-prevailing decls.
* g++.dg/lto/
20091210-1_0.h: New testcase.
* g++.dg/lto/
20091210-1_0.C: Likewise.
* g++.dg/lto/
20091210-1_1.C: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@155155
138bc75d-0d04-0410-961f-
82ee72b054a4
+2009-12-11 Richard Guenther <rguenther@suse.de>
+
+ PR lto/42320
+ * lto-symtab.c (lto_symtab_resolve_can_prevail_p): Properly
+ detect non-prevailing decls.
+
2009-12-10 Jakub Jelinek <jakub@redhat.com>
PR c++/42317
static bool
lto_symtab_resolve_can_prevail_p (lto_symtab_entry_t e)
{
- if (!TREE_STATIC (e->decl))
+ /* The C++ frontend ends up neither setting TREE_STATIC nor
+ DECL_EXTERNAL on virtual methods but only TREE_PUBLIC.
+ So do not reject !TREE_STATIC here but only DECL_EXTERNAL. */
+ if (DECL_EXTERNAL (e->decl))
return false;
/* For functions we need a non-discarded body. */
+2009-12-11 Richard Guenther <rguenther@suse.de>
+
+ PR lto/42320
+ * g++.dg/lto/20091210-1_0.h: New testcase.
+ * g++.dg/lto/20091210-1_0.C: Likewise.
+ * g++.dg/lto/20091210-1_1.C: Likewise.
+
2009-12-10 Jakub Jelinek <jakub@redhat.com>
PR c++/42317
--- /dev/null
+// { dg-lto-do link }
+#include "20091210-1_0.h"
+void Base::f() {}
--- /dev/null
+struct Base1 {
+ virtual ~Base1() {}
+};
+struct Base2 {
+ virtual void f() = 0;
+};
+struct Base : Base1, Base2 {
+ virtual void f();
+};
--- /dev/null
+#include "20091210-1_0.h"
+
+struct Foo : Base {
+ virtual void g();
+};
+
+void Foo::g() {}
+
+int main() {}