diff options
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/template')
-rw-r--r-- | gcc-4.9/gcc/testsuite/g++.dg/template/friend56.C | 13 | ||||
-rw-r--r-- | gcc-4.9/gcc/testsuite/g++.dg/template/non-dependent14.C | 7 | ||||
-rw-r--r-- | gcc-4.9/gcc/testsuite/g++.dg/template/offsetof3.C | 18 | ||||
-rw-r--r-- | gcc-4.9/gcc/testsuite/g++.dg/template/ptrmem29.C | 10 | ||||
-rw-r--r-- | gcc-4.9/gcc/testsuite/g++.dg/template/ref9.C | 15 | ||||
-rw-r--r-- | gcc-4.9/gcc/testsuite/g++.dg/template/spec38.C | 6 |
6 files changed, 69 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/template/friend56.C b/gcc-4.9/gcc/testsuite/g++.dg/template/friend56.C new file mode 100644 index 0000000..7dd5d48 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/template/friend56.C @@ -0,0 +1,13 @@ +// Make sure we don't mistakenly mark f as DECL_COMDAT. +// { dg-final { scan-assembler "_Z1fv" } } + +void f(); + +template <class T> struct A +{ + friend void f(); +}; + +A<int> a; + +void f() { } diff --git a/gcc-4.9/gcc/testsuite/g++.dg/template/non-dependent14.C b/gcc-4.9/gcc/testsuite/g++.dg/template/non-dependent14.C new file mode 100644 index 0000000..b257d9b --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/template/non-dependent14.C @@ -0,0 +1,7 @@ +// PR c++/64251 + +class DictionaryValue {}; +template <typename T> void CreateValue(T) { + DictionaryValue(0); + CreateValue(0); +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/template/offsetof3.C b/gcc-4.9/gcc/testsuite/g++.dg/template/offsetof3.C new file mode 100644 index 0000000..b173746 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/template/offsetof3.C @@ -0,0 +1,18 @@ +// PR c++/64487 + +struct foo { + int member; +}; + +template < int N> +struct bar {}; + +template <int N> +struct qux { + static bar<N+__builtin_offsetof(foo,member)> static_member; +}; + +template <int N> +bar<N+__builtin_offsetof(foo,member)> qux<N>::static_member; + +int main() { } diff --git a/gcc-4.9/gcc/testsuite/g++.dg/template/ptrmem29.C b/gcc-4.9/gcc/testsuite/g++.dg/template/ptrmem29.C new file mode 100644 index 0000000..7700c0b --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/template/ptrmem29.C @@ -0,0 +1,10 @@ +// PR c++/62659 + +struct D { + typedef int (D::*cont_func)(); + template <cont_func> struct B; + template <cont_func cont_f> void wait(B<cont_f> ***); + + int done(); + template <bool> void fix() { wait<&D::done>(0); } +}; diff --git a/gcc-4.9/gcc/testsuite/g++.dg/template/ref9.C b/gcc-4.9/gcc/testsuite/g++.dg/template/ref9.C new file mode 100644 index 0000000..983f627 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/template/ref9.C @@ -0,0 +1,15 @@ +// PR c++/63658 + +struct Descriptor {}; + +template <Descriptor & D> +struct foo +{ + void size (); +}; + +Descriptor g_descriptor = {}; + +template<> void foo<g_descriptor>::size() +{ +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/template/spec38.C b/gcc-4.9/gcc/testsuite/g++.dg/template/spec38.C new file mode 100644 index 0000000..6f06f14 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/template/spec38.C @@ -0,0 +1,6 @@ +// PR ipa/61659 + +// { dg-final { scan-assembler "_Z1fIiEvPT_" } } + +template <typename T> inline void f (T *); +template <> void f (int *) { } |