summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.pt/local4.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.pt/local4.C')
-rwxr-xr-xgcc/testsuite/g++.old-deja/g++.pt/local4.C25
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/local4.C b/gcc/testsuite/g++.old-deja/g++.pt/local4.C
new file mode 100755
index 0000000..6a7eb34
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/local4.C
@@ -0,0 +1,25 @@
+extern "C" void abort();
+
+template <class T>
+struct S {};
+
+S<int> si;
+
+template <class T>
+int f(T t)
+{
+ struct S {
+ int g(int i) { return i + 2; }
+ };
+
+ S s;
+
+ return s.g(t) + s.g(t);
+}
+
+
+int main()
+{
+ if (f(3) != 10)
+ abort();
+}