varasm.c (globalize_decl): New fn.
authorJason Merrill <jason@gcc.gnu.org>
Wed, 13 Mar 2002 16:03:25 +0000 (11:03 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 13 Mar 2002 16:03:25 +0000 (11:03 -0500)
        * varasm.c (globalize_decl): New fn.
        (assemble_start_function): Use it.
        (asm_emit_uninitialized): Use it.
        (assemble_alias): Use it.
        (assemble_variable): Use it.

From-SVN: r50738

gcc/testsuite/g++.old-deja/g++.other/comdat3-aux.cc [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.other/comdat3.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.other/comdat3.h [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.old-deja/g++.other/comdat3-aux.cc b/gcc/testsuite/g++.old-deja/g++.other/comdat3-aux.cc
new file mode 100644 (file)
index 0000000..fc011e2
--- /dev/null
@@ -0,0 +1,6 @@
+#include "comdat3.h"
+
+void f ()
+{
+  const bool *p = &A<int>::b;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/comdat3.C b/gcc/testsuite/g++.old-deja/g++.other/comdat3.C
new file mode 100644 (file)
index 0000000..1ea047d
--- /dev/null
@@ -0,0 +1,13 @@
+// Test that duplicate elimination of implicit instantiations of static
+// data members works properly.
+
+// Additional sources: comdat3-aux.cc
+// Additional files: comdat3.h
+
+#include "comdat3.h"
+
+int main ()
+{
+  const bool *p = &A<int>::b;
+  f ();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/comdat3.h b/gcc/testsuite/g++.old-deja/g++.other/comdat3.h
new file mode 100644 (file)
index 0000000..e2ec970
--- /dev/null
@@ -0,0 +1,8 @@
+template <class T> struct A {
+  static const bool b = false;
+};
+
+template <class T>
+const bool A<T>::b;
+
+void f ();