From 9a789d73d1e3ec0db2755ea8ed4ba3cfc0231d1f Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Wed, 13 Mar 2002 11:03:25 -0500 Subject: [PATCH] varasm.c (globalize_decl): New fn. * 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 | 6 ++++++ gcc/testsuite/g++.old-deja/g++.other/comdat3.C | 13 +++++++++++++ gcc/testsuite/g++.old-deja/g++.other/comdat3.h | 8 ++++++++ 3 files changed, 27 insertions(+) create mode 100644 gcc/testsuite/g++.old-deja/g++.other/comdat3-aux.cc create mode 100644 gcc/testsuite/g++.old-deja/g++.other/comdat3.C create mode 100644 gcc/testsuite/g++.old-deja/g++.other/comdat3.h 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 index 00000000000..fc011e27ac8 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/comdat3-aux.cc @@ -0,0 +1,6 @@ +#include "comdat3.h" + +void f () +{ + const bool *p = &A::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 index 00000000000..1ea047d0674 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/comdat3.C @@ -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::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 index 00000000000..e2ec9709034 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/comdat3.h @@ -0,0 +1,8 @@ +template struct A { + static const bool b = false; +}; + +template +const bool A::b; + +void f ();