Debian Codegraph @

gcc/testsuite/g++.old-deja/g++.pt/const2.C

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