Debian Codegraph @

gcc/testsuite/g++.old-deja/g++.pt/deduct5.C

raw
1 // { dg-do run }
2 // Copyright (C) 2000 Free Software Foundation, Inc.
3 // Contributed by Nathan Sidwell 13 Feb 2001 <[email protected]>
4
5 // Bug 1960. We were not dealing with qualified array types properly.
6
7 #include <stdio.h>
8
9 template <typename T> int Foo (T const *ptr)
10 {
11 static int count;
12
13 printf ("%s\n", __PRETTY_FUNCTION__);
14 count++;
15
16 return count;
17 }
18
19 int main ()
20 {
21 static int const cs = 1;
22 static int const ca[1] = {1};
23 static int s = 1;
24 static int a[1] = {1};
25
26 Foo (&cs);
27 Foo (&ca);
28 if (Foo (&s) != 2)
29 return 1;
30 if (Foo (&a) != 2)
31 return 2;
32
33 return 0;
34 }