* decl2.c (get_guard): Copy DECL_COMDAT.
(comdat_linkage): Set DECL_COMDAT unconditionally.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154885
138bc75d-0d04-0410-961f-
82ee72b054a4
+2009-12-01 Jason Merrill <jason@redhat.com>
+
+ PR c++/41611
+ * decl2.c (get_guard): Copy DECL_COMDAT.
+ (comdat_linkage): Set DECL_COMDAT unconditionally.
+
2009-12-01 Jakub Jelinek <jakub@redhat.com>
PR c++/3187
}
}
- if (DECL_LANG_SPECIFIC (decl))
- DECL_COMDAT (decl) = 1;
+ DECL_COMDAT (decl) = 1;
}
/* For win32 we also want to put explicit instantiations in
TREE_PUBLIC (guard) = TREE_PUBLIC (decl);
TREE_STATIC (guard) = TREE_STATIC (decl);
DECL_COMMON (guard) = DECL_COMMON (decl);
+ DECL_COMDAT (guard) = DECL_COMDAT (decl);
DECL_COMDAT_GROUP (guard) = DECL_COMDAT_GROUP (decl);
if (TREE_PUBLIC (decl))
DECL_WEAK (guard) = DECL_WEAK (decl);
+2009-12-01 Jason Merrill <jason@redhat.com>
+
+ PR c++/41611
+ * g++.dg/abi/guard1.C: New.
+
2009-12-91 Uros Bizjak <ubizjak@gmail.com>
* gcc.target/i386/vperm-v4sf-1.c (dg-options): Use -msse.
--- /dev/null
+// PR c++/41611
+// { dg-final { scan-assembler-not "_ZGVZN1A1fEvE1i" } }
+
+struct A {
+ static int f()
+ {
+ static int &i = *new int();
+ return i;
+ }
+};