1// { dg-do link }
2// This test should get a linker error for the reference to A<int>::i.
3// { dg-prune-output "ld: symbol" }
4// { dg-message "i" "" { target *-*-* } 0 }
5
6template <class T> struct B { static const int i = 3; };
7template <class T> struct A { static const int i = B<T>::i; };
8const int *p = &A<int>::i;
9
10int main ()
11{
12  // Examine p to prevent optimising linkers from discarding it.
13  return (p != 0);
14}
15