summaryrefslogtreecommitdiff
path: root/gcc_arm/testsuite/g++.old-deja/g++.pt/instantiate4.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc_arm/testsuite/g++.old-deja/g++.pt/instantiate4.C')
-rwxr-xr-xgcc_arm/testsuite/g++.old-deja/g++.pt/instantiate4.C27
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc_arm/testsuite/g++.old-deja/g++.pt/instantiate4.C b/gcc_arm/testsuite/g++.old-deja/g++.pt/instantiate4.C
new file mode 100755
index 0000000..296356b
--- /dev/null
+++ b/gcc_arm/testsuite/g++.old-deja/g++.pt/instantiate4.C
@@ -0,0 +1,27 @@
+// Build then link:
+
+// Special g++ Options: -frepo -Werror
+
+// 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();
+}