diff options
Diffstat (limited to 'gcc_arm/testsuite/g++.old-deja/g++.pt/explicit52.C')
-rwxr-xr-x | gcc_arm/testsuite/g++.old-deja/g++.pt/explicit52.C | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc_arm/testsuite/g++.old-deja/g++.pt/explicit52.C b/gcc_arm/testsuite/g++.old-deja/g++.pt/explicit52.C new file mode 100755 index 0000000..368573e --- /dev/null +++ b/gcc_arm/testsuite/g++.old-deja/g++.pt/explicit52.C @@ -0,0 +1,18 @@ +extern "C" void abort (); + +template <int a> inline int fact () +{ + return a * fact<a-1> (); +} + +template <> inline int fact<1> () +{ + return 1; +} + +int main() +{ + if (fact<3> () != 6 || fact<1> () != 1 + || fact<3> () != 6 || fact<1> () != 1 || fact<1+0> () != 1) + abort (); +} |