diff options
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.pt/instantiate4.C')
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.pt/instantiate4.C | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/instantiate4.C b/gcc/testsuite/g++.old-deja/g++.pt/instantiate4.C new file mode 100644 index 000000000..d7a8cab31 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/instantiate4.C @@ -0,0 +1,31 @@ +// { dg-do link } +// { dg-options "-frepo -Werror" } +// { dg-require-host-local "" } +// { dg-skip-if "dkms are not final links" { vxworks_kernel } } + + +// Submitted by Melissa O'Neill <oneill@cs.sfu.ca> +// the vtable of Foo<int> wouldn't be generated + +template <typename A> +struct Foo { + virtual void foo() {} +}; + +template <typename A> +struct Bar { + void bar(); +}; + +template <typename A> +void Bar<A>::bar() { + Foo<A> oof; +} + +int main () { + Bar<int> rab; + + rab.bar(); +} + +// { dg-final { cleanup-repo-files } } |