2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.pt / deduct5.C
blobc2951077217cfd85748615de4cd2c98cf5275dfb
1 // { dg-do run  }
2 // Copyright (C) 2000 Free Software Foundation, Inc.
3 // Contributed by Nathan Sidwell 13 Feb 2001 <nathan@codesourcery.com>
5 // Bug 1960. We were not dealing with qualified array types properly.
7 #include <stdio.h>
9 template <typename T> int Foo (T const *ptr)
11   static int count;
12   
13   printf ("%s\n", __PRETTY_FUNCTION__);
14   count++;
15   
16   return count;
19 int main ()
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;