diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.other/comdat3-aux.cc | 6 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.other/comdat3.C | 13 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.other/comdat3.h | 8 |
3 files changed, 27 insertions, 0 deletions
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 0000000..fc011e2 --- /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<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 index 0000000..1ea047d0 --- /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<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 index 0000000..e2ec970 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/comdat3.h @@ -0,0 +1,8 @@ +template <class T> struct A { + static const bool b = false; +}; + +template <class T> +const bool A<T>::b; + +void f (); |