Merge from mainline (167278:168000).
[official-gcc/graphite-test-results.git] / gcc / testsuite / g++.dg / template / error40.C
blob7746ed2cee3e3c16edcadc50c41ef8b1b26c4922
1 // { dg-options "-fno-pretty-templates" }
3 template <class T, int N=0, int X=1>
4 struct A
6   struct AN;
7 };
9 void foo(void)
11   A<void> a = 0;                // { dg-error "A<void, 0, 1>" }
14 template <class T> T f(T);          // { dg-message "int f<int>.int." }
15 template <class T> T f(T, int = 0); // { dg-message "" }
17 template <class T>
18 struct B
20   typedef typename T::AN BN;
22   BN f();                       // { dg-message "AN" }
23   BN f(int = 0);                // { dg-message "" }
26 int main()
28   f(1);                         // { dg-error "" }
29   // { dg-message "candidate" "candidate note" { target *-*-* } 28 }
30   B<A<int> >().f();             // { dg-error "" }
31   // { dg-message "candidate" "candidate note" { target *-*-* } 30 }