aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/template/error40.C
blob: 7746ed2cee3e3c16edcadc50c41ef8b1b26c4922 (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
// { dg-options "-fno-pretty-templates" }

template <class T, int N=0, int X=1>
struct A
{
  struct AN;
};

void foo(void)
{
  A<void> a = 0;		// { dg-error "A<void, 0, 1>" }
}

template <class T> T f(T);	    // { dg-message "int f<int>.int." }
template <class T> T f(T, int = 0); // { dg-message "" }

template <class T>
struct B
{
  typedef typename T::AN BN;

  BN f();			// { dg-message "AN" }
  BN f(int = 0);		// { dg-message "" }
};

int main()
{
  f(1);				// { dg-error "" }
  // { dg-message "candidate" "candidate note" { target *-*-* } 28 }
  B<A<int> >().f();		// { dg-error "" }
  // { dg-message "candidate" "candidate note" { target *-*-* } 30 }
}