diff options
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.pt/array1.C')
-rwxr-xr-x | gcc/testsuite/g++.old-deja/g++.pt/array1.C | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/array1.C b/gcc/testsuite/g++.old-deja/g++.pt/array1.C new file mode 100755 index 0000000..669600f --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/array1.C @@ -0,0 +1,10 @@ +template <class T, unsigned N> + unsigned size(T (&)[N]) { return N; } +template <class T, unsigned N> + unsigned size(T const (&)[N]) { return N; } + +int main() { + short iarray[] = { 1, 2, 3, 4, 5 }; + const short carray[] = { 1, 2, 3, 4, 5 }; + return size(iarray) - size(carray); +} |