diff options
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.brendan/template21.C')
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.brendan/template21.C | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/template21.C b/gcc/testsuite/g++.old-deja/g++.brendan/template21.C new file mode 100644 index 000000000..3bfd0cfc4 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.brendan/template21.C @@ -0,0 +1,43 @@ +// { dg-do assemble } +// GROUPS passed templates +template<class T> +class L { +public: + L(); + + T x[30]; + int doit(int i) const; +}; + +#ifdef BUG +template<class T> +int +L<T>::doit(int i) const +{ + return x[i].z; +} +#endif + +class X { +public: + class Y { + public: + Y(); + Y(int); + + int z; + }; + + L<Y> ly; +}; + +#ifndef BUG +template<class T> +int +L<T>::doit(int i) const +{ + return x[i].z; +} +#endif + +static X x; |