diff options
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.pt/local4.C')
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.pt/local4.C | 26 |
1 files changed, 26 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 100644 index 000000000..b199f1010 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/local4.C @@ -0,0 +1,26 @@ +// { dg-do run } +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(); +} |