diff options
Diffstat (limited to 'gcc_arm/testsuite/g++.old-deja/g++.pt/explicit57.C')
-rwxr-xr-x | gcc_arm/testsuite/g++.old-deja/g++.pt/explicit57.C | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/gcc_arm/testsuite/g++.old-deja/g++.pt/explicit57.C b/gcc_arm/testsuite/g++.old-deja/g++.pt/explicit57.C new file mode 100755 index 0000000..d1f0ea8 --- /dev/null +++ b/gcc_arm/testsuite/g++.old-deja/g++.pt/explicit57.C @@ -0,0 +1,42 @@ +extern "C" void abort (); + +int a = 0; + +template <class T> void f (); +template <class T> void g () +{ + if (a) + abort (); +} + +template <> void g<char> () +{ +} + +template <class T> class C +{ + public: + void ff () { f<T> (); } + void gg () { g<T> (); } +}; + +template <class T> void f () +{ + if (a) + abort (); +} + +template <> void f<char> () +{ +} + +int main () +{ + C<int> c; + c.ff(); + c.gg(); + a = 1; + C<char> d; + d.ff(); + d.gg(); +} |