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 ();