diff options
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.pt/explicit57.C')
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.pt/explicit57.C | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit57.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit57.C new file mode 100644 index 000000000..ba841021e --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit57.C @@ -0,0 +1,43 @@ +// { dg-do run } +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(); +} |