summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/template/array19.C
blob: 79abf47c17a89fe8dde78b4cc7d062df956cce81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// PR c++/33553
// { dg-do compile }

template <class T> struct S { static const int sz = 2; };
template <class T> struct U { enum { sz = 2 }; };

template <class R>
struct P
{
  template <class T> void bar (int (&x)[S<T>::sz]);
  template <class T> void baz (int (&x)[U<T>::sz]);
};

P<int> p;

void
foo (void)
{
  int x[2];
  p.bar<int> (x);
  p.baz<int> (x);
}