aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.pt/deduct5.C
blob: 7c3769c88ab589dcf3e08ebe3a5883340acf5ec6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright (C) 2000 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 13 Feb 2001 <nathan@codesourcery.com>

// Bug 1960. We were not dealing with qualified array types properly.

#include <stdio.h>

template <typename T> int Foo (T const *ptr)
{
  static int count;
  
  printf ("%s\n", __PRETTY_FUNCTION__);
  count++;
  
  return count;
}

int main ()
{
  static int const cs = 1;
  static int const ca[1] = {1};
  static int s = 1;
  static int a[1] = {1};
  
  Foo (&cs);
  Foo (&ca);
  if (Foo (&s) != 2)
    return 1;
  if (Foo (&a) != 2)
    return 2;
  
  return 0;
}